[BUGFIX] linkvalidator: Add headline fallback to prevent NULL on insert 39/35539/3
authorBenjamin Serfhos <serfhos@gmail.com>
Wed, 17 Dec 2014 11:45:56 +0000 (12:45 +0100)
committerBenjamin Mack <benni@typo3.org>
Wed, 31 Dec 2014 11:24:47 +0000 (12:24 +0100)
While link checker adds the broken links in the database the content
element can have an empty header. Make sure the inserted record does
not fail of empty headline.

Change-Id: I9cd750a278fd514f6154659c9c8466c2713adfe7
Resolves: #63952
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/35539
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/linkvalidator/Classes/LinkAnalyzer.php

index 2369964..2e5d2d5 100644 (file)
@@ -172,7 +172,7 @@ class LinkAnalyzer {
                                        foreach ($results[$key] as $entryKey => $entryValue) {
                                                $table = $entryValue['table'];
                                                $record = array();
-                                               $record['headline'] = $entryValue['row'][$GLOBALS['TCA'][$table]['ctrl']['label']];
+                                               $record['headline'] = BackendUtility::getRecordTitle($table, $entryValue['row']);
                                                $record['record_pid'] = $entryValue['row']['pid'];
                                                $record['record_uid'] = $entryValue['uid'];
                                                $record['table_name'] = $table;