Skip to content

Custom image fields: checkboxes don't get saved #1267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
daun opened this issue Oct 30, 2020 · 4 comments
Closed

Custom image fields: checkboxes don't get saved #1267

daun opened this issue Oct 30, 2020 · 4 comments

Comments

@daun
Copy link

daun commented Oct 30, 2020

Short description of the issue

When adding checkboxes as custom image metadata fields, the data doesn't seem to save. Neither in normal page edits nor in Repeater contexts. The data is being transferred as POST data and normal text fields are saving as expected.

Example request data (video_url is saved, autoplay isn't):

video_url_images_1249012c0808866acd48b3015fdaeff6: https://vimeo.com/391193091
autoplay_images_1249012c0808866acd48b3015fdaeff6: 1

Example repeater request:

video_url_images_repeater1210_66561f4fb1719146c3764ba2ef161aec: https://vimeo.com/391193091
autoplay_images_repeater1210_66561f4fb1719146c3764ba2ef161aec: 1

Expected behavior

Checkboxes are saved and the data in the filedata column will be 1.

Actual behavior

Data in the filedata column is 0.

Steps to reproduce the issue

  1. Add a checkbox field to the image data template (files-images)
  2. Add an image, check the box, save the page.
  3. Check the image metadata (box will be unchecked).

Setup/Environment

  • ProcessWire version: 3.0.168
  • (Optional) PHP version: 7.3
  • (Optional) MySQL version: 5.7.26
@Toutouwai
Copy link

I tested this but couldn't reproduce the problem. The checkbox in the image custom fields saved properly in both states.

Screencast:
cb

@ryancramerdesign
Copy link
Member

@daun Is the test case that Toutouwai setup consistent with the one that you are using, or can you spot any differences that might account for it? Also, are any field dependencies (show if...) involved?

@Toutouwai Thanks for setting up the test case that you did.

@daun
Copy link
Author

daun commented Nov 13, 2020

@ryancramerdesign Thanks, Ryan, you pointed me in the right direction. Looks like a show-if dependency is the culprit here. If I remove that, the checkbox field works as expected.

Are those kinds of dependencies not supported? They do show and hide correctly on the frontend.

@daun
Copy link
Author

daun commented Nov 14, 2020

Duplicate of #1269, closing.

@daun daun closed this as completed Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants