Skip Navigation

[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 5 years, 10 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 16 replies, has 3 voices.

Last updated by Christian Cox 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#911956

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.

#912090

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.

#912786
#913107

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?

#913224
Screen Shot 2018-06-13 at 7.36.17 PM.png

ok the login works now. It was not changing for some reason.

I was not editing anything earlier on the dev site.

Where are you seeing the text error? I dont see any text errors on the front-end of the dev site See my screenshot.

#913555

Thanks, I was able to log in this time without any errors. I'm working on the issue now an I'll update you shortly.

#913582

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.

#914465
Live Site Screenshot.png
Dev Site Screenshot..png

to clarify the front end view issue:

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.

Does that help to clarify it?

Thank you,

#914829

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":

[types field="order-events-set-2-presenter-4" output="raw"][/types]

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.

#915039

Yes this is exactly what we were expecting and how it was functioning prior to the update.

What is the status of the piece that was escalated?

#915317

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.

#919632

I need to know the status of this escalated ticket. I need to make these changes on the live website so that the checkboxes work on our live website.

Thank you.

#920506

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Laura,

As Christian is currently on Vacation.

I'll be checking in on his queue.

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.

Thanks,
Shane

#923505

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.

#924454

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?

Thank you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.