Bug #102256
closedSuggest wizard does not work for new elements
100%
Description
When an element (e.g. a content element) is new (i.e. not yet saved, does not have a uid), the suggest wizard fails with the following JavaScript error:
Uncaught (in promise) TypeError: can't convert null to object flattenObject https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/ajax/input-transformer.js?bust=1698147028:13 flattenObject https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/ajax/input-transformer.js?bust=1698147028:13 flattenObject https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/ajax/input-transformer.js?bust=1698147028:13 toFormData https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/ajax/input-transformer.js?bust=1698147028:13 byHeader https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/ajax/input-transformer.js?bust=1698147028:13 post https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/ajax/ajax-request.js?bust=1698147028:31 registerEvents https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine-suggest.js?bust=1698147028:52 n https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/event/debounce-event.js?bust=1698147028:13 setTimeout handler*debounce/< https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/event/debounce-event.js?bust=1698147028:13 bindTo https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/event/regular-event.js?bust=1698147028:13 registerEvents https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine-suggest.js?bust=1698147028:68 FormEngineSuggest https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine-suggest.js?bust=1698147028:32 promise callback*FormEngineSuggest https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine-suggest.js?bust=1698147028:32 registerSuggest https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine/element/group-element.js?bust=1698147028:13 GroupElement https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine/element/group-element.js?bust=1698147028:13 promise callback*GroupElement https://t3starterpackage.ddev.site/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/form-engine/element/group-element.js?bust=1698147028:13 t https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 executeJavaScriptModuleInstruction https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 executeJavaScriptModuleInstruction https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 promise callback*executeJavaScriptModuleInstruction https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 javaScriptModuleInstruction https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 invoke https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 processItems https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 processItems https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-processor.js?bust=1698147028:13 <anonymous> https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-handler.js?1698141040:13 promise callback* https://t3starterpackage.ddev.site/_assets/1ee1d3e909b58d32e30dcea666dd3224/JavaScript/java-script-item-handler.js?1698141040:13 input-transformer.js:13:641
This is related to change https://review.typo3.org/c/Packages/TYPO3.CMS/+/80759 which changed the way the uid
parameter is handled. If it is not a number, null
is sent. This makes the flattenObject
of the InputTransformer
JS class crash, because it does not expect null
. Sending 0
instead solves the issue, but I'm not sure whether this is correct or not.
Updated by Francois Suter about 1 year ago
- Related to Bug #101796: SuggestWizardController doesn't respect TCA overrides on new Content elements added
Updated by Francois Suter about 1 year ago
- create a new content element of type "Subpages"
- try getting some page suggestions with the suggest wizard
- observe that the wizard does not make any suggestion and that the above-mentioned error can be seen in the console
Replacing null
by 0
solves the problem.
Updated by Gerrit Code Review about 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81550
Updated by Gerrit Code Review about 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81550
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81556
Updated by Andreas Fernandez about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 09faf08d0db6171717159e7089fbcbf5ae90f56b.