Skip to content

FIX Allow dot notation on HTMLEditorField #11702

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

Conversation

RuthAdele
Copy link

@RuthAdele RuthAdele commented Apr 16, 2025

Description

Currently, using dot notation in a HTMLEditorField does not save the data to the database.
No errors are thrown - the UI updates, so it appears it has saved (unless you refresh the page, you can't see that it hasn't)

This fix aligns HTMLEditorField with the dot notation allowance that is in FormField::saveInto().

Manual testing steps

Create a HTMLEditorField which uses dot notation. Update content and save. Check that it has saved in the database.
e.g.

HtmlEditorField::create('RelatedObject.PropertyName', 'Property Name')

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@RuthAdele RuthAdele changed the title Allow dot notation on HTMLEditorField FIX Allow dot notation on HTMLEditorField Apr 28, 2025
@RuthAdele
Copy link
Author

@GuySartorelli Is there anything you need me to do to bring this into a release?

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few things to change:

  1. There will be no more minor releases in CMS 5 - but this is safe to merge into a patch release. Please retarget to the 5.4 branch. You will probably need to reset your commits after retargetting the PR.
  2. Please add a test so that we can avoid this bug regressing in the future.
  3. Please create and link to a relevant GitHub Issue for this (or if one already exists, link to that) in the "Issues" section. We track issues, not pull requests.
  4. I have added back the pull request checklist which would have been there when you originally created the PR. Please tick all the boxes that apply, making sure to read the relevant documentation to ensure everything is set up correctly.

Actual functionality

This doesn't actually save the related record. It does store the value into the record in memory (same as what FormField::saveInto() does) - but write() is never called on the related record, which means the new value isn't saved in the database.

Are there additional steps I need to take to actually save the value, which haven't been included in the PR description?

@RuthAdele RuthAdele changed the base branch from 5 to 5.4 June 4, 2025 00:12
@GuySartorelli
Copy link
Member

GuySartorelli commented Jun 5, 2025

@RuthAdele Looks like you've brought along a bunch of commits that aren't related to your change. Please reset your commits.
Or, if it's easier, you can create a new PR that starts with the 5.4 branch as a base from the get-go.

@RuthAdele RuthAdele closed this Jul 16, 2025
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.

3 participants