Bug #34566
closedCustom validators may be overriden by default ones depending on load order
100%
Description
I'm using linkvalidator in a site which also uses the DAM. During the first tests it appeared that all links to the DAM were reported as broken page links.
This was due to the DAM extension being loaded before the linkvalidator. As such the custom link validator provided by the DAM came first when looping on the hook objects to determine the type. The DAM custom validator correctly detects the link of type "dam", but this is then overridden to "db" by the internal link validator.
What happens in detail: when a link to a DAM element comes for validation, it is first considered to be of type "db". In the internal linkvalidator, the type of the element being analyzed is matched against the key of the current validator, which is also "db" in this case. When the DAM extension comes after linkvalidator, this is fine, because DAM stuff is properly detected and link type is set to "dam". However when the DAM extension comes before linkvalidator, its correct detection is lost because the internal type comes afterwards and matches the "db" type.
My proposed solution is temporarily store the type in the current "record" information, so that the "db" type cannot be matched anymore when a more specific type was matched beforehand. With this change, the extension load order is not relevant anymore.
I'm attaching my patch here. I would quite like to have some feedback before pushing it to Gerrit.
Files
Updated by Francois Suter over 12 years ago
- File issue34566.diff issue34566.diff added
Updated by Philipp Gampe over 12 years ago
- Status changed from New to Accepted
Patch looks ok. Did you check with both BE module and scheduler? Because some code in this file is duplicated :( and it is not really easy to unmess this.
Updated by Philipp Gampe over 12 years ago
Are you sure it prevents the problem? Because $r['type'] is never used then? I push an update patch now, please check this one.
Updated by Gerrit Code Review over 12 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9642
Updated by Gerrit Code Review over 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9642
Updated by Gerrit Code Review over 12 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9642
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch linkvalidator_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/9852
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/9853
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/9854
Updated by Anonymous over 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset commit:78f756734dbe58cdefd07e93fb63613f8d16fe18.
Updated by Michael Stucki almost 11 years ago
- Project changed from 1510 to TYPO3 Core
- Category changed from Linkvalidator to Linkvalidator
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed