Project

General

Profile

Actions

Bug #46611

closed

4.5 EM crashes, if ext_emconf entry is string instead of array

Added by Kay Strobach over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extension Manager
Target version:
-
Start date:
2013-03-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

prerequisites:

switch to old em in 4.5

install browser_manuel_en or any other extension which has:


$EM_CONF[$_EXTKEY] = array (
    'title' => 'Browser Manual (en)',
    'description' => 'Browser - TYPO3 without PHP - the manual. Develop your TYPO3 extensions eight times faster!',
    'category' => 'doc',
    'shy' => 0,
    'version' => '4.4.3',
    'dependencies' => '',
    'conflicts' => '',
    'priority' => '',
    'loadOrder' => '',
    'module' => '',
    'state' => 'stable',
    'uploadfolder' => 0,
    'createDirs' => '',
    'modify_tables' => '',
    'clearcacheonload' => 0,
    'lockType' => '',
    'author' => 'Dirk Wildt - Die Netzmacher',
    'author_email' => 'http://wildt.at.die-netzmacher.de',
    'author_company' => '',
    'CGLcompliance' => NULL,
    'CGLcompliance_note' => NULL,
    'constraints' => 
    array (
        'depends' => 
        array (
        ),
        'conflicts' => '',
        'suggests' => 
        array (
        ),
    ),
);

the last conflicts key is assumed to be an array and throws and exception.
Use the following changed function tx_em_Tools::depToString
    /**
     * 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(is_array($dep[$type])) {
                unset($dep[$type]['php']);
                unset($dep[$type]['typo3']);
            }
            $s = (count($dep[$type])) ? implode(',', array_keys($dep[$type])) : '';
            return $s;
        }
        return '';
    }

Should be a no brainer, please push it o gerrit and review it.


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #46642: Fatal error: Cannot unset string offsets in typo3/sysext/em/classes/tools/class.tx_em_tools.php on line 382ClosedMichael Stucki2013-03-25

Actions
Actions

Also available in: Atom PDF