lolli42 / dbdoctor

TYPO3 CLI extension to find and fix DB inconsistencies
GNU General Public License v2.0
37 stars 6 forks source link

Inline children with language ALL (-1) #117

Open nhovratov opened 1 month ago

nhovratov commented 1 month ago

I had a case where some inline children had the language -1, while the parent was the default language 1. These children got deleted, probably due to inconsistent parent/children language. The question is: is this intended? Or should language -1 be ignored? Because technically it is possible to select language ALL for child elements (TCA type language), and for some reason the editors did this.

schliesser commented 1 month ago

Were they deleted by these checks?

Seems like the condition is missing a -1 check for the childRowLanguage:

if ($parentRowLanguage >= 0 &&  $childRowLanguage !== $parentRowLanguage) {

https://github.com/lolli42/dbdoctor/-/blob/c049f5ca2fc7b0d326b3a8ddda6957cf19e2e904/Classes/HealthCheck/InlineForeignFieldNoForeignTableFieldChildrenParentLanguageDifferent.php#L102

https://github.com/lolli42/dbdoctor/-/blob/c049f5ca2fc7b0d326b3a8ddda6957cf19e2e904/Classes/HealthCheck/InlineForeignFieldChildrenParentLanguageDifferent.php#L110-110

nhovratov commented 1 month ago

Sadly, I don't know it anymore and I don't have a log. But shouldn't childRowLanguage >= 0 be false for -1?

schliesser commented 1 month ago

Sorry, I've copied my changed line childRowLanguage >= 0 is not in the original code.

This is an example of InlineForeignFieldNoForeignTableFieldChildrenParentLanguageDifferent in my instance: image