Project

General

Profile

Actions

Bug #104299

closed

Misleading message if new CType (plugin) has no label

Added by Karsten Nowak (undkonsorten) 5 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2024-07-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Files

page-after.png (97.1 KB) page-after.png Garvin Hicking, 2024-07-03 18:01
list-after.png (121 KB) list-after.png Garvin Hicking, 2024-07-03 18:01
page-before.png (99.2 KB) page-before.png Garvin Hicking, 2024-07-03 18:01
list-before.png (123 KB) list-before.png Garvin Hicking, 2024-07-03 18:01
Actions #1

Updated by Garvin Hicking 5 months ago

  • Status changed from New to Needs Feedback

Do I understand this properly, in this case it would help you to receive:

MISSING LABEL ("mx_plugin")

instead, is that right?

Actions #2

Updated by Karsten Nowak (undkonsorten) 5 months ago ยท Edited

Yes, just a message like this would help.

If I'm right that missleading message is still there in v13.

Updated by Garvin Hicking 5 months ago

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
page view BEFORE

After the patch you should see this improved distinction:

list view AFTER
page view AFTER
Actions #4

Updated by Gerrit Code Review 5 months ago

  • Status changed from Needs Feedback 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/+/85098

Actions #5

Updated by Gerrit Code Review 5 months 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/+/85098

Actions #6

Updated by Gerrit Code Review 5 months 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/+/85241

Actions #7

Updated by Garvin Hicking 4 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF