#104299Misleading message if new CType (plugin) has no label
Description
If I add new Plugin Type (set as PLUGIN_TYPE_CONTENT_ELEMENT) and let the label empty or the locallang marker is wrong, an warning message is shown in backend preview in the page module after creating an new content element and close it.
INVALID VALUE ("my_plugin")
I assumed, that something is wrong with registration/configuration of my new content type and I thought the type is not allowed. But only the missing label was the problem.
On debugging I found those check in the StandardContentPreviewRenderer.php
In cms-backend/Classes/Preview/StandardContentPreviewRenderer.php the label for elements is checked for CType and list_type. If label is not empty it will be shown but if not then a warning message is shown. They will be rendered from locallang marker core/Resources/Private/Language/locallang_core.xlf:labels.noMatchingValue
I fixed my wrong locallang key and now everything looks good in the preview.
The message if the label is empty should be changed to find the right error more easily.
Reviews 2
Files 4
History 58
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2024-07-03T08:42:54+00:00" > 07/03/24, 08:42 </span> -
Karsten Nowak (undkonsorten) commented <span data-processor="relativetime" data-value="2024-07-03T09:02:32+00:00" > 07/03/24, 09:02 </span>
Yes, just a message like this would help.
If I’m right that missleading message is still there in v13.
-
Garvin Hicking commented and changed attached list-after.png attached page-after.png attached page-before.png attached list-before.png <span data-processor="relativetime" data-value="2024-07-03T18:04:27+00:00" > 07/03/24, 18:04 </span>
To reproduce this on v13 main:
- Edit
sysext/styleguide/ext_localconf.php, add this at the end:
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'styleguide', 'styleguideDummyPreview', [TYPO3\CMS\IndexedSearch\Controller\SearchController\SearchController::class => ['form', 'search', 'noTypoScript']], [TYPO3\CMS\IndexedSearch\Controller\SearchController\SearchController::class => ['form', 'search']], TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT );- Edit
sysext/styleguide/ext_tables.php, add this at the end:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( 'styleguide', 'styleguideDummyPreview', '' );- Go the the backend `Web > Page`, create a “General Plugin” content element, pick the “styleguideDummyPreview” from the list (actually shown as
INVALID VALUE "styleguide_styleguideDummyPreview), save. - Go back to `Web > Page` and see the overview.
Before the patch, you will see this:
list view BEFORE
list-before.pngpage view BEFORE
page-before.pngAfter the patch you should see this improved distinction:
list view AFTER
list-after.pngpage view AFTER
page-after.png - Edit
-
Gerrit Code Review pushed patch set 1 for main to change 85098 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2024-07-03T18:06:37+00:00" > 07/03/24, 18:06 </span> -
Gerrit Code Review pushed patch set 2 for main to change 85098 <span data-processor="relativetime" data-value="2024-07-03T18:29:49+00:00" > 07/03/24, 18:29 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 85241 <span data-processor="relativetime" data-value="2024-07-12T10:01:10+00:00" > 07/12/24, 10:01 </span>
-
Garvin Hicking commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-07-12T13:50:09+00:00" > 07/12/24, 13:50 </span>Applied in changeset commit:f9ca4ff586ad28c20725affe35ff33d84e1bbe73.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2024-10-15T09:29:52+00:00" > 10/15/24, 09:29 </span>
Do I understand this properly, in this case it would help you to receive:
MISSING LABEL (“mx_plugin”)
instead, is that right?