Lots of images in an image_advanced can wipe all images in that field on save
- This topic has 7 replies, 5 voices, and was last updated 7 years, 12 months ago by
Anh Tran.
-
AuthorPosts
-
April 28, 2016 at 10:28 PM #2953
agorski
ParticipantDiscovered a tricky-to-diagnose bug today. I have an image_advanced field that I'm using to create a simple gallery, and it's got close to 200 images in it. Adding and working with that many images is fantastic. However, recently the person who works on that page reported that when she made a change to the content field (not the image_advanced), all of the images disappeared.
I wasn't able to recreate the issue until just now. It turns out that if you save the page before all of the images load into the image_advanced metabox display, it saves the page without any images at all, and the next time the page loads, they're all gone.
I'd say this is a fairly major issue, but maybe that's the expected behavior? I'm not sure. I guess my solution would be... when saving, check if there's an image_advanced. If there is, has the content of it loaded? If yes, cool, overwrite what's in the DB, because changes may have been made. If it hasn't loaded yet, don't overwrite anything, or overwrite it with whatever it's currently requesting (same result in the end).
April 28, 2016 at 10:34 PM #2956Anh Tran
KeymasterHi Sam, thanks for describe the problem in details :). It helps a lot.
I think you're right about the problem: when images are not loaded, there are no inputs for images which stores image IDs, so when push the Update button, empty field is submitted and thus, no images are saved.
I will think more about your solution and make a fix for that.
May 20, 2016 at 6:36 PM #3132david82.rs
ParticipantHi Anh, Did you find a solution for this issue? I just discover the problem and i think is really important to fix this.
In one morning i had to re-upload the images three times! because the client did the upload page before all images was loaded.Thanks
May 20, 2016 at 10:13 PM #3134Anh Tran
KeymasterHi, we're working on that. First we tried to use hidden input as Sam suggested, but it had some problems with cloning feature. So we postpone to find a better solution. We'll update as soon as there's a good solution.
May 31, 2016 at 8:44 PM #3233nicolas
ParticipantI'm not sure, but I think this is a POST vars limit issue. It looks like a tricky problem one of my client had when saving her menu in WP. She had over 100 items in her menu and when she updated the menu with changes, parts of the menu just disappeared (like if they were overwritten or just dropped) what I did was augmented the value for max_input_vars to a larger number like 3000 (provided you have access to php's config). It helped but in the end I suggested the client to rethink the way she used her menu so she would need less items in it.
I'm not saying this is the same problem here, but it made me think of that issue I had so it might help you find a more accurate solution.
this link talks about the menu limit problem in wordpress: http://sevenspark.com/wordpress/menu-item-limit
May 31, 2016 at 8:48 PM #3234nicolas
ParticipantAfter rereading the issue, it doesn't seem to be a POST vars issue. Anyhow, it might still spark an idea to find a better solution!
May 11, 2017 at 9:39 AM #5823jroxbury
ParticipantHas anyone came up with a solution for this? This happens for me as well. Make a quick edit on a page and press update before the images are done loading they all disappear.
May 12, 2017 at 9:38 AM #5843Anh Tran
KeymasterUnfortunately, we haven't get a solution for it now. The speed of JS is still a problem.
-
AuthorPosts
- You must be logged in to reply to this topic.