[!!!][TASK] Deprecate "device" TypoScript condition 02/35402/3
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 13 Dec 2014 22:57:15 +0000 (23:57 +0100)
committerFrank Nägler <typo3@naegler.net>
Sun, 14 Dec 2014 14:27:22 +0000 (15:27 +0100)
The TS condition for the device has been forgotten in
issue #60574 and is deprecated now.

Resolves: #63522
Related: #60574
Releases: master
Change-Id: I466125afe1f1398fa892d28cc8f7515181e82ca0
Reviewed-on: http://review.typo3.org/35402
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-63522-ClientRelatedConditionDevice.rst [new file with mode: 0644]

index b2dd584..9fabceb 100644 (file)
@@ -194,9 +194,9 @@ abstract class AbstractConditionMatcher {
         * @return NULL|boolean Result of the evaluation; NULL if condition could not be evaluated
         */
        protected function evaluateConditionCommon($key, $value) {
-               if (GeneralUtility::inList('browser,version,system,useragent', strtolower($key))) {
+               if (GeneralUtility::inList('browser,device,version,system,useragent', strtolower($key))) {
                        GeneralUtility::deprecationLog(
-                               'Usage of client related conditions (browser, version, system, useragent) is deprecated since 7.0.'
+                               'Usage of client related conditions (browser, device, version, system, useragent) is deprecated since 7.0.'
                        );
                        $browserInfo = $this->getBrowserInfo(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'));
                }
@@ -601,6 +601,7 @@ abstract class AbstractConditionMatcher {
         *
         * @param string $userAgent The useragent string, \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_USER_AGENT')
         * @return string Code for the specific device type
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        protected function getDeviceType($userAgent) {
                return \TYPO3\CMS\Core\Utility\ClientUtility::getDeviceType($userAgent);
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-63522-ClientRelatedConditionDevice.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-63522-ClientRelatedConditionDevice.rst
new file mode 100644 (file)
index 0000000..e0e7564
--- /dev/null
@@ -0,0 +1,31 @@
+=================================================================
+Deprecation: #63522 - Deprecate the "device" TypoScript condition
+=================================================================
+
+Description
+===========
+
+Next other client related TypoScript conditions the "device" type
+condition is deprecated.
+
+
+Impact
+======
+
+Using a condition like ``[device = wap]`` is considered outdated
+and should be solved differently.
+
+Affected installations
+======================
+
+Instances with TypoScript that relies on ``[device = ...]``.
+
+Migration
+=========
+
+* Most usual conditions for specific browsers can nowadays be turned into conditional CSS includes
+* Use libraries such as modernizr for browser support
+* If conditions for specific clients or devices are still needed, they
+  should be done with a userFunc condition and a project like WURFL
+  that keep the device information more recent than the current core
+  code like matching AMIGA