[!!!][TASK] Deprecate unused methods from FormEngine 89/35489/3
authorFrank Nägler <typo3@naegler.net>
Mon, 15 Dec 2014 17:54:22 +0000 (18:54 +0100)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Mon, 15 Dec 2014 18:17:56 +0000 (19:17 +0100)
This patch deprecates the following methods of FormEngine:
* FormEngine::getSingleField_typeFlex_langMenu()
* FormEngine::getSingleField_typeFlex_sheetMenu()
* FormEngine::getSpecConfFromString()
and removes the dependency from all form element classes.

Resolves: #63912
Releases: master
Change-Id: I3c1722785418d384a05028f8ab66b6212a085895
Reviewed-on: http://review.typo3.org/35489
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/backend/Classes/Form/Element/GroupElement.php
typo3/sysext/backend/Classes/Form/Element/InputElement.php
typo3/sysext/backend/Classes/Form/Element/SelectElement.php
typo3/sysext/backend/Classes/Form/Element/TextElement.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-63912-FormEngine-unusedMethods.rst [new file with mode: 0644]

index ec399a8..daa698b 100644 (file)
@@ -57,7 +57,7 @@ class GroupElement extends AbstractFormElement {
                $this->formEngine->registerRequiredProperty('range', $additionalInformation['itemFormElName'], array($minitems, $maxitems, 'imgName' => $table . '_' . $row['uid'] . '_' . $field));
                $info = '';
                // "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist.
-               $specConf = $this->formEngine->getSpecConfFromString($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
+               $specConf = BackendUtility::getSpecConfParts($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
                $additionalInformation['itemFormElID_file'] = $additionalInformation['itemFormElID'] . '_files';
                // whether the list and delete controls should be disabled
                $noList = isset($config['disable_controls']) && GeneralUtility::inList($config['disable_controls'], 'list');
index 52a6580..35409a3 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Form\Element;
  */
 
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Resource\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 
@@ -34,7 +35,7 @@ class InputElement extends AbstractFormElement {
         */
        public function render($table, $field, $row, &$additionalInformation) {
                $config = $additionalInformation['fieldConf']['config'];
-               $specConf = $this->formEngine->getSpecConfFromString($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
+               $specConf = BackendUtility::getSpecConfParts($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
                $size = MathUtility::forceIntegerInRange($config['size'] ? $config['size'] : 30, 5, $this->formEngine->maxInputWidth);
                $evalList = GeneralUtility::trimExplode(',', $config['eval'], TRUE);
                $classAndStyleAttributes = $this->formEngine->formWidthAsArray($size);
index fff6fcc..5d76178 100644 (file)
@@ -73,7 +73,7 @@ class SelectElement extends AbstractFormElement {
                        $disabled = ' disabled="disabled"';
                }
                // "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist.
-               $specConf = $this->formEngine->getSpecConfFromString($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
+               $specConf = BackendUtility::getSpecConfParts($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
                $selItems = $this->getSelectItems($table, $field, $row, $additionalInformation);
 
                // Creating the label for the "No Matching Value" entry.
index 40df141..fc5e6dc 100644 (file)
@@ -75,7 +75,7 @@ class TextElement extends AbstractFormElement {
                // Set TRUE, if the RTE would have been loaded if it wasn't for the disable-RTE flag in the bottom of the page...
                $rteWouldHaveBeenLoaded = FALSE;
                // "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist. Traditionally, this is where RTE configuration has been found.
-               $specialConfiguration = $this->formEngine->getSpecConfFromString($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
+               $specialConfiguration = BackendUtility::getSpecConfParts($additionalInformation['extra'], $additionalInformation['fieldConf']['defaultExtras']);
                // Setting up the altItem form field, which is a hidden field containing the value
                $altItem = '<input type="hidden" name="' . htmlspecialchars($additionalInformation['itemFormElName']) . '" value="' . htmlspecialchars($additionalInformation['itemFormElValue']) . '" />';
                $item = '';
index 5ac97cc..993deaa 100644 (file)
@@ -1540,8 +1540,10 @@ class FormEngine {
         * @param array $selectedLanguage
         * @param bool $multi
         * @return string HTML for menu
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public function getSingleField_typeFlex_langMenu($languages, $elName, $selectedLanguage, $multi = TRUE) {
+               GeneralUtility::logDeprecatedFunction();
                $opt = array();
                foreach ($languages as $lArr) {
                        $opt[] = '<option value="' . htmlspecialchars($lArr['ISOcode']) . '"'
@@ -1562,8 +1564,10 @@ class FormEngine {
         * @param string $elName Form element name of the field containing the sheet pointer
         * @param string $sheetKey Current sheet key
         * @return string HTML for menu
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public function getSingleField_typeFlex_sheetMenu($sArr, $elName, $sheetKey) {
+               GeneralUtility::logDeprecatedFunction();
                $tCells = array();
                $pct = round(100 / count($sArr));
                foreach ($sArr as $sKey => $sheetCfg) {
@@ -2000,8 +2004,10 @@ class FormEngine {
         * @param string $defaultExtras The ['defaultExtras'] value from field configuration
         * @return array An array with the special options in.
         * @see getSpecConfForField(), BackendUtility::getSpecConfParts()
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public function getSpecConfFromString($extraString, $defaultExtras) {
+               GeneralUtility::logDeprecatedFunction();
                return BackendUtility::getSpecConfParts($extraString, $defaultExtras);
        }
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-63912-FormEngine-unusedMethods.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-63912-FormEngine-unusedMethods.rst
new file mode 100644 (file)
index 0000000..f2bfa7d
--- /dev/null
@@ -0,0 +1,29 @@
+==============================================================
+Deprecation: #63912 - Deprecate unused methods from FormEngine
+==============================================================
+
+Description
+===========
+
+:php:`FormEngine::getSingleField_typeFlex_langMenu()` has been deprecated.
+:php:`FormEngine::getSingleField_typeFlex_sheetMenu()` has been deprecated.
+:php:`FormEngine::getSpecConfFromString()` has been deprecated.
+
+
+Impact
+======
+
+Using :php:`getSingleField_typeFlex_langMenu()`, :php:`getSingleField_typeFlex_sheetMenu()` and :php:`getSpecConfFromString()` of FormEngine class will trigger a deprecation log message.
+
+
+Affected installations
+======================
+
+Instances which use custom form elements, which make use of :php:`getSingleField_typeFlex_langMenu()`, :php:`getSingleField_typeFlex_sheetMenu()` or :php:`getSpecConfFromString()`.
+
+
+Migration
+=========
+
+For :php:`getSingleField_typeFlex_langMenu()` and :php:`getSingleField_typeFlex_sheetMenu()` no migration is possible, those methods were unused for a long time already and should not be needed at all.
+For :php:`getSpecConfFromString()` use method :php:`BackendUtility::getSpecConfParts()` instead.