Log MetaModel item changes with their rendered label, not table+id - #1589
Merged
Conversation
Adds a MetaModels-specific system log listener alongside dc-general's new generic one (create/duplicate/delete, see the accompanying dc-general change): LogPersistedItemsListener names an item the same way its edit mask headline and breadcrumb already do, through ItemLabelRenderer and the input screen's "subheadline" pattern, falling back to the record id where none is configured - see ".claude/dcg-systemlog.md". MetaModel items opt out of the generic listener (setLoggingEnabled(false) in DataProviderBuilder) so a change is not logged twice under two different wordings. The three configuration tables (render settings and friends) are unaffected and keep the generic wording, which is all that is meaningful for those. New per-MetaModel checkbox "enableLogging" in tl_metamodel, default on. Two bugs found while wiring this up and live-testing it, both fixed: method chaining in DataProviderBuilder lost the narrowed ContaoDataProviderInformation type psalm needed for setLoggingEnabled() because setVersioningEnabled()'s own interface declares the wider DataProviderInformationInterface as its return type; and the same "original model is never a literal null on create" pitfall the dc-general listener had, fixed the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a MetaModels-specific system log listener alongside dc-general's new generic one (create/duplicate/delete, see the accompanying dc-general change): LogPersistedItemsListener names an item the same way its edit mask headline and breadcrumb already do, through ItemLabelRenderer and the input screen's "subheadline" pattern, falling back to the record id where none is configured - see ".claude/dcg-systemlog.md".
MetaModel items opt out of the generic listener (setLoggingEnabled(false) in DataProviderBuilder) so a change is not logged twice under two different wordings. The three configuration tables (render settings and friends) are unaffected and keep the generic wording, which is all that is meaningful for those.
New per-MetaModel checkbox "enableLogging" in tl_metamodel, default on.
Two bugs found while wiring this up and live-testing it, both fixed: method chaining in DataProviderBuilder lost the narrowed ContaoDataProviderInformation type psalm needed for setLoggingEnabled() because setVersioningEnabled()'s own interface declares the wider DataProviderInformationInterface as its return type; and the same "original model is never a literal null on create" pitfall the dc-general listener had, fixed the same way.