Bug #62944

displayCond should allow userFunc as condition

Added by Sebastian Fischer 9 months ago. Updated 6 months ago.

Status:Resolved Start date:2014-11-14
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:Backend API Spent time: -
Target version:-
TYPO3 Version:7 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

Description

Would be great to have userFuncs usable in TCA displayCond.
By this it would be possible to have custom rules implemented wether a field should get shown or not


Related issues

duplicated by Core - Feature #46460: Introduce TCA displayCond type "USER" Resolved 2013-03-20

Associated revisions

Revision cdcf56c8
Added by Sebastian Fischer 7 months ago

[FEATURE] displayCond should allow userFunc as condition

This patch enables the usage of a displayCond defined as
'USER:\Example\Namespace\UserClass->functionName:any:other:parameter'

Releases: master
Resolves: #62944
Change-Id: I9e915e9098494715a3fb5961836af6b16eb12b27
Reviewed-on: http://review.typo3.org/34728
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Benjamin Mack <>
Tested-by: Benjamin Mack <>

History

#1 Updated by Sebastian Fischer 9 months ago

The userFunc should get handed the following informations:
if new:
-tablename
-fieldname
-fieldconfig
-currentPageId

if already saved once:
-tablename
-fieldname
-fieldconfig
-currentPageId
-currentRecordData

Return Value would be boolean as its just a decision if the field should be displayed or not.
The userFunc should be called with TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction to have the same handling like every other userfunc

Example for a configuration would be
'displayCond' => 'USER:\Example\Namespace\UserClass->functionName:REQ:true',

#2 Updated by Benjamin Mack 9 months ago

Want to implement this? Would be great!

#3 Updated by Gerrit Code Review 8 months 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/34728

#4 Updated by Gerrit Code Review 8 months 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/34728

#5 Updated by Gerrit Code Review 8 months ago

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

#6 Updated by Gerrit Code Review 7 months ago

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

#7 Updated by Gerrit Code Review 7 months ago

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

#8 Updated by Wouter Wolters 7 months ago

  • Status changed from Under Review to Resolved

#9 Updated by José Ricardo 6 months ago

As an additional feature, I suggest extending this to sheets.
The solution seems to be simple, just adding the case 'USER': in the switch on method getSingleField_typeFlex at TYPO3\CMS\Backend\Form\FormEngine.php

Also available in: Atom PDF