Cloned group copies previous 'image_advanced'
- This topic has 11 replies, 4 voices, and was last updated 6 years, 4 months ago by
KIM TAE YOUNG.
-
AuthorPosts
-
June 18, 2019 at 3:55 PM #14991
Pascal
ParticipantI saw a similar problem in a previous topic, but it wasn't quite the same.
When I create an 'image_advanced' field within a group, then save it, then add a new group, the 'image_advanced' field gets copied over. The images can be deleted and saved without problems. But they only appear again on a newly added group.
$meta_boxes[] = array( 'id' => 'example_metabox', 'title' => 'Example', 'post_types' => array('page'), 'context' => 'advanced', 'priority' => 'high', 'autosave' => 'false', 'fields' => array( array( 'id' => '_images_example', 'type' => 'group', 'default_state' => 'expanded', 'collapsible' => true, 'save_state' => true, 'clone' => true, 'sort_clone' => true, 'fields' => array( array( 'id' => '_images', 'type' => 'image_advanced', 'name' => 'Images', ), ), ), ), );
June 20, 2019 at 2:55 PM #15012Anh Tran
KeymasterHi Pascal,
I've just tested with your code and don't see the problem. Do you see any error in the dev console?
June 20, 2019 at 3:57 PM #15018Pascal
ParticipantHmm strange, I just tested the same thing in a fresh install and there it works as intended!
I do not see any errors in the dev console. I also tried to disable all plugins, including WPML which I thought that may cause issues, but it wasn't that either.
So I can't exactly tell what causes the problem, but as it works on a fresh install, the problem will probably lie somewhere within the theme.
The only thing that may help identify the problem is, that it does only take the images from the latest added group. So if I would have added 10 groups with images and I add the 11th, it will use the images from the 10th group.
I will try to do more testing, but the plugin doesn't seem to be the problem at least!
June 20, 2019 at 6:40 PM #15021Anh Tran
KeymasterGlad that it works now. Let me know if you find anything!
June 22, 2019 at 12:50 AM #15045Chicharito
ParticipantThis is happening on one of my installations too.
Last image copies to the new cloned field.
The console doesn't show any error.June 22, 2019 at 11:17 AM #15047June 25, 2019 at 12:16 AM #15074KIM TAE YOUNG
ParticipantHas not it been solved yet?
I have the same problem.June 25, 2019 at 8:49 AM #15077Anh Tran
KeymasterHi Kim, please send me a temporary admin account to check?
June 25, 2019 at 12:10 PM #15085KIM TAE YOUNG
ParticipantHi, Anh.
Temporary manager account information was sent via "Contact".
please check.June 27, 2019 at 5:45 AM #15118Chicharito
ParticipantThe project is in my local environment. I hope that you can work with Kim's
June 27, 2019 at 10:01 AM #15121Anh Tran
KeymasterHey guys, I've just found the bug and fixed it here:
https://github.com/wpmetabox/meta-box/commit/03df0e3e52ff69db981e81fedb62aca31e62c679
@Kim: I also applied the fix on your website and it works great.June 27, 2019 at 11:47 AM #15128KIM TAE YOUNG
ParticipantIt works very well.
Quick fix Thank you very much! -
AuthorPosts
- You must be logged in to reply to this topic.