Bug #34566

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

Added by Francois Suter over 10 years ago. Updated almost 5 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
#2

Updated by Philipp Gampe over 10 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.

#3

Updated by Philipp Gampe over 10 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.

#4

Updated by Gerrit Code Review over 10 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

#5

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9642

#6

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9642

#7

Updated by Gerrit Code Review over 10 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

#8

Updated by Gerrit Code Review over 10 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

#9

Updated by Gerrit Code Review over 10 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

#10

Updated by Anonymous over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:78f756734dbe58cdefd07e93fb63613f8d16fe18.

#11

Updated by Michael Stucki over 8 years ago

  • Category set to Linkvalidator
#12

Updated by Michael Stucki over 8 years ago

  • Project changed from 1510 to TYPO3 Core
  • Category changed from Linkvalidator to Linkvalidator
#13

Updated by Riccardo De Contardi almost 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF