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

Fields with links and   get marked as modified on focus. #90

Closed
thupsi opened this issue Apr 26, 2023 · 6 comments
Closed

Fields with links and   get marked as modified on focus. #90

thupsi opened this issue Apr 26, 2023 · 6 comments
Assignees
Labels

Comments

@thupsi
Copy link

thupsi commented Apr 26, 2023

Description

See #85

Steps to reproduce

  1. Create a CKEditor field and add it to an entry type.
  2. Go to an entry and add a link or a   entity (eg by hitting ENTER twice, which creates an empty paragraph).
  3. Save the entry.
  4. Click in the field, withour typing anything.
  5. The field appears dirty.

Additional info

  • Craft version: 4.4.8
  • PHP version:
  • Database driver & version:
  • Plugins & versions: CKEditor 3.2.1
@thupsi thupsi added the bug label Apr 26, 2023
@brandonkelly brandonkelly self-assigned this Apr 29, 2023
@brandonkelly
Copy link
Member

Fixed for the next release! Thanks for reporting.

@brandonkelly
Copy link
Member

3.3.0 is out with that fix 🎉

@thupsi
Copy link
Author

thupsi commented Jun 7, 2023

@brandonkelly This issue has been reintroduced, this time only for links (as far as I can tell). I'm on Craft 4.4.13, CKeditor 3.4.0

@brandonkelly
Copy link
Member

Able to reproduce with links with rel attributes. HTML Purifier is moving that attribute to the end of the <a> tag, causing CKEditor to want to re-normalize it back to before the href attribute, which makes Craft think the field value has changed.

We’ll see what we can do to work around that…

@brandonkelly brandonkelly reopened this Aug 11, 2023
brandonkelly added a commit that referenced this issue Aug 11, 2023
Avoids inconsequential HTML changes due to normalization from getting recognized as actual field value changes (#90)
@brandonkelly
Copy link
Member

Just realized there’s an easy solution to this: have the editor spit out its normalized value immediately on initialization, before Craft has captured the initial form values for change tracking. So this is now really fixed for the next release.

@brandonkelly
Copy link
Member

CKEditor 3.5.0 is out with this fix 🎉

Note that the update requires Craft 4.5.0.

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

No branches or pull requests

2 participants