Project

General

Profile

Actions

Bug #52045

closed

Warning in extensionmanager if constraints are not an array

Added by Kay Strobach over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extension Manager
Target version:
Start date:
2013-09-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

Warning: array_keys() expects parameter 1 to be array, string given in /mnt/hgfs/!%serverData/www/t3-sources/typo3_src-4.5.27/typo3/sysext/em/classes/tools/class.tx_em_tools.php on line 397 Warning: implode(): Invalid arguments passed in /mnt/hgfs/!%serverData/www/t3-sources/typo3_src-4.5.27/typo3/sysext/em/classes/tools/class.tx_em_tools.php on line 397

-> Solution:

    /**
     * Checks whether the passed dependency is TER2-style (array) and returns a single string for displaying the dependencies.
     *
     * It leaves out all version numbers and the "php" and "typo3" dependencies, as they are implicit and of no interest without the version number.
     *
     * @param    mixed        $dep Either a string or an array listing dependencies.
     * @param    string        $type The dependency type to list if $dep is an array
     * @return    string        A simple dependency list for display
     */
    public static function depToString($dep, $type = 'depends') {
        if (is_array($dep)) {
            if (isset($dep[$type]['php'])) {
                unset($dep[$type]['php']);
            }
            if (isset($dep[$type]['typo3'])) {
                unset($dep[$type]['typo3']);
            }
            if(is_array($dep[$type])) {
                $s = (count($dep[$type])) ? implode(',', array_keys($dep[$type])) : '';
                return $s;
            }
        }
        return '';
    }

> if is_array added
> please make a patch and send it for review to 4.5

Actions

Also available in: Atom PDF