Project

General

Profile

Actions

Bug #34566

closed

Custom validators may be overriden by default ones depending on load order

Added by Francois Suter about 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
Start date:
2012-03-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

issue34566.diff (788 Bytes) issue34566.diff Francois Suter, 2012-03-06 14:56
Actions

Also available in: Atom PDF