Closed (fixed)
Project:
Admin
Version:
6.x-2.0
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2010 at 10:33 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
frank pfabiganugly but working workaround: (needed to make it work fast)
adding this function (mentioned on http://php.net/manual/de/function.array-diff-key.php, by contact-at-autonoma-dot-fr) in file /sites/all/modules/admin/admin.admin.inc
function php4_array_diff_key( )
{
$arrs = func_get_args();
$result = array_shift($arrs);
foreach ($arrs as $array) {
foreach ($result as $key => $v) {
if (array_key_exists($key, $array)) {
unset($result[$key]);
}
}
}
return $result;
}
...
and replacing the call to array_diff_key in line 80 (and code around) with this:
#
# heavy changes
#
if( function_exists( array_diff_key )) {
foreach (array_diff_key($block_info, $options) as $bid => $info) {
$module = array_shift(explode('-', $bid));
$module = isset($modules[$module]) ? $modules[$module] : $module;
$custom_options[$module][$bid] = $info['info'];
}
}
else
{
foreach( php4_array_diff_key( $block_info, $options ) as $bid => $info ) {
$module = array_shift( explode('-', $bid));
$module = isset($modules[$module]) ? $modules[$module] : $module;
$custom_options[$module][$bid] = $info['info'];
}
}
#
#
#
tested, works for me.
Comment #2
skwashd commentedThanks for catching this. Instead of adding PHP4 support as you suggested, the attached patch make admin require PHP 5.1 as the minimum requirement for the 6.x-2 branch. Drupal 7 will require PHP 5.2.4+
I honestly believe that if your hosting doesn't offer PHP 5.2, then you should be looking for a new host. PHP4 was "End of Lifed" on 31 December 2008 - over 3 years ago. It is time to move on. I know Drupal 6 support supports PHP4, but many contrib modules don't.
If you really need to PHP4 use, check out PHP_Compat from PEAR.
I have posted the patch here for other the maintainers have a chance to comment. I don't have a PHP4 environment available to test this in, but I'm confident it will work. If none of the maintainers complain I will check it in sometime on 10 January 2011 (AEDT).
Comment #3
skwashd commentedAs there were no objections, this was committed as git-fd37862