Task #46461

Extract displayCond functionality from FormEngine to new class

Added by Sebastian Michaelsen over 2 years ago. Updated about 2 years ago.

Status:Resolved Start date:2013-03-20
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:- Spent time: -
Target version:-
TYPO3 Version:6.1 Complexity:
PHP Version: Sprint Focus:

Description

I'd like to extend the 'displayCond' mechanism by a new type, but \TYPO3\CMS\Backend\Form\FormEngine (formerly t3lib_TCEforms) is way to bloated anyway. So I thought this might be a good point to streamline FormEngine a bit and extract the displayCond functionality to a new class: \TYPO3\CMS\Backend\Form\ElementConditionMatcher

I (hope I) didn't change any functionality, I just tried to split thing a up into clean pieces.


Related issues

related to Core - Bug #49354: Call to undefined method TYPO3\CMS\Backend\Form\ElementCo... Resolved 2013-06-23
related to Core - Bug #47988: Colon not possible in TCA "displayCond" value Resolved 2013-05-06
blocks Core - Feature #46460: Introduce TCA displayCond type "USER" Resolved 2013-03-20

Associated revisions

Revision cf170670
Added by Sebastian Michaelsen over 2 years ago

[TASK] Extract displayCond functionality from FormEngine to new class

In order to streamline \TYPO3\CMS\Backend\Form\FormEngine
(formerly t3lib_TCEforms) the functionality for 'displayCond' is extracted
into a new class: \TYPO3\CMS\Backend\Form\ElementConditionMatcher

  • Refactor the code a bit without changing it's behaviour
  • Deprecate FormEngine->isDisplayCondition() and remove its core usages
  • Add a bit of documentation in the new class
  • Add Unit tests

Releases: 6.1
Resolves: #46461
Change-Id: Ie199fe0600a70231f1e7b710a09164364cef8578
Reviewed-on: https://review.typo3.org/19080
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

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

#2 Updated by Sebastian Michaelsen over 2 years ago

Accidently flagged this issue as "BUG", but it should rather be a "TASK"

#3 Updated by Stefan Galinski over 2 years ago

  • Tracker changed from Bug to Task

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#6 Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#7 Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#8 Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#9 Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#10 Updated by Gerrit Code Review over 2 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19080

#11 Updated by Sebastian Michaelsen over 2 years ago

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

#12 Updated by David Greiner about 2 years ago

Hey!

I got a fatal error by creating new media element (via page module).

Call to undefined method TYPO3\CMS\Backend\Form\ElementConditionMatcher::setRecord() in xxx/typo3_src-6.1.1/typo3/sysext/backend/Classes/Form/FormEngine.php on line 5954

5950 public function isDisplayCondition($displayCond, $row, $ffValueKey = '') {
5951        \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
5952        /** @var $elementConditionMatcher \TYPO3\CMS\Backend\Form\ElementConditionMatcher */
5953        $elementConditionMatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\ElementConditionMatcher');
5954        $elementConditionMatcher->setRecord($row);
5955        $elementConditionMatcher->setFlexformValueKey($ffValueKey);
5956        return $elementConditionMatcher->match($displayCond);
5957    }

I am not surprised about this error, cause of the called method "setRecord()" is not a method in TYPO3\CMS\Backend\Form\ElementConditionMatcher.

Commenting out lines 5954 & 5955 has resolved the error and the media element is placed succesfully, but i am not sure whether this is the proper way.

Also available in: Atom PDF