[Resolved] Checkbox custom fields not staying selected in wp-admin post editor
This thread is resolved. Here is a description of the problem and solution.
Problem: Checkbox custom fields are not staying selected in the post editor, and sometimes I see an error related to a parent post field even though I did not modify that field.
Solution: Update to the latest version of Types.
This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I am trying to: edit an existing post of with some of the custom field settings and i can select the checkbox but as soon as I hit update on the post to publish the changes the selections don't save and it appears nothing changes on the front-end.
Link to a page where the issue can be seen: hidden link
I expected to see:
Selected checkboxes
Instead, I got:
empty checkboxes on backend.
I cannot provide FTP access at this time but arrangements can be made if its necessary.
Hi, I'm not currently able to log in using the credentials you provided. Can you double-check those? I will activate private reply fields here again.
We have been informed that there is currently an issue with checkboxes not being saved correctly under specific circumstances. It happens when saving a post in a many-to-many relationship, when an intermediary post type is used and there is an intermediary post connected to the current post. The problem can be resolved by updating to Types 3.0 and running the relationship migration process, if your site is ready for migration.
Please let me know if the situation I described matches what you're seeing in wp-admin. If not, I'll need to take a closer look.
I'm still having trouble logging in. When I visit the dev site now, I see the text "error" at the top of the page, and nothing else. Are you making adjustments to the site now?
Okay I was able to do some more investigation and replicate the parent field error message problem in a clone of your site, so I'm escalating the issue to my 2nd tier support team for additional debugging. I'll update you as soon as I have more information to share. It seems that edits to the child post are being saved correctly, despite the error message displayed.
Regarding the issue with the View not showing the correct results, I'm not exactly clear how it's not working correctly. In the screenshot attached you can see the Workshop editor screen in wp-admin, and I noticed the Presenter 4 box is "none". If I change that to be "reg presenter 4" then the results on the front-end change. I see 5 results instead of 4, but it appears to be because the Cox and Heron presentations are both scheduled in the 3rd slot.
So I think I need more information to understand how it is not working as expected. Can you provide more detail, considering that I'm not really familiar with your application? Thank you.
Here is a link to this page on the live website: hidden link
Here is the same page on the updated dev site: hidden link
On the live website you see each presentation is showing in its designated slot.
On the Dev site you see all presentations are showing duplicated and showing on both presentation blocks. The upper section is supposed to show the first half, and the second block to show the second half of the presentations. In the backend we are able to set how many presentations show on the front end for each block and the view is supposed to show them according to how they are set. So if we have the first set to have 3 presentations and the second set to have three presentations then the 10:00 block should have first three (1, 2 &3) and the second block the next three (4, 5, 6).
This is the problem we are having and its the toolset upgrade with the migration that is causing this issue across the board on all of our workshops. if I need to update the view then I can do this but I am not sure why it broke.
It helps, yes. What seems to be happening on this particular Workshop is that these two fields are set to "none":
Order of Events - Sessions Set 1 - Presenter 4
Order of Events - Sessions Set 2 - Presenter 4
The value of the "none" option is saved as "0". However, when the custom field is passed into the shortcode argument for the View using the Types field shortcode, the value is output as "" (an empty string), not "0":
Since this empty value is passed into the shortcode attribute, the filter in the View matches all speaking order positions and the conditional in each Loop Template now evaluates as true because the value is not zero, it's empty:
[wpv-conditional if="( $(wpcf-speaking-order-posit).id(presentation) ne '0' )"]
To fix this, I replaced all the Types field shortcodes in the View's shortcode attributes with wpv-post-field, which outputs "0" instead of an empty string for the speaking positions set to "none". I believe the results are more like what you'd expect now, can you confirm?
If so, then I can do some deeper investigation into why this behavior changed in the upgrade process.
Okay thanks for confirming. The status of both these issues is escalated to my 2nd tier support team for further investigation, and I'll update you as soon as I have more information to share.
I looked at the escalated thread for this, I see where it has been escalated under our Types usability issues but no update has been made on it by our development team as yet.
Hi, just a quick update to let you know the issue where incorrect error messages are being shown in wp-admin will be fixed in the next release of Types. Right now that is tentatively scheduled in the next couple of days. I will keep you posted here.
Thank you for the information on the new update. I will apply that as soon as I see it released.
For your previous reply:
"To fix this, I replaced all the Types field shortcodes in the View's shortcode attributes with wpv-post-field, which outputs "0" instead of an empty string for the speaking positions set to "none". I believe the results are more like what you'd expect now, can you confirm?"
I do not understand what you mean by "I replaced all the Types field shortcodes in the View's shortcode attributes with wpv-post-field"
Can you provide an example so that I can apply these changes to the live website?