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

Save of checkbox field fails if Velocity var name of field is properties #18073

Closed
john-thomas-dotcms opened this issue Feb 28, 2020 · 6 comments · Fixed by #19724
Closed

Save of checkbox field fails if Velocity var name of field is properties #18073

john-thomas-dotcms opened this issue Feb 28, 2020 · 6 comments · Fixed by #19724

Comments

@john-thomas-dotcms
Copy link
Contributor

Describe the bug

If you create a checkbox field in a content type, and name it so that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved.

Note: I expect this will probably be a problem with any type of field, but the only one I tested with explicitly was checkbox.

Steps to reproduce the behavior:

  1. Open any Content Type.
  2. Add a Checkbox field.
    • Name it "Properties".
    • Add "Test|test" to the "Value" field.
  3. Go to the Content Search screen and create a new content item of that content type.
    • Leave the checkbox you created un-checked.
  4. Save the new content item and close the content editing popup.
  5. Re-open the same content item.
  6. Check the checkbox, then save and publish the content.
  7. Close the content editing popup.
  8. Re-open the same content item.
    Problem: The checkbox is not checked.

Expected behavior

The user should be able to save changes to any field we allow them to create.

This means that if properties is reserved for some reason, then when the user creates the field we should do one of the following:

  • Prevent creation of the field with that velocity var name, OR
  • Automatically increment the velocity var name (e.g. to properties1) to prevent a conflict.

Desktop (please complete the following information):

  • OS: Win 10 Pro
  • Chrome v76.0.3809.100
  • dotCMS v5.2.6 (authoring and demo)

Additional context

If possible, we should check to see if there are any other hidden potential name conflicts with velocity var names, other than just properties. So we should figure out where this conflict is coming from, and then figure out what other reserved words come from the same place, and make sure this same problem doesn't crop up again with some different velocity var name.

Acceptance Criteria

  1. Match the design
  2. Work in all the supported browsers (don't forget IE11 and iPad)
  3. Multilanguage
  4. Unit test
@stale
Copy link

stale bot commented May 28, 2020

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

@stale stale bot added the wontfix label May 28, 2020
@erickgonzalez erickgonzalez added this to the Bug Sprint milestone Jun 18, 2020
@stale stale bot removed the wontfix label Jun 18, 2020
@alfredo-dotcms alfredo-dotcms self-assigned this Dec 17, 2020
alfredo-dotcms added a commit that referenced this issue Dec 18, 2020
If you create a checkbox field in a content type, and name it so that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved.
nollymar pushed a commit that referenced this issue Dec 18, 2020
If you create a checkbox field in a content type, and name it so that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved.
alfredo-dotcms added a commit that referenced this issue Dec 22, 2020
…ield is `properties`

If you create a select field in a content type, and name it so that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved.
nollymar pushed a commit that referenced this issue Dec 23, 2020
…ield is `properties` (#19736)

If you create a select field in a content type, and name it so that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved.
@nollymar
Copy link
Contributor

Additional fix: #19736

@nollymar
Copy link
Contributor

Needs work: It doesn't work for Multiselect fields. The selected value is not kept

@nollymar nollymar modified the milestones: Maintenance Sprint, Scout Current Jan 4, 2021
alfredo-dotcms added a commit that referenced this issue Jan 4, 2021
…that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved.

#18073 fix
@alfredo-dotcms
Copy link
Contributor

nollymar pushed a commit that referenced this issue Jan 5, 2021
…that the Velocity variable name of the field is properties, then when you make changes to the field in the content editing screen and then save the content, your changes to that field will not be saved. (#19750)

#18073 fix
@nollymar
Copy link
Contributor

nollymar commented Jan 7, 2021

Passed internal QA

@bryanboza
Copy link
Member

Fixed, tested on release-21.02 // Postgres // FF

@nollymar nollymar modified the milestones: 011921_SCOUT, Scout Current Jan 26, 2021
@wezell wezell closed this as completed Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment