Bug #94381
closedEditors dont see broken links because of invalid use of coalesce operator in LinkAnalyzer
100%
Description
Hi,
We have noticed that editors don't see broken links in the backend because the display of these links through theTYPO3\CMS\Linkvalidator\QueryRestrictions\EditableRestriction
is excluded.
In our case the link entries in the database in the column `element_type`
the table `tx_linkvalidator_link`
has no value.
This field is actually filled in the method checklinks of the class TYPO3\CMS\Linkvalidator\LinkAnalyzer
.
However, the following condition is defined:if ($entryValue['row'][$typeField] ?? false) {
$record['element_type'] = $entryValue['row'][$typeField];
}
The problem is now, if the type value is 0, this value is never written in the field. This condition would have to be corrected or removed.
Updated by Emanuel Wyss over 3 years ago
I am working on a page with the news extension. There the bug affects the links in news posts, because the news type is 0 by default. So non admin backend users don't see the broken links in the module.
Updated by Sybille Peters over 3 years ago
So you are saying, the broken links will not be displayed for non-admin users if tx_linkvalidator_links.element_type is empty?
I can reproduce this, e.g. by checking broken links in news records and then viewing the broken links as admin and non-admin user.
However, it is correct that element_type is empty so I don't think the problem is in the LinkAnalyzer class. The problem is that the EditableRestriction should not check if element_type is one of the allowed types if the element_type is empty. So, I think the EditableRestriction should be fixed instead.
Setting element_type should get fixed as well as making sure the type is used with authMode.
Updated by Sybille Peters over 3 years ago
- Status changed from New to In Progress
Updated by Gerrit Code Review over 3 years ago
- Status changed from In Progress 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/+/71419
Updated by Gerrit Code Review over 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/+/71419
Updated by Gerrit Code Review over 3 years ago
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/+/71924
Updated by Sybille Peters over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 0c292e8f9c5b1ba95721d18f13f73afcf71db78d.