73172[FEATURE] Add option to limit the suggest wizard to the current language
Commit message
Review
-
Code review CR -2
- Stefan Bürk -2
- Stefan Froemken +1
-
Verified V 0
- core-ci +1 CI
Issues 1
Files 4
- typo3/sysext/backend/Classes/Controller/Wizard/SuggestWizardController.php26+20 −5
- typo3/sysext/backend/Tests/Unit/Controller/Wizard/SuggestWizardControllerTest.php3+79 −0
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-96626-AddParentRowMarkersToSuggestOptionsAddWhere.rstnew+67 −0
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_group.php4+17 −1
Review log 5785
Show 3960 earlier messages
-
Lina Wolf uploaded patch set 1 01/25/22, 14:42
-
core-ci voted on patch set 1 V -1 01/25/22, 14:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22523
-
Lina Wolf uploaded patch set 2 01/25/22, 14:50
-
core-ci voted on patch set 2 V -1 01/25/22, 14:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22524
-
Lina Wolf uploaded patch set 3 01/25/22, 14:53
-
core-ci voted on patch set 3 V -1 01/25/22, 14:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22525
-
Lina Wolf uploaded patch set 4 01/25/22, 14:58
-
core-ci voted on patch set 4 V -1 01/25/22, 15:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22526
-
Benni Mack commented on patch set 4 01/25/22, 15:22
-
Lina Wolf commented on patch set 4 01/27/22, 13:26
SuggestWizardController.php:139ReplyThat would be great, however the group field doesn't use a dataprovider (yet?) and anyhow we are in the Ajax request of the suggest wizard here. At least I was not able to get the current site data as the Site attached to the Request is a NullSite. -
Lina Wolf uploaded patch set 5 11/03/22, 18:30
-
core-ci voted on patch set 5 V -1 11/03/22, 18:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33069
-
Lina Wolf rebased onto patch set 6 11/03/22, 19:01
-
core-ci voted on patch set 6 V -1 11/03/22, 19:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33074
-
Stefan Bürk uploaded patch set 7 11/03/22, 19:35
-
core-ci voted on patch set 7 V +1 11/03/22, 19:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33076
-
Stefan Bürk rebased onto patch set 8 11/03/22, 22:56
-
core-ci voted on patch set 8 V +1 11/03/22, 23:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33087
-
Georg Ringer commented on patch set 8 CR -1 11/04/22, 09:09
not all records are tSuggestWizardController.php:138not all records are translateable and not all records might check and use the field ctrl|languageField for the label -
Benni Mack wrote 11/30/22, 09:18
Removed cc Benni Mack. -
Benni Mack commented on patch set 9
CR -1V +112/06/22, 10:51Published edit on patch set 8. -
core-ci voted on patch set 9 V +1 12/06/22, 11:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34712
-
Simon Schaufelberger commented on patch set 9 12/08/22, 08:15
Feature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:17For example...Feature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:26please use consistent short array notation.Feature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:45this sentence is really hard to understand. -
Simon Schaufelberger commented on patch set 9 08/24/23, 15:05
Does somebody want to update this patch? -
Lina Wolf uploaded patch set 10
V +106/22/24, 11:05 -
Lina Wolf commented on patch set 10 06/22/24, 11:06
SuggestWizardController.php:138ReplyDoneSuggestWizardController.php:139ReplyDoneFeature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:17ReplyDoneFeature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:26ReplyDoneFeature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:45ReplyDone -
core-ci voted on patch set 10 V -1 06/22/24, 11:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60071
-
Markus Klein commented on patch set 11
V -106/22/24, 11:11Published edit on patch set 10. -
Markus Klein commented on patch set 12 06/22/24, 11:12
Published edit on patch set 11. -
core-ci voted on patch set 11 V -1 06/22/24, 11:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60072
-
core-ci voted on patch set 12 V +1 06/22/24, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60074
-
Lina Wolf marked it work in progress 06/22/24, 15:03
-
Lina Wolf uploaded patch set 13
V +106/23/24, 05:43 -
Lina Wolf marked it ready for review 06/23/24, 05:46
-
Lina Wolf marked it work in progress 06/23/24, 05:46
-
Lina Wolf uploaded patch set 14 06/23/24, 05:47
-
Lina Wolf marked it ready for review 06/23/24, 05:47
-
core-ci voted on patch set 13 V -1 06/23/24, 05:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60088
-
Lina Wolf uploaded patch set 15 06/23/24, 05:51
-
core-ci voted on patch set 14 V -1 06/23/24, 05:56 Copied votes on follow-up patch sets have been updated: * Verified-1 has been copied to patch set 15 (copy condition: "changekind:NO_CHANGE"). Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60089
-
core-ci voted on patch set 15 V -1 06/23/24, 05:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60090
-
Lina Wolf uploaded patch set 16
V -106/23/24, 05:59 -
core-ci voted on patch set 16 V +1 06/23/24, 06:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60091
-
Stefan Froemken updated the commit message in patch set 17
V +106/23/24, 09:19 -
core-ci voted on patch set 17 V +1 06/23/24, 09:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60093
-
Stefan Froemken commented on patch set 17 CR -1 06/23/24, 09:35
SuggestWizardController.php:129The DefaultRestrictionContainer also hides hidden records and records limited to start- and endtime. I would prefer to remove these limitations for this operationSuggestWizardController.php:130I don't understand $parentRow. The given $uid is the UID of the current record. Somewhere below you see that '###THIS_UID###' will be replaced by $uid. So why "parent"? Maybe currentRow or currentRecord would match better.SuggestWizardController.php:134$uid comes from parsedBody of request. Please case $uid to int here. IMO PARAM_INT will only handle the quoting for the query.SuggestWizardController.php:159no spaceSuggestWizardController.php:161no space -
Garvin Hicking commented on patch set 17 06/23/24, 11:08
I think this is a very useful functionality, let's iron out the last things! 👏SuggestWizardController.php:129ReplyI agree on start/endtime, but why would you search and link to hidden elements? I'd say these would be intentionally not be "suggestable". definitely don't fetch deleted records here.SuggestWizardController.php:130ReplyI believe it's "parent" because all suggestsable records would be related to this element, to me this would work. Other ideas: sourceRow, originRow, relationRow. But "parent" is more commonly used in core?SuggestWizardController.php:159I think several other columns might make sense, too: backend_layout, colPos, starttime, endtime, fe_group, categories, l18n_parent, sectionIndex, pi_flexform These could allow some more flexibility, and maybe then it would be easier to expose all columns in a loop?tx_styleguide_elements_group.php:192Maybe add something like "suggestOption language related" to differentiate? -
Lina Wolf commented on patch set 17 06/23/24, 11:54
SuggestWizardController.php:130ReplyYes, parent, because we are in the suggest wizard here, where the childrecords of the current record are suggested -
Lina Wolf uploaded patch set 18
CR -1V +106/23/24, 11:55 -
Lina Wolf commented on patch set 17 06/23/24, 11:55
SuggestWizardController.php:134ReplyDoneSuggestWizardController.php:159ReplyDoneSuggestWizardController.php:161ReplyDone -
core-ci voted on patch set 18 V +1 06/23/24, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60102
-
Lina Wolf commented on patch set 18 06/23/24, 12:00
SuggestWizardController.php:129ReplyActually this queryBuilder is used for the currently edited row, not the ones that are to be attached to it. You can edit a hidden record and only unhide it lateron so I would limit this to non-deleted records only. Good catch. -
Lina Wolf uploaded patch set 19
V +106/23/24, 12:01 -
core-ci voted on patch set 19 V +1 06/23/24, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60104
-
Lina Wolf uploaded patch set 20
V +106/23/24, 12:31 -
Lina Wolf commented on patch set 20 06/23/24, 12:32
tx_styleguide_elements_group.php:192ReplyDone -
core-ci voted on patch set 20 V +1 06/23/24, 12:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60106
-
Lina Wolf uploaded patch set 21
V +106/23/24, 12:41 -
core-ci voted on patch set 21 V +1 06/23/24, 12:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60107
-
Stefan Froemken commented on patch set 21 CR -1 06/23/24, 13:41
SuggestWizardController.php:159ReplyDoneSuggestWizardController.php:163This line can be removed now. Further it contains the direct column name instead of the TCA "languageField"SuggestWizardController.php:164For performance reasons I would prefer to test for ###REC_FIELD first, before loop. In TYPO3 it is done with str_contains here: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php#L705
-
Stefan Froemken commented on patch set 21 06/23/24, 13:52
Feature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:15containingFeature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:18"can be used"Feature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:41Not tested, but it column quoting respected here? "{#sys_language_uid}". See: https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/Type/Select/Properties/ForeignTableWhere.html#field-quotingtx_styleguide_elements_group.php:202column quoting with {#column} -
Garvin Hicking uploaded patch set 22
CR -1V +107/19/24, 06:06Suggestions from code review plus rewording -
Garvin Hicking uploaded patch set 23 07/19/24, 06:13
Add missing quoting -
Garvin Hicking commented on patch set 23 CR +1 V +1 07/19/24, 06:14
Adapted the wordings a bit and addressed Stefans remarks, also tested/verified this works on my instance.SuggestWizardController.php:163ReplyDoneSuggestWizardController.php:164ReplyYes, that's a very good idea to save some unneeded iteration!Feature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:15ReplyDoneFeature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:18ReplyDoneFeature-96626 -AddSysLanguageUidMarkerToSuggestOptionsAddWhere.rst:41ReplyGood catch. I think it's okay to omit the table name here for better readability.tx_styleguide_elements_group.php:202ReplyDone -
core-ci voted on patch set 22 V +1 07/19/24, 06:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61782
-
core-ci voted on patch set 23 V -1 07/19/24, 06:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61783
-
core-ci commented on patch set 23 07/19/24, 09:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61783
-
core-ci voted on patch set 23 V +1 07/19/24, 09:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61783
-
Fabien Udriot voted on patch set 23 CR +1 07/19/24, 11:39
-
Georg Ringer commented on patch set 23 08/01/24, 21:27
SuggestWizardController.php:129I suggest just using BackendUtility::getRecord() would be perfectly fine, what do you think? -
Garvin Hicking uploaded patch set 24
CR +1V +108/06/24, 23:10Add tests adjust wording use getRecord -
Garvin Hicking uploaded patch set 25 08/06/24, 23:10
Adjust CGL -
core-ci voted on patch set 25 V +1 08/06/24, 23:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62978
-
core-ci voted on patch set 24 V -1 08/06/24, 23:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62977
-
Garvin Hicking commented on patch set 25 CR +1 V +1 08/06/24, 23:22
Adapted wordings again, added some basic testing (had to refactor the method to make it testable at least superficially), and now use BU:getRecord instead of custom query. Still works. ;)SuggestWizardController.php:129ReplyDone -
Stefan Froemken commented on patch set 25 08/07/24, 19:00
SuggestWizardControllerTest.php:269BackendUtility::getRecord can return null. Can we use this test to test against $parentRow with NULL? -
Garvin Hicking uploaded patch set 26
CR +1V +108/07/24, 19:23Enhance test rename ReST file -
Stefan Froemken voted on patch set 26 CR +1 08/07/24, 19:28
-
core-ci voted on patch set 26 V +1 08/07/24, 19:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63015
-
Garvin Hicking voted on patch set 26 CR +1 V +1 08/07/24, 19:31
-
Garvin Hicking commented on patch set 26 08/07/24, 19:31
SuggestWizardControllerTest.php:269ReplyDone -
Stefan Bürk voted on patch set 26 CR -1 08/18/24, 08:38
-
Stefan Bürk commented on patch set 26 CR -2 08/19/24, 07:29
Unresolved
Commit message not reflecting what the current change / approach really does.SuggestWizardController.php:328UnresolvedI get the intention to add `sys_language_uid`, albeit already asking the "use-fullness" of that. However, the choosen approach here to add all record field values as "placeholder" replacement is not a good idea and thus the -2: This approach does not take field types into account, for example VARCHAR, TEXTFIELDS or blob fields. They need to be properly quoted in a query, which is not done here. On top of that, that is not so simple - see https://review.typo3.org/c/Packages/TYPO3.CMS/+/73172/26/typo3/sysext/backend/Classes/Controller/Wizard/SuggestWizardController.php#158 comment for the hack. A simple quoting is also not correct here and would quote integer values (or booleans) which may lead to comparision issues, for example on Postgres when the field type does not match with the replaced one. In the current form, this may also open a security hole (multi step attack) without proper quoting on varchar/text columns. Implementing a general solution here will become hard to do it right - beside that, people may ask for these placeholder in other parts too. Current commit message does not reflect the current choosen approach anyway. I'd suggest to narrow this change down to the original intention: * only handle sys_language_uid field (read fieldname from TCA, using a generic placeholdername despite the "configurable" row name) * ensur integer values * align commit message towards the change and what it currently does If parent row is not localizable no replacement would be done (maybe describe that in the rest file). TBH I'm not quite sure if the `sys_language_uid` placeholer really make sense as a generic option. I'd say peoply really quickly wants to respect language fallbacks than - or what do you say ?SuggestWizardControllerTest.php:262Unresolvedlet us use prefixees for test datasets aka named argument usages (phpunit. Meaning that the values for the text method should be added here ``` return [ 'some string' => [ 'expected' => [], 'array' => [], ], ]; ``` beside that `$array` may not be a good name here. -
Garvin Hicking commented on patch set 26 CR 0 V 0 08/19/24, 13:22
I understand the concerns, thanks for bringing them up. I think to have REC_FIELD_sys_language_uid available (probably as ORIGIN_LANGUAGE_UID?) is the main concern; maybe some othe INT fields, too. I'll try to find some time to make the scope of this patch smaller with only these fields. Maybe in v14 we can then address a way to add VARCHAR fields too, if people ask for it. -
Lina Wolf abandoned the change 11/05/25, 13:29
I think a different attempt needs to be made if we want to solve this
SuggestWizardController.php:139