Skip to content
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

don't store empty content values if element is new for site #16818

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Mar 3, 2025

Description

This PR ensured that when the element we’re saving is new for the site, we store all the default content. However, if the serialised value is empty and the element is new for a site, the empty value shouldn’t be saved.

steps to reproduce:

  1. clean install of at least 5.4.4
  2. create a local filesystem
  3. create a volume using that filesystem
  4. create an assets field
  5. create 2 entry types, each with a title and that assets field, leave all as default, and make the assets field mandatory for both entry types
  6. create a section with both entry types
  7. upload one image to assets
  8. create an entry in that section, switch entry type, select the asset from the previous step and attempt to save
  9. if you see a validation error and the assets field is empty - replication is done;
  10. if all saves as expected, then edit the section from step 6, switch the order of the entry types and save
  11. create a new entry as per step 8 - you should see the validation error for the assets field, and that field should be empty

Thanks, @olivierbon, for lots of extra info that helped get to the bottom of this issue!

Related issues

#16797

@i-just i-just requested a review from brandonkelly March 3, 2025 17:48
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

Successfully merging this pull request may close these issues.

1 participant