Tagged: upload field
April 13, 2018 at 5:16 am #8830sthamMember
I basically have the same problem as mentioned in this topic > https://piklist.com/support/topic/only-one-image-is-saved/
I have an upload field in a metabox for a custom post type like so:
piklist( 'field', array( 'type' => 'file', 'scope' => 'post_meta', 'label' => __( 'Images', 'sophi' ), 'field' => 'sophi_place_gallery_photos', 'options' => array( 'modal_title' => __( 'Add Image', 'sophi' ), 'button' => __( 'Add', 'sophi' ) ), 'validate' => array( array( 'type' => 'image' ) ) ) );
I need the field to accept any number of images that the user would want to attach. Currently, the field will only save one image at a time. I can select multiple images to add (in the modal) but after clicking on the post publish/update button, only the last image gets saved and the other images disappear.
I tried the same update instructions as nnovosad, i.e. the ones from here > https://piklist.com/support/topic/9-9-data-update-script-not-triggered/#post-8808
I didn’t get any errors but the problem still persists.
This code was working fine about 2-3 weeks ago. I didn’t touch it after that and only noticed earlier this week that it stopped saving more than one image at a time.
I checked the db and found that there used to be multiple entries of
sophi_place_gallery_photos(for a single custom post type) in the
postmetatable, each with the ID of the image attachment that I had saved. Now, only one entry exists per post, even when I attempt to save multiple images at a time.
Any suggestions on how to fix this would be much much appreciated.
Thanks in advance.
April 13, 2018 at 4:27 pm #8837SteveKeymaster
Sorry about that. We just release v0.9.9.16 which should fix the issue.
April 13, 2018 at 10:06 pm #8840sthamMember
Thanks so much, Steve! Works like a dream now.
April 13, 2018 at 10:49 pm #8841SteveKeymaster
Great! Closing this ticket.
- The topic ‘Uploader field only saves one file instead of multiple’ is closed to new replies.