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 #2

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

Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

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

Actions #10

Updated by Anonymous about 12 years ago

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

Applied in changeset commit:78f756734dbe58cdefd07e93fb63613f8d16fe18.

Actions #11

Updated by Michael Stucki over 10 years ago

  • Category set to Linkvalidator
Actions #12

Updated by Michael Stucki over 10 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF