Bug #52045
closedWarning in extensionmanager if constraints are not an array
100%
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
Updated by Markus Klein about 11 years ago
- Target version changed from 4.5.30 to next-patchlevel
Updated by Kay Strobach about 11 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; + }
Updated by Wouter Wolters about 11 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/
Updated by Markus Klein about 11 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.
Updated by Gerrit Code Review about 11 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
Updated by Kay Strobach almost 11 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.
Updated by Wouter Wolters almost 11 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?
Updated by Kay Strobach almost 11 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.
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857
Updated by Gerrit Code Review almost 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857
Updated by Gerrit Code Review almost 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23857
Updated by Gerrit Code Review almost 11 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
Updated by Gerrit Code Review almost 11 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
Updated by Markus Klein almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 80 to 100
Applied in changeset 51b4cf6464a130bcacdd3c635cd2bdfcd252c37b.
Updated by Gerrit Code Review almost 11 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
Updated by Gerrit Code Review almost 11 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
Updated by Markus Klein almost 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 128d14738545af4c393ec671670dac5892cb0f39.
Updated by Benni Mack almost 6 years ago
- Status changed from Resolved to Closed