Bug #62918

TypoScript userFunc condition does not work with static methods

Added by Oliver Hader about 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
TypoScript
Target version:
Start date:
2014-11-13
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

TypoScript allows to utilize functions (user-functions) to integrate custom condition processing.
However, this currently only works with function defined in the global namespace - it does not work with static methods.

Thus, something like this snipped won't work:
[userFunc = ConditionMatcherUserFunctions::isTrue(1)]

Associated revisions

Revision 5ff97213 (diff)
Added by Oliver Hader about 5 years ago

[BUGFIX] TypoScript userFunc condition does not work with static methods

TypoScript allows to utilize functions (user-functions) to
integrate custom condition processing. However, this currently
only works with function defined in the global namespace - it
does not work with static methods.

Thus, something like this snipped won't work:
[userFunc = ConditionMatcherUserFunctions::isTrue(1)]

The solution is simple, replace function_exists() with a more
generic is_callable() check.

Fixes: #62918
Releases: master, 6.2
Change-Id: I260c73cac26dfd14efc67bc9f65ff39d6ba74da8
Reviewed-on: http://review.typo3.org/34062
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision 10d27be6 (diff)
Added by Oliver Hader about 5 years ago

[BUGFIX] TypoScript userFunc condition does not work with static methods

TypoScript allows to utilize functions (user-functions) to
integrate custom condition processing. However, this currently
only works with function defined in the global namespace - it
does not work with static methods.

Thus, something like this snipped won't work:
[userFunc = ConditionMatcherUserFunctions::isTrue(1)]

The solution is simple, replace function_exists() with a more
generic is_callable() check.

Fixes: #62918
Releases: master, 6.2
Change-Id: I260c73cac26dfd14efc67bc9f65ff39d6ba74da8
Reviewed-on: http://review.typo3.org/34087
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Gerrit Code Review about 5 years ago

  • Status changed from New 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/34062

#2 Updated by Gerrit Code Review about 5 years ago

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

#3 Updated by Oliver Hader about 5 years ago

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

#4 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF