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 #1

Updated by Markus Klein over 10 years ago

  • Target version changed from 4.5.30 to next-patchlevel
Actions #2

Updated by Markus Klein over 10 years ago

Which extension is causing this?

Actions #3

Updated by Kay Strobach over 10 years ago

do not know, just took a quick look, the installation, where the error occured has 120 extensions installed and i just started over and needed to fix the extensionmanager, which was not working, because of not parseable JS due to the php error.

It can be any extension with a missing or false type depends, conflicts or suggests section.

Anyway the check with count is simply false, it needs to check wether it's an array or not :D

The patch is really a no-brainer just wrap it in the if(is_array ...) as in the changed function in the patch description

+            if(is_array($dep[$type])) {
                $s = (count($dep[$type])) ? implode(',', array_keys($dep[$type])) : '';
                return $s;
+            }
Actions #4

Updated by Wouter Wolters over 10 years ago

  • Status changed from New to Needs Feedback

Please update your installation to a newer version (4.5.30). There has been a fix for this issue AFAICS now: https://review.typo3.org/#/c/22656/

Actions #5

Updated by Markus Klein over 10 years ago

  • Status changed from Needs Feedback to Accepted

I don't know why you don't push on your own Kay, but I'll do this for you now.

Actions #6

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857

Actions #7

Updated by Kay Strobach over 10 years ago

@Wouter Wolters:

similar bug, but not the same, and I'm using 4.5.30 and partly the git master ...

@Markus Klein:

Working on different maschines with gerrit makes it hard. I always have to set it up again and again ... Not done yet., Thanks for taking care.

Actions #8

Updated by Wouter Wolters over 10 years ago

In your report there is the following information: /mnt/hgfs/!%serverData/www/t3-sources/typo3_src-4.5.27/
So I expected this when asking to use an newer version;) Can you test and vote the patch in Gerrit?

Actions #9

Updated by Kay Strobach over 10 years ago

@Wouter, mhmm it's just for historical reasons :), i just updated the installation directly before sending the patch suggestion and have not changed the path name.

Actions #10

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857

Actions #11

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857

Actions #12

Updated by Gerrit Code Review over 10 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857

Actions #13

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/24097

Actions #14

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/24098

Actions #15

Updated by Markus Klein over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 80 to 100
Actions #16

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/24099

Actions #17

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/24100

Actions #18

Updated by Markus Klein over 10 years ago

  • Status changed from Under Review to Resolved
Actions #19

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF