Field Group – Sortable Options Bug
-
I have a field group with a text field and file list field.
When i insert information in the fields and saved everything works fine, however if i reorder the group of fields and save, the group of fields lose information.
-
Can you provide the code being used for the all of the associated fields/groups?
Definitely managing to repeat this, and I did find https://github.com/WebDevStudios/CMB2/issues/224 in our list of open issues.
That said, I found that using “file” instead of “file_list” worked just fine without data loss. I believe, since you’re using only 1 image per group, it doesn’t count as a repeatable field for the file input. I know the wiki says to use file_list for repeatable fields.
Worth trying out and seeing if that single change meets your needs.
Hi Michael, really need a file list field, i’m using to attach PDF documents. I think I’ll disable sortable option, that way I will not have problems, however this option is very important. If the file field to be compatible with the repetitive option, would solve my problem.
From what I found earlier the “file” field type DOES work and doesn’t lose data, unlike the “file_list” field type, and you’re able to still sort/add multiple pairings with it.
You should be good to go with that one change, unless I missed a detail somewhere.
For what it’s worth Angelo, the original code you’re trying, using file_list, does work in the trunk branch of CMB2, so there is a fix already in place for the issue, it just hasn’t reached the wordpress.org copy quite yet. I can point you to where to get the trunk version if you’re really anxious.
Thanks Michael, i want to test this brach, where can i download it? In the next release, will i lose any configuration to use the branch?
https://github.com/WebDevStudios/CMB2/archive/trunk.zip
All your configurations are stored in your own files, nothing stored via CMB2 itself, so you won’t be losing anything with an upgrade/switch.
After a DB update, all data in ‘file_list’ field was lost =(
SQL:UPDATE MySuperPrefix_options SET option_value = replace(option_value, 'http://my-old.url', 'http://my-new.url') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE MySuperPrefix_posts SET guid = replace(guid, 'http://my-old.url','http://my-new.url'); UPDATE MySuperPrefix_posts SET post_content = replace(post_content, 'http://my-old.url', 'http://my-new.url'); UPDATE MySuperPrefix_postmeta SET meta_value = replace(meta_value,'http://my-old.url','http://my-new.url');The ‘file_list’ field was in a group of fields.
Version 2.1.2 fix this?First I’ve personally heard of this, but also admittedly hard pressed to believe it’s specifically because of CMB2 itself.
Curious if parts of it were from serialized data and the character count in the serialized data didn’t match between the two domains. I know you have matching domains in the example above, but that may not be the case for the actual conversion.
Serialized data is a bit fickle like that, it just drops everything if there’s an error with it.
Michael Beckwith, i found the solution: https://wordpress.org/support/topic/migrating-without-losing-serialized-data?replies=11#post-3024456
Thanks for your attention.
Sounds like a good deal. Darned serialization.
The topic ‘Field Group – Sortable Options Bug’ is closed to new replies.