[BUGFIX] Do not use invalid TSConfig in linkvalidator 13/33213/2
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Thu, 19 Dec 2013 21:37:53 +0000 (22:37 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 8 Oct 2014 21:41:24 +0000 (23:41 +0200)
To display the linkvalidator error messages for linkhandler link types,
the name of the linked table is read from the TCA instead from page
TSconfig (from a hardcoded page UID 1).

Resolves: #54523
Releases: master, 6.2
Change-Id: I165813a03cd4574c20981e35a9e53cfdeacfc421
Reviewed-on: http://review.typo3.org/33213
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/linkvalidator/Classes/Linktype/LinkHandler.php

index ea52c52..7f6401b 100644 (file)
@@ -28,20 +28,6 @@ class LinkHandler extends \TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype {
        const DELETED = 'deleted';
 
        /**
-        * TSconfig of the module tx_linkhandler
-        *
-        * @var array
-        */
-       protected $tsconfig;
-
-       /**
-        * Get TSconfig when loading the class
-        */
-       public function __construct() {
-               $this->tsconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getModTSconfig(1, 'mod.tx_linkhandler');
-       }
-
-       /**
         * Checks a given URL for validity
         *
         * @param string $url Url to check
@@ -101,9 +87,10 @@ class LinkHandler extends \TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype {
        public function getErrorMessage($errorParams) {
                $errorType = $errorParams['errorType'];
                $tableName = $errorParams['tablename'];
-               $title = $GLOBALS['LANG']->getLL('list.report.rowdeleted.default.title');
-               if ($this->tsconfig['properties'][$tableName . '.']) {
-                       $title = $this->tsconfig['properties'][$tableName . '.']['label'];
+               if (!empty($GLOBALS['TCA'][$tableName]['ctrl']['title'])) {
+                       $title = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$tableName]['ctrl']['title'], TRUE);
+               } else {
+                       $title = $tableName;
                }
                switch ($errorType) {
                        case self::DELETED: