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

Renaming Options in List Type Custom Field Removes Existing Article Assignments #44411

Open
keep opened this issue Nov 5, 2024 · 3 comments
Open

Comments

@keep
Copy link

keep commented Nov 5, 2024

Steps to reproduce the issue

  • Create a custom field of type "List"
  • Add some options to this list field (e.g., option name 'joomla').
  • Assign this list field with the selected option to an article, saving it so it stores in #__fields_values.
  • Edit the custom field, rename the existing option (e.g., change 'joomla' to 'Joomla!'), and save the changes.

Expected result

The renamed option ('Joomla!') should update for all articles that were previously assigned the original option ('joomla') in #__fields_values.

Actual result

The rename action updates the field itself, but the original assignment in #__fields_values is removed, causing the field to lose its value in the article.

Additional comments

Option modification could be quite common, for instance, when fixing typos, updating names after marriage, or making other adjustments. This issue could impact data consistency, as existing assignments of the modified field value are lost from #__fields_values, which can lead to unintended data removal in articles that depend on these custom fields.

@brianteeman
Copy link
Contributor

This issue could impact data consistency, as existing assignments of the modified field value are lost from #__fields_values, which can lead to unintended data removal in articles that depend on these custom fields.

That is exactly why it works the way that it does. Imagine completing a form that has a field "no you cannot have my money" and someone changes the field to "yes I owe you a million"

@keep
Copy link
Author

keep commented Nov 5, 2024

I can understand that, but what if we encounter this scenario:

A news page has multiple editors, and the articles can have several list-type attributes, such as contributors, sources, illustrators, supporters, etc. These are stored as field values.

An editor adds a new value to the "illustrator" field: Jonh Doe, and assigns it to many articles. A few days later, another editor notices the typo—it should be John Doe, not Jonh Doe. What options does he have? Should he add a new option, check all articles (we have over 5,200) to find those with "Jonh Doe" and change it? I think the editor would prefer to simply correct the existing one.

Currently, if he changes the field option, it causes data loss without any notification.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44411.

@brianteeman
Copy link
Contributor

If you can think of a way to address both scenarios then a solution might be able to be provided. Currently I cant think of one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants