63615[BUGFIX] Align new page module behavior with PageLayoutView
Commit message
Review
-
Code review CR +2 Done
- Daniel Goerz +2
- Georg Ringer +1
- Oli Bartsch +1
-
Verified V +2 Done
- Daniel Goerz +2
- Georg Ringer +1
- Oli Bartsch +1
- TYPO3com +1 CI
Issues 3
Files 9
- typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php+2 −1
- typo3/sysext/backend/Classes/View/BackendLayout/Grid/LanguageColumn.php18+6 −56
- typo3/sysext/backend/Classes/View/BackendLayout/BackendLayout.php+1 −6
- typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php+14 −0
- typo3/sysext/backend/Classes/View/Drawing/BackendLayoutRenderer.php+1 −0
- typo3/sysext/backend/Resources/Private/Partials/PageLayout/Grid/Column.html+2 −2
- typo3/sysext/backend/Resources/Private/Partials/PageLayout/Record/Header.html+2 −2
- typo3/sysext/backend/Resources/Private/Partials/PageLayout/LanguageColumns.html2+1 −1
- typo3/sysext/backend/Resources/Private/Partials/PageLayout/Record.html+3 −3
Review log 2737
Show 1012 earlier messages
-
Oli Bartsch uploaded patch set 1 03/08/20, 09:30
-
TYPO3com voted on patch set 1 V +1 03/08/20, 09:41 Completed build in 11m 02s on Sun, 8 Mar, 09:41 AM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1113
-
Claus Due commented on patch set 1 03/08/20, 09:55
To my understanding, "allowTranslate" must be true before "allowTranslateCopy" is even considered. The patch currently detaches the two booleans and I'm not sure this is the intended behavior. Can you point to the place in PageLayoutView where these booleans are considered independently? As far as I could determine when writing the initial patch, they are not considered independently.LanguageColumn.php:170Please don't move methods around, it's an unrelated change and it makes it harder to determine what was actually changed and what is the same.LanguageColumn.php:190This would change public API and does not appear to be used in templates. Method should probably be protected. -
Claus Due commented on patch set 1 03/08/20, 09:57
LanguageColumn.php:207This appears to be a functionless and unrelated change; although EA inspections recommend "drop intermediate variable" this refactoring makes it harder to debug the code since you cannot add a break point to inspect $contentFetcher which holds the translation data. -
Claus Due commented on patch set 1 03/08/20, 09:58
As far as possible please avoid making changes that move code around or change assignment of variables without changing functionality. Keeps the diff small and clean ;) -
Oli Bartsch uploaded patch set 2 03/08/20, 11:01
-
Oli Bartsch commented on patch set 2 03/08/20, 11:05
LanguageColumn.php:170ReplyAckLanguageColumn.php:190ReplyDoneLanguageColumn.php:207ReplyAck -
TYPO3com voted on patch set 2 V +1 03/08/20, 11:16 Completed build in 14m 29s on Sun, 8 Mar, 11:16 AM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1121
-
Oli Bartsch commented on patch set 2 03/08/20, 11:20
> Patch Set 1: > > (2 comments) > > To my understanding, "allowTranslate" must be true before "allowTranslateCopy" is even considered. The patch currently detaches the two booleans and I'm not sure this is the intended behavior. Can you point to the place in PageLayoutView where these booleans are considered independently? As far as I could determine when writing the initial patch, they are not considered independently. As far as I understand - and this is also what the forge issues is about - allowTranslate and allowTranslateCopy should be considered independently as this is already the case in the old PageLayoutView. I can not see any evidence allowTranslateCopy is not considered after allowTranslate is confirmed to be FALSE. Display of the button in the old one is depending on: * permissions (`doEdit`, 'sys_laguage_uid', user edit permissions) * $defaultLanguageUids (Which indicates if there are records to translate / copy) If you further test the old PageLayoutView, regarding TSConfig, following happens: `mod.web_layout.localization.enableTranslate = 0` => newLanguageButton is shown only with the option to translate `mod.web_layout.localization.enableCopy = 0` => newLanguageButton is shown only with the option to copy If both are set to 0 - the button is not shown at all. Furthermore if the button is shown, these states are also considered independently: * hasStandAloneContent => no translate option * hasTranslations => no copy option -
Claus Due commented on patch set 2 03/08/20, 11:24
I'm not entirely sure I understand what's actually different now compared to before; *except* for the change in the Fluid template file which now renders the translate button if *either* allowTranslate *or* allowTranslateCopy is true - and I don't think this is the same behavior as the PageLayoutView?LanguageColumn.php:164This check is redundant after the early return above. $allowTranslate will always be true at this point. If !$translationData['hasStandaloneContent'] is set and true-ish we can early return (as it did in the method before the change).LanguageColumn.php:205This became redundant after the early return above. $allowCopy will alwas be true at this point.LanguageColumn.php:208Correct me if I'm wrong, but the "hasElementsToTranslate" is handled in the JS by reading the data-has-elements="{languageColumn.translationData.hasTranslations as integer}" property, meaning that it is redundant to check it here, which means the entire "hasElementsToTranslate" method can be removed again. -
Oli Bartsch commented on patch set 2 03/08/20, 11:25
> Patch Set 2: > > > Patch Set 1: > > > > (2 comments) > > > > To my understanding, "allowTranslate" must be true before "allowTranslateCopy" is even considered. The patch currently detaches the two booleans and I'm not sure this is the intended behavior. Can you point to the place in PageLayoutView where these booleans are considered independently? As far as I could determine when writing the initial patch, they are not considered independently. > > As far as I understand - and this is also what the forge issues is about - allowTranslate and allowTranslateCopy should be considered independently as this is already the case in the old PageLayoutView. I can not see any evidence allowTranslateCopy is not considered after allowTranslate is confirmed to be FALSE. > > Display of the button in the old one is depending on: > * permissions (`doEdit`, 'sys_laguage_uid', user edit permissions) > * $defaultLanguageUids (Which indicates if there are records to translate / copy) > > If you further test the old PageLayoutView, regarding TSConfig, following happens: > > `mod.web_layout.localization.enableTranslate = 0` => newLanguageButton is shown only with the option to translate > > `mod.web_layout.localization.enableCopy = 0` => newLanguageButton is shown only with the option to copy > > If both are set to 0 - the button is not shown at all. > > Furthermore if the button is shown, these states are also considered independently: > * hasStandAloneContent => no translate option > * hasTranslations => no copy option "If both are set to 0 - the button is not shown at all." This is wrong. The button is shown but with a info that we are dealing with mixed mode and no option is available. Will update the patch for this. -
Claus Due commented on patch set 2 03/08/20, 11:27
> `mod.web_layout.localization.enableTranslate = 0` => newLanguageButton is shown only with the option to translate > > `mod.web_layout.localization.enableCopy = 0` => newLanguageButton is shown only with the option to copy > > If both are set to 0 - the button is not shown at all. Thanks for the reference - please allow me to verify ;) perhaps we can reduce the methods "allowTranslate" and "allowTranslateCopy" to reading the TS toggles and checking "hasTranslations" and "hasStandaloneContent" respectively.
-
Claus Due commented on patch set 2 03/08/20, 11:34
> Patch Set 2: > > > `mod.web_layout.localization.enableTranslate = 0` => newLanguageButton is shown only with the option to translate > > > > `mod.web_layout.localization.enableCopy = 0` => newLanguageButton is shown only with the option to copy > > > > If both are set to 0 - the button is not shown at all. In the conditions above you inverted the logic: if enableTranslate = 0 the button shows only *copy* and if enableCopy = 0 it shows only *translate*. I understood the point though, just wanted to mention that for anyone reading. Good catch about "mixed mode warning" if both are false, I forgot to test that case when making the original patch. -
Oli Bartsch uploaded patch set 3 03/08/20, 12:08
-
Oli Bartsch commented on patch set 3 03/08/20, 12:12
> I'm not entirely sure I understand what's actually different now compared to before; *except* >for the change in the Fluid template file which now renders the translate button if *either* >allowTranslate *or* allowTranslateCopy is true - and I don't think this is the same behavior >as the PageLayoutView? As I found out, these both states have nothing to do with the rendering of the button (in the old implementation). The button is always rendered if at least one record to translate / copy is available. If both are set to `0` the message about mixed mode is shown. This is one thing this patch fixes. Also the `hasTranslations` check for "copy" did not work before as `$translationData` was never defined in this method. Regarding the message: If there are translated (connected mode) records and one creates a new record in L=0, the new Translate Button is shown. If TSConfig `enableTranslate = 0` is applied, the message says something about no translation possible due to mixed mode what is in fact wrong here. But this behaviour is the same in the old PageLayoutView and should be fixed in a separat patch. > Correct me if I'm wrong, but the "hasElementsToTranslate" is handled in the JS by reading the data-has-elements="{languageColumn.translationData.hasTranslations as integer}" property, meaning that it is redundant to check it here, which means the entire "hasElementsToTranslate" method can be removed again. No we need this as this is the only check which decides if the button is shown at all (besides the permission checks) See `if (!empty($defaultLanguageUids))` in the old implementation > Thanks for the reference - please allow me to verify ;) perhaps we can reduce the methods "allowTranslate" and "allowTranslateCopy" to reading the TS toggles and checking "hasTranslations" and "hasStandaloneContent" respectively. Yes I did this in the latest patchset.LanguageColumn.php:164ReplyDoneLanguageColumn.php:205ReplyDone -
Oli Bartsch commented on patch set 3 03/08/20, 12:13
LanguageColumn.php:208ReplyDone -
TYPO3com voted on patch set 3 V -1 03/08/20, 12:18 Completed build in 09m 41s on Sun, 8 Mar, 12:18 PM Test Summary: 71784 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1124
-
Claus Due commented on patch set 3 03/08/20, 12:26
Starting to make sense but can be further reduced ;)LanguageColumn.php:160Can be reduced to: `return !($translationData['hasStandaloneContent'] ?? false)`LanguageColumn.php:165This also changes public API and should be avoided. The same check can be implemented in the Fluid template.LanguageColumn.php:200Can be reduced to: `return !($translationData['hasTranslations'] ?? false)`LanguageColumns.html:38Change to condition="{languageColumn.siteLanguage.languageId}" and remove added public method in LanguageColumn class. -
Oli Bartsch commented on patch set 3 03/08/20, 12:34
LanguageColumn.php:160ReplyAckLanguageColumn.php:165Reply UnresolvedHow would you achieve that in Fluid only? Please also keep in mind that we need some more checks here (user has tt_content edit permissions, ...) from the other patch.LanguageColumn.php:200ReplyAck -
TYPO3com commented on patch set 3 03/08/20, 12:36 Completed build in 10m 24s on Sun, 8 Mar, 12:36 PM Test Summary: 61873 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1125
-
Oli Bartsch uploaded patch set 4 03/08/20, 12:59
-
Oli Bartsch commented on patch set 4 03/08/20, 13:02
LanguageColumns.html:38Reply UnresolvedAs I wrote in the other comment, this is not the only check which decides if the button should be shown. In the old PageLayoutView also the fact if there are records to be translated gets evaluated + the missing user permission checks from the other patch. -
TYPO3com voted on patch set 4 V +1 03/08/20, 13:10 Completed build in 11m 07s on Sun, 8 Mar, 01:10 PM Test Summary: 72093 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1126
-
Oli Bartsch updated the commit message in patch set 5 03/08/20, 14:34
-
TYPO3com voted on patch set 5 V -1 03/08/20, 14:44 Completed build in 10m 26s on Sun, 8 Mar, 02:44 PM Test Summary: 71792 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1130
-
Claus Due uploaded patch set 6 03/08/20, 15:20
-
TYPO3com voted on patch set 6 V +1 03/08/20, 15:30 Completed build in 10m 13s on Sun, 8 Mar, 03:30 PM Test Summary: 72099 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1131
-
Claus Due uploaded patch set 7 03/08/20, 15:31
-
TYPO3com voted on patch set 7 V -1 03/08/20, 15:42 Completed build in 10m 09s on Sun, 8 Mar, 03:42 PM Test Summary: 71492 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1132
-
TYPO3com commented on patch set 7 03/08/20, 15:54 Completed build in 10m 16s on Sun, 8 Mar, 03:54 PM Test Summary: 72092 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1133
-
Oli Bartsch uploaded patch set 8 03/08/20, 20:09
-
Oli Bartsch voted on patch set 8 V +1 CR +1 03/08/20, 20:11
-
TYPO3com voted on patch set 8 V +1 03/08/20, 20:23 Completed build in 13m 18s on Sun, 8 Mar, 08:23 PM Test Summary: 72099 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1141
-
Georg Ringer voted on patch set 8 V +1 CR +1 03/08/20, 20:50
-
Claus Due commented on patch set 8 03/08/20, 21:30
I would vote +1/+1 here but since I was the one to put the last touches on the patch I think it's best to leave this for another person. -
Daniel Goerz voted on patch set 8 V +2 CR +2 03/09/20, 07:54
-
Daniel Goerz merged patch set 9 03/09/20, 07:54