Bug #95166
closedLinkvalidator breaks if no pageUid
100%
Description
The linkvalidator breaks if no pageUid is given. If in inline records (IRRE), these records could not be opened anymore.
Error:
Uncaught TYPO3 Exception: htmlspecialchars() expects parameter 1 to be string, null given | TypeError thrown in file [...]typo3_src-10.4.14/typo3/sysext/linkvalidator/Classes/EventListener/CheckBrokenRteLinkEventListener.php in line 67.
Possible solution:
// Page does not exist if (!is_array($pageRecord)) { if ($hrefInformation['pageuid']) $event->markAsBrokenLink('Page with ID ' . htmlspecialchars($hrefInformation['pageuid']) . ' not found'); else $event->markAsBrokenLink('Page not found - missing ID'); }
Updated by Georg Ringer about 3 years ago
can you add some information how this can be reproduced?
Updated by Michael Sollmann about 3 years ago
I don't know. Editors who worked in source code mode of the RTE? Anyway, there was a crippled typolink in a RTE field, and if this is possible we have to catch the error :-)
Updated by Franz Kugelmann about 3 years ago
Just stumbled upon this issue. To reproduce, add the following link directly into a tt_content::bodytext field.
NOT via "source code view" in RTE, that will already add the missing uid-parameter.
<a title="ICMU" href="t3://page?alias=-">(ICMU)</a>
I have no idea how that link was created by the editors, but found 60 more such links with parameter alias instead of uid in the Database.
Updated by Sybille Peters almost 3 years ago
@Frank I can reproduce this with your description.
Not sure how linkvalidator should behave. Is a link href="t3://page?alias=-" a valid link target? Does it implicitly mean link to current page?
Because this link is rendered as working link to current page, I would assume so.
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71418
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71418
Updated by Sybille Peters almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a64d78c5df3832d0e7eb2307061da776bb66e19a.
Updated by Gerrit Code Review almost 3 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 10.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/+/71672
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch 10.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/+/71672
Updated by Sybille Peters almost 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset e3cbd98ca51f107f02202572b84199212a6de8da.
Updated by Benni Mack almost 2 years ago
- Status changed from Resolved to Closed