86077[BUGFIX] Unique default value configurations for NewContentElementWizard
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Thomas Hohn +1
- Anja Leichsenring +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Anja Leichsenring +1
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 2
Files 2
Review log 4048
Show 1823 earlier messages
-
Nikita Hovratov uploaded patch set 1 09/12/24, 22:34
-
core-ci voted on patch set 1 V +1 09/12/24, 22:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65612
-
Lina Wolf commented on patch set 1 09/13/24, 10:47
There are extensions like I think the bootstrap package that add some CEs twice via page TSconfig: Once to default to have it up front and once to a dedicated group like media. Will this still work? Should be tested. -
Nikita Hovratov commented on patch set 1 09/13/24, 10:54
Reply
Good point, no they will both be dropped. Maybe we need to reverse the logic then: if an exact configuration already exists for tsconfig, remove it from the TCA wizards. This is a little more complicated that's why I did the "lazy" approach. -
Nikita Hovratov uploaded patch set 2
V +109/13/24, 12:06 -
Nikita Hovratov commented on patch set 2 09/13/24, 12:09
Reply
Fixed with the new approach. Also added a test. -
core-ci voted on patch set 2 V +1 09/13/24, 12:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65672
-
Nikita Hovratov uploaded patch set 3
V +109/13/24, 13:34 -
core-ci voted on patch set 3 V +1 09/13/24, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65683
-
Lina Wolf commented on patch set 3 V -1 09/14/24, 04:09
Trying this out with extension t3docs/examples and additional page TSconfig: mod.wizards.newContentElement.wizardItems { common { elements { examples_haiku_list { iconIdentifier = tx_examples-haiku title = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:list.title description = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:list.description tt_content_defValues { CType = list list_type = examples_haiku_list } } examples_haiku_detail { iconIdentifier = tx_examples-haiku title = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:detail.title description = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:detail.description tt_content_defValues { CType = list list_type = examples_haiku_detail } } } show := addToList(examples_haiku_list,examples_haiku_detail) } plugins { elements { examples_haiku_list { iconIdentifier = tx_examples-haiku title = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:list.title description = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:list.description tt_content_defValues { CType = list list_type = examples_haiku_list } } examples_haiku_detail { iconIdentifier = tx_examples-haiku title = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:detail.title description = LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang_db.xlf:detail.description tt_content_defValues { CType = list list_type = examples_haiku_detail } } } show := addToList(examples_haiku_list,examples_haiku_detail) } } I get the error: PHP Warning: Undefined array key "elements." in /var/www/html/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php line 336 -
Nikita Hovratov uploaded patch set 4
V +109/15/24, 10:06 -
Nikita Hovratov commented on patch set 4 09/15/24, 10:07
Reply
fixed -
core-ci voted on patch set 4 V +1 09/15/24, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65805
-
Lina Wolf commented on patch set 4 CR +1 V +1 09/15/24, 13:04
Works for me, code looks good -
Nikita Hovratov commented on patch set 4 09/27/24, 10:21
bump -
Guido Schmechel voted on patch set 4 CR +1 10/02/24, 23:00
-
Nikita Hovratov commented on patch set 4 10/08/24, 12:59
bump -
Nikita Hovratov uploaded patch set 5
CR +1V +110/08/24, 13:06 -
core-ci voted on patch set 5 V +1 10/08/24, 13:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67376
-
Thomas Hohn voted on patch set 5 CR +1 10/10/24, 09:28
-
Lina Wolf voted on patch set 5 CR +1 V +1 10/10/24, 09:30
-
Guido Schmechel voted on patch set 5 CR +1 10/10/24, 10:07
-
Georg Ringer voted on patch set 5 CR +1 V +1 10/10/24, 11:21
-
Andreas Kienast commented on patch set 5 10/10/24, 12:36
NewContentElementController.php:346May I ask why? -
Nikita Hovratov commented on patch set 5 10/10/24, 13:59
NewContentElementController.php:346ReplyThe tests reveal it. So that order of items is not checked. -
Nikita Hovratov commented on patch set 5 10/10/24, 14:09
NewContentElementController.php:346Reply``` ['a' => '1', 'b' => '2'] == ['b' => '2', 'a' => '1'] // true ['a' => '1', 'b' => '2'] === ['b' => '2', 'a' => '1'] // false ``` -
Andreas Kienast commented on patch set 5 10/10/24, 15:06
NewContentElementController.php:346ReplyAcknowledged -
Benjamin Franzke commented on patch set 5 CR -1 10/10/24, 15:20
NewContentElementController.php:346Replymaybe we should document that then? Or better use `ksort`? Following examples are also true – but would we want that? ``` ['a' => '1', 'b' => '2'] == ['b' => '2', 'a' => true] // true ``` Or this: ``` ['a' => '0', 'b' => '2'] == ['b' => '2', 'a' => '00'] // true ``` -
Nikita Hovratov uploaded patch set 6
CR +1V +110/10/24, 15:59 -
Nikita Hovratov commented on patch set 6 10/10/24, 15:59
NewContentElementController.php:346ReplyAdded ksort, thanks. -
core-ci voted on patch set 6 V +1 10/10/24, 16:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67517
-
Georg Ringer voted on patch set 6 CR +1 10/16/24, 06:35
-
Benjamin Franzke uploaded patch set 7
CR +1V +110/19/24, 09:10 -
Benjamin Franzke commented on patch set 7 10/19/24, 09:10
NewContentElementController.php:341Possible Undefined array key "tt_content_defValues." here (if that config is omitted, which is actually possible…) -
core-ci voted on patch set 7 V +1 10/19/24, 09:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68221
-
Nikita Hovratov uploaded patch set 8
CR +1V +111/05/24, 18:17 -
core-ci voted on patch set 8 V +1 11/05/24, 18:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69117
-
Benjamin Franzke voted on patch set 8 CR +1 V +1 11/07/24, 13:11
-
Thomas Hohn voted on patch set 8 CR +1 11/07/24, 13:18
-
Simon Schaufelberger voted on patch set 8 CR +1 V +1 11/07/24, 13:39
-
Ayke Halder commented on patch set 8 11/07/24, 13:40
NewContentElementController.php:330Could this possibly be directly solved in the function `NewContentElementController::prepareWizwardItem()`? There is already code like this implemented: ```php 'defaultValues' => array_replace_recursive( $itemConf['tt_content_defValues'] ?? [], $itemConf['tt_content_defValues.'] ?? [], $itemConf['defaultValues'] ?? [] ), ``` -
Nikita Hovratov commented on patch set 8 11/07/24, 14:57
NewContentElementController.php:330ReplyThis prepare method ensures that TsConfig and TCA config of same wizards in the same group are merged. This bugfix however ensures that duplicate wizard items in different groups are removed. So, no. -
Nikita Hovratov commented on patch set 8 11/07/24, 15:01
NewContentElementController.php:330ReplyAt further inspection, we could do the opposite: Move the prepare functionality of merging these configs into the new merge method. But I would do this in another dedicated patch. This one is explicitly to address the bug. -
Ayke Halder commented on patch set 8 11/07/24, 15:30
NewContentElementController.php:330ReplyAcknowledged. Maybe in another dedicated patch the whole wizard-config-preparation needs some refactoring. ---- About this patch here: Maybe use a reference - please decide what looks better readable for you. ``` foreach ($contentElementWizards as &$wizard) { foreach ($wizard['elements.'] ?? [] as $key => $elementConfig) { … unset($wizard['elements.'][$key]); … } } ``` -
Nikita Hovratov commented on patch set 8 11/07/24, 16:06
NewContentElementController.php:330ReplyIn general I think we should avoid using references if possible as this causes side effects (variable needs to be unset). Imo it's still readable with one array part more. -
Anja Leichsenring voted on patch set 8 CR +1 V +1 11/08/24, 09:29
-
Benjamin Franzke voted on patch set 8 CR +2 V +2 11/08/24, 13:38
-
Benjamin Franzke merged patch set 9 11/08/24, 13:48