[!!!][TASK] Deprecate global hook softRefParser_GL 73/35773/7
authorStephan Großberndt <stephan@grossberndt.de>
Sun, 4 Jan 2015 14:48:39 +0000 (15:48 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 5 Jan 2015 12:26:50 +0000 (13:26 +0100)
The hook ['SC_OPTIONS']['GLOBAL']['softRefParser_GL'] has been
deprecated. It was a hook to add a general softRefParser which parsed
every SoftReference regardless of its type. The "softRefParser_GL"-hook
was undocumented and used neither in core nor in any known extension.

Resolves: #64109
Releases: master
Change-Id: I1a69097f50e8002e559bd89d39b9ed72dfa18e03
Reviewed-on: http://review.typo3.org/35773
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-64109-Hook-softRefParserGL.rst [new file with mode: 0644]

index 9b57353..a53e1bb 100644 (file)
@@ -3660,9 +3660,14 @@ class BackendUtility {
                        // Set the object string to blank by default:
                        $GLOBALS['T3_VAR']['softRefParser'][$spKey] = '';
                        // Now, try to create parser object:
-                       $objRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey]
-                               ? $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey]
-                               : $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'][$spKey];
+                       $objRef = NULL;
+                       if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey])) {
+                               $objRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$spKey];
+                       } elseif (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'][$spKey])) {
+                               GeneralUtility::deprecationLog('The hook softRefParser_GL (used with parser key "'
+                                       . $spKey . '") is deprecated since TYPO3 CMS 7 and will be removed in TYPO3 CMS 8');
+                               $objRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'][$spKey];
+                       }
                        if ($objRef) {
                                $softRefParserObj = GeneralUtility::getUserObj($objRef, '');
                                if (is_object($softRefParserObj)) {
@@ -3683,6 +3688,7 @@ class BackendUtility {
        static public function explodeSoftRefParserList($parserList) {
                // Looking for global parsers:
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL']) && !empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) {
+                       GeneralUtility::deprecationLog('The hook softRefParser_GL is deprecated since TYPO3 CMS 7 and will be removed in TYPO3 CMS 8');
                        $parserList = implode(',', array_keys($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) . ',' . $parserList;
                }
                // Return immediately if list is blank:
index b0fd799..b2514c3 100644 (file)
@@ -838,8 +838,8 @@ return array(
                                'email' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
                                'url' => \TYPO3\CMS\Core\Database\SoftReferenceIndex::class,
                        ),
+                       // @deprecated global soft reference parsers are deprecated since TYPO3 CMS 7 and will be removed in TYPO3 CMS 8
                        'softRefParser_GL' => array(),
-                       // Global soft reference parsers
                        'cliKeys' => array()
                ),
        ),
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-64109-Hook-softRefParserGL.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-64109-Hook-softRefParserGL.rst
new file mode 100644 (file)
index 0000000..fe6c2f2
--- /dev/null
@@ -0,0 +1,31 @@
+============================================================
+Deprecation: #64109 - Deprecate global hook softRefParser_GL
+============================================================
+
+
+Description
+===========
+
+The hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'] has been deprecated. It was a hook
+to add a general softRefParser which parsed every SoftReference regardless of its type. The "softRefParser_GL"-hook
+was undocumented and used neither in core nor in any known extension.
+
+
+Impact
+======
+
+Creating a global softRefParser by adding a hook to
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'] will trigger a deprecation log message.
+
+
+Affected installations
+======================
+
+Instances with extensions using a $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL']-hook
+
+
+Migration
+=========
+
+A "softRefParser_GL" hook in an extension has to be replaced with multiple "softRefParser" hooks for each type the
+parser can handle.