#111588Extbase history tracking records properties without a TCA column
Description
Problem
With the feature extbase.enableHistoryTracking enabled, ExtbaseHistoryTracker writes every property of an entity into sys_history, not only the properties that are stored. A property without a TCA column is never written to the database, but it still ends up in the history record of the add and the modify action (both oldRecord and newRecord), under a column name guessed from the property name.
This affects protected properties that hold transient state. Since #95823, private properties of the model class are read as well, so values a model keeps private on purpose (for example a token) end up in sys_history.
Steps to reproduce
- Enable the feature
extbase.enableHistoryTracking. - Add a protected or private property without a TCA column to an Extbase model, and give it a value.
- Add and update the entity through its repository.
- Look at
history_dataof thesys_historyrows: the property is in there.
Expected
The history only contains uid, pid and the properties that are mapped to a TCA column, as only those are stored.
Cause
ExtbaseHistoryTracker::extractObjectData() iterates all properties returned by _getProperties() (or the original entity data) and falls back to camelCaseToLowerCaseUnderscored() for properties without a column map, instead of skipping them.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] Extbase history tracking records properties without a TCA column Resolves: #111588 Releases: main