• Resolved redknite

    (@redknite)


    i tried using the below code to add a file upload for pdf:

    array(
    ‘name’ => ‘Test File’,
    ‘desc’ => ‘Upload an image or enter an URL.’,
    ‘id’ => $prefix . ‘test_image’,
    ‘type’ => ‘file’,
    ‘allow’ => array( ‘url’, ‘attachment’ ) // limit to just attachments with array( ‘attachment’ )
    ),

    It adds the link to my “create new page” page that i want, I can click the button “upload” and it opens the default wordpress upload page, where i can see my current images, and i can upload new images, but when I click the use this image button, nothing happens. THis page also filters out PDFS, which is want i really want to use, but it does let me upload those as well.

    Could someone tell me what I’m doing wrong?

    https://www.ads-software.com/plugins/cmb2/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Could you pastebin all of the code you’re using for your field so that I can try and recreate myself?

    Thread Starter redknite

    (@redknite)

    yes. Here it is https://pastebin.com/d44Nq3iH

    lines 279 to 291 are what i added.

    This is a plugin called Cr3ativ conference. The plugin author is not responding on his page here.

    I can figure out the output for html if i could just get the file to attach correctly.

    If it’s easier, i can set up an account on my site where it’s all running. I really appreciate your help.

    Moderator Marius L. J.

    (@clorith)

    Hi,

    @redknite please don’t offer up access to your site, it goes way beyond the support offered on the WordPress forums, and is a level of responsibility you are pushing over on the developers that they should not be burdened with.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    It’s fine Clorith, I don’t mind.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Since you’re not actually using CMB2, I’m not going to be able to help you with this. I am not familiar at all with the plugin you’re using, and it’s definitely not using CMB/CMB2 to the best of my ability to identify.

    While I understand urgency and need to get things done, it has only been 18 hours at this point since you started your support thread on the plugin’s support forum, which technically isn’t that long.

    Thread Starter redknite

    (@redknite)

    thanks for the update. The plugin creator did get back to me and said that since it’s a free plugin they don’t offer consistent support. I asked several questions a couple weeks ago and didn’t get answers. I recently re-asked as well. I muddled through most of my issues, but this one i couldn’t figure out. I wasn’t sure if the plugin was on CMB but someone here: https://www.ads-software.com/support/topic/adding-default-values-for-custom-field-arrays?replies=3
    told me that it was CMB framework a couple weeks ago. I looked on the CMB github and the calls for meta custom fields look exactly the same. The code I added for the file upload came from that site too. Maybe that’s why it’s not working exactly?

    @marius sorry for the confusion, I wasn’t trying to over burden Michael, in fact I was trying to assist. I’ll take note of what you said in the future though.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Alright, I was at least partially wrong here. It does now appear to be using https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/ which is now the old version of the CMB series, and no longer developed or supported. This forum we’re on here is for CMB2 which is a fork and reworking and cleanup etc.

    That said, I’m not sure at the moment what would be going on. I wager the popup listing and whatnot is in part because it’s being told to only display images, and not other attachment types, and I’m not sure how to get around that.

    For the button part not working my primary hunch is some sort of error occurring with javascript, but I’d need to see things first hand to personally confirm.

    Thread Starter redknite

    (@redknite)

    thanks again for the help. If you ever have “freetime” and get a chance let me know if you find out anything or if there is anything else i can do to trouble shoot. Thanks again.

    Thread Starter redknite

    (@redknite)

    Michael,
    One last question, then i can let this go. If I could figure out how to load CMB2 on this plugin, is there a way to put on my form the ability to upload a pdf?

    This is a screenshot of what I was hoping to achieve:
    Screenshot

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’d have to test to make sure myself. I believe if there’s any limitation to pdf, it may be partially outside the scope of CMB/2 and in part related to what the WP site is able to upload. I’ll do some tests a bit later and let you know where I succeed. Don’t hesitate to test yourself as well.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just tested and I didn’t have any issues with file upload field types and pdfs in either version of the CMB line. So I’m back at square one of not being sure in your case.

    Thread Starter redknite

    (@redknite)

    can you tell me what code you used? Thanks again. I’m finding that i can’t get wysiwyg doesn’t work either.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    If I recall right, it was the code you provided above.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘file upload issue’ is closed to new replies.