Attempting to configure the phpBB Topics block under the admin/block page causes something in forms.inc to fail. I think that this may be related to a php5 change with array_shift(). I get an error message (on my test machine) something like the following:
array_shift() [function.array-shift]: The argument should be an array in /Library/WebServer/americaninventorspot/includes/form.inc on line 500.
My config: FreeBSD 6.1 i386, Drupal 4.7.6, php5.2.1, mysql 4.1.20
My website: American Inventor Spot
Solution: I decided to fix the block_block() hook in the phpbb.module to remove the error and allow me to configure the block using the default options. I also removed the empty code for more than one Forum Topics block since it wasn't implemented anyway. Here's my solution:
in phpbb.module line 231:
changed from:
function phpbb_block($op = 'list', $delta = 0, $edit = array() ) {
if ($op == 'list') {
$blocks[0]['info'] = t(variable_get('phpbb_block0_title', 'phpBB Topics'));
return $blocks;
}
else {
switch ($delta) {
case 0:
$block['subject'] = t(variable_get('phpbb_block0_title', 'phpBB Topic\
s'));
$block['content'] = _phpbb_display_block_0();
break;
case 1:
//Not used
break;
}
return $block;
}
}changed to:
function phpbb_block($op = 'list', $delta = 0, $edit = array() ) {
switch ($op) {
case 'list':
$blocks[0]['info'] = t(variable_get('phpbb_block0_title', 'phpBB Topics'));
return $blocks;
case 'configure':
$form = array();
return $form;
case 'save':
// stub, no special data to save
return;
case 'view': // fall through
default:
$block['subject'] = t(variable_get('phpbb_block0_title', 'phpBB Topics'));
$block['content'] = _phpbb_display_block_0();
return $block;
}
}
Comments
Comment #1
arkepp commentedHm, I just (literrally, 30 seconds ago) upgraded to PHP 5.2.1 myself, I don't have this issue.
But yours makes more sense anyway, so I'll be happy to commit it. Thanks :)
Comment #2
arkepp commentedSorry, forgot to update. Please verify the CVS-version.
Comment #3
(not verified) commented