"Text (Formatted, long)" are falsely marked as changed

Created on 30 June 2023, over 1 year ago

Problem/Motivation

When using a "Text (Formatted, long)" field type, it will in some HTML always return as changed. I think this is because the old_value is inlined without any line breaks. The new_value is apparently using line breaks.

Steps to reproduce

  • Create a node type with a Text (Formatted, long) field.
  • Create an observer and make sure it's being attached and notified.
  • Add the following HTML to the field and save the node.
  • Go ahead and again save the node.
  • Now note, that even when we now do not expect the field to be marked as changed, it is actually returned in your observer from `getChangedFields()`.

HTML:

<ul>
	<li>This is a test line.</li>
</ul>

Proposed resolution

I'm having the feeling this is a core issue since I notice that in ./src/EntitySubject.php:100 the values are simply being retrieved via core's native Field API. This could also be a project specific issue, but I cannot see how that would be the case at this point. But in that case, I'll report back here.

Remaining tasks

  • Check where this discrepancy is originating from (core / changed_fields / project specific)
  • Write fix.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Active

Version

3.5

Component

Code

Created by

🇳🇱Netherlands aken.niels@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024