Skip to content

file_list file download button not downloading file #1130

Closed

Description

@cggit

When uploading a PDF or Doc as a field type of "file_list" the resulting Download button from (Download/Remove) opens a media modal instead of downloading.

My fix is

.on( 'click', '.cmb-attach-list li, .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span', cmb.handleFileClick )
to
.on( 'click', '.cmb2-media-status .img-status, .cmb2-media-status .file-status > span', cmb.handleFileClick )

and

CMB2/js/cmb2.js

Line 220 in 4bc8e98

var $el = $( this );
to
var $el = $( this ).hasClass('cmb2-media-item') ? $(this) : $(this).closest('.cmb2-media-item');

Can someone else confirm the problem and solution?

Activity

  1. jtsternberg commented on May 7, 2018

    @jtsternberg
    Member

    Can you paste the before/after code or open a PR, or link to the related lines in github? The lines you are referencing do not make sense.

    https://github.com/CMB2/CMB2/blob/trunk/js/cmb2.js#L77
    https://github.com/CMB2/CMB2/blob/trunk/js/cmb2.js#L169

  2. jtsternberg commented on May 7, 2018

    @jtsternberg
    Member

    I think it should be good now. Please test the trunk branch.

  3. cggit commented on May 7, 2018

    @cggit
    Author

    Great. That works too and is most slick! I updated my comment just so I know how to properly reference next time

  4. added a commit that references this issue on Oct 12, 2026
    4bc8e98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions