[BUGFIX] Add "suggests" as valid dependency type
authorTilo Baller <baller@cosmocode.de>
Fri, 9 Nov 2012 20:14:41 +0000 (21:14 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 10 Nov 2012 18:27:27 +0000 (19:27 +0100)
Currently extensions with "suggests" contraint in ext_emconf.php
fail to install in Extension Manager with exception
"suggestwas not a valid dependency type.".

Example (taken from EXT:saltedpasswords ext_emconf.php):
    'constraints' => array(
        [...]
        'suggests' => array(
            'rsaauth' => ''
        )
    ),

NOTE: This patch does not implement the missing handling
for suggested extensions.

Fixes: #42594
Releases: 6.0

Change-Id: I326de368508c5c9a350d7b7e84b07f3bc1582437
Reviewed-on: http://review.typo3.org/16367
Reviewed-by: Francois Suter
Tested-by: Francois Suter
Reviewed-by: Oliver Hader
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/extensionmanager/Classes/Domain/Model/Dependency.php

index 106f536..9e03f85 100644 (file)
@@ -60,7 +60,8 @@ class Dependency extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         */
        static protected $dependencyTypes = array(
                'depends',
-               'conflicts'
+               'conflicts',
+               'suggests'
        );
 
        /**
@@ -125,7 +126,7 @@ class Dependency extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
                if (in_array($type, self::$dependencyTypes)) {
                        $this->type = $type;
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($type . 'was not a valid dependency type.');
+                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($type . ' was not a valid dependency type.');
                }
        }