Bug #67199

Wrong parameter passer to linkhandler hook

Added by Francois Suter almost 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
Start date:
2015-05-29
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

Typolink refactoring introduced a bug in that one wrong parameter is passed to the hooks registered with $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'].

The error can be seen here: https://review.typo3.org/#/c/21785/11/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

Previous to this change, the call to the registered hook was:

return $linkHandlerObj->main($linktxt, $conf, $linkHandlerKeyword, $linkHandlerValue, $link_param, $this);

The interesting argument here is $link_param, which is the full link parameter, so for example something like 36 - - "My link to some page".

After the change, the call is as follows:

return $linkHandlerObj->main($linkText, $configuration, $linkHandlerKeyword, $linkHandlerValue, $linkParameterParts, $this);

where $linkParameterParts is not at all the same variable as $link_param. Instead it is the result of:

$linkParameterParts = GeneralUtility::unQuoteFilenames($mixedLinkParameter, TRUE);

where $linkParameterParts is what $link_param used to be.

This breaks extensions that register link handlers, like "linkhandler" (obviously not the public version which is very old, but for example Alex's fork: https://github.com/Intera/typo3-extension-linkhandler).

How to reproduce the problem:

  1. first you need a 7+ compatible version of "linkhandler", which I just have as a working copy for now, but have uploaded here: https://dl.dropboxusercontent.com/u/12217100/linkhandler.t3x
  2. next, define a link to some news records and give it a title with some blanks in it (e.g. someting like "Title with blanks in it").
  3. observed the rendered URL: there should be an extraneous GET var which corresponds to the second word in the title (i..e "with")

Related issues

Related to TYPO3 Core - Task #49575: Split up typolink() functionality in multiple methods Closed 2013-07-02
Related to TYPO3 Core - Story #46140: Add configurable linkhandler for arbitrary records Closed 2015-04-10 2015-04-11

Associated revisions

Revision a53fb85f (diff)
Added by Francois Suter almost 4 years ago

[BUGFIX] Pass correct parameter to linkhandler

Since the refactoring of typolink, one wrong parameter is passed
to registered linkhandler hooks. This patch restores the right
parameter.

Resolves: #67199
Releases: master
Change-Id: I781c00abc015cc38c0c51fbb84d5063b887c72cc
Reviewed-on: http://review.typo3.org/39797
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Tested-by: Benjamin Mack <>
Reviewed-by: Benjamin Mack <>

History

#1 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from Accepted 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 http://review.typo3.org/39797

#2 Updated by Francois Suter almost 4 years ago

Updated linkhandler available on GitHub now: https://github.com/cobwebch/linkhandler

#3 Updated by Markus Klein almost 4 years ago

  • Sprint Focus set to Stabilization Sprint

Great catch!

I hope you are aware of #46140. ;-)

#4 Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39797

#5 Updated by Francois Suter almost 4 years ago

Markus Klein wrote:

I hope you are aware of #46140. ;-)

I discovered it while investigating this bug. Would be great if such feature finally made it into the Core. Trying to get extension "linkhandler" to work with every new version is major PITA, because the underlying Core architecture is so ugly. So I would say it will be really great only if the whole element browser is refactored ;-)

#6 Updated by Francois Suter almost 4 years ago

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

#7 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF