[BUGFIX] Show warning label for linkhandler if no label is defined 58/51558/2
authorMarkus Klein <markus.klein@typo3.org>
Fri, 3 Feb 2017 21:25:33 +0000 (22:25 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 6 Feb 2017 20:05:11 +0000 (21:05 +0100)
If the configuration for a linkhandler has an empty label
put a warning label there instead to give the integrator a hint
that the configuration is evaluated correctly.

Resolves: #79621
Releases: master, 7.6
Change-Id: Ib00a86be339908408c4e31eedb3c8ea57468fa87
Reviewed-on: https://review.typo3.org/51558
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
typo3/sysext/recordlist/Resources/Private/Language/locallang.xlf [new file with mode: 0644]

index a5c9327..51f54a2 100644 (file)
@@ -248,6 +248,8 @@ abstract class AbstractLinkBrowserController
                 isset($configuration['configuration.']) ? $configuration['configuration.'] : []
             );
 
+            $label = !empty($configuration['label']) ? $lang->sL($configuration['label']) : '';
+            $label = $label ?: $lang->sL('LLL:EXT:recordlist/Resources/Private/Language/locallang.xlf:error.linkHandlerTitleMissing');
             $this->linkHandlers[$identifier] = [
                 'handlerInstance' => $handler,
                 'label' => $lang->sL($configuration['label'], true),
diff --git a/typo3/sysext/recordlist/Resources/Private/Language/locallang.xlf b/typo3/sysext/recordlist/Resources/Private/Language/locallang.xlf
new file mode 100644 (file)
index 0000000..8465e7a
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
+       <file t3:id="1486156389" source-language="en" datatype="plaintext" original="messages" date="2017-02-03T21:13:02Z" product-name="recordlist">
+               <header/>
+               <body>
+                       <trans-unit id="error.linkHandlerTitleMissing">
+                               <source>[title missing]</source>
+                       </trans-unit>
+               </body>
+       </file>
+</xliff>