Skip to content

[WIP][FEATURE] Add dbdoctor rule for orphaned translation records#171

Open
ErHaWeb wants to merge 1 commit intololli42:mainfrom
ErHaWeb:feature/orphaned-translation-records
Open

[WIP][FEATURE] Add dbdoctor rule for orphaned translation records#171
ErHaWeb wants to merge 1 commit intololli42:mainfrom
ErHaWeb:feature/orphaned-translation-records

Conversation

@ErHaWeb
Copy link

@ErHaWeb ErHaWeb commented Feb 6, 2026

Add health checks to clean up translated records that are orphaned due to
missing language support in the target context:

  • Remove translated records whose sys_language_uid is not configured in the
    resolved site configuration.
  • Remove translated records (except pages) whose pid has no corresponding
    page translation for the record language.

The checks follow DataHandler::copyL10nOverlayRecords() semantics, work
correctly in multisite setups, skip non-site contexts and provide safe
fix suggestions (soft-delete where supported).

Resolves: #87, #119

@ErHaWeb ErHaWeb force-pushed the feature/orphaned-translation-records branch 2 times, most recently from c3fb276 to 0101c5a Compare February 9, 2026 10:36
Add health checks to clean up translated records that are orphaned due to
missing language support in the target context:

* Remove translated records whose sys_language_uid is not configured in the
  resolved site configuration.
* Remove translated records (except pages) whose pid has no corresponding
  page translation for the record language.

The checks follow DataHandler::copyL10nOverlayRecords() semantics, work
correctly in multisite setups, skip non-site contexts and provide safe
fix suggestions (soft-delete where supported).

Resolves: lolli42#87, lolli42#119
@ErHaWeb ErHaWeb force-pushed the feature/orphaned-translation-records branch from 0101c5a to bdc0dea Compare February 9, 2026 10:48
@lolli42
Copy link
Owner

lolli42 commented Mar 4, 2026

This reads plausible at first glance. Needs a good review keeping details in mind, though.

->orderBy('uid');

if ($isTableWorkspaceAware) {
// Skip DELETE_PLACEHOLDER records (t3ver_state = 2), those are workspace internals.
Copy link
Owner

Choose a reason for hiding this comment

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

not yet fully convinced here: delete_placeholders are overlays for live records to say "this live record does not exist in this workspace anymore". their sys_language_uid value may be irrelevant so it may be ok to skip them here. BUT: if we delete a live record here that has a delete_placeholder in some workspace, this delete_placeholder would be orphaned. As such, I guess we should probably establish another check looking for such cases, probably rather late in the chain. Can be done with a separate issue and patch, though.

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.

Check page localization exists for records having sys_language_uid > 0

2 participants