Bug #44282
closed
EM: fatal error if 'conflicts' is empty string in stead of array
Added by Egbert van der Hout almost 12 years ago.
Updated over 11 years ago.
Category:
Extension Manager
Description
When an extension has 'conflicts' => '' in its ext_emconf.php in stead of 'conflicts' => array(...) an PHP Fatal Error occures in /typo3/sysext/em/classes/tools/class.tx_em_tools.php, line 382 (T3 4.7.7). I think this function (depToString) should be a little less sensitive to such an error.
Ok. A little update. Apparently TYPO3 6.0 has a different format for this array element ['constraints']['conflicts']: empty string in stead of empty array. So if you've fetched an extension via the T3 6.0 Extension Manager don't copy it to an older TYPO3 installation.
- Category set to Extension Manager
- Complexity set to easy
Egbert van der Hout wrote:
Ok. A little update. Apparently TYPO3 6.0 has a different format for this array element ['constraints']['conflicts']: empty string in stead of empty array. So if you've fetched an extension via the T3 6.0 Extension Manager don't copy it to an older TYPO3 installation.
You're right, the format changed during the introduction of the "new" extension manager. But nonetheless, we should fix this in 4.7.
I suggest a check if $dep[$type] is an array
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 '';
}
- Status changed from New to Closed
Also available in: Atom
PDF