Hi, after upgrading to version 1.5 I get the following errors in the system log:

end() [function.end]: Passed variable is not an array or object in /var/www/drupal6/sites/all/modules/multicolumncheckboxesradios/multicolumncheckboxesradios.module line 332

array_pop() [function.array-pop]: The argument should be an array in /var/www/drupal6/sites/all/modules/multicolumncheckboxesradios/multicolumncheckboxesradios.module line 333.

It seems some kind of loop, since the log is full of this kind of errors and after some time I get an exceeded execution time php error.

Disabling this module resolve the problem. The problem came out only when I try to create some new content. If you need some more info, please let me know.

CommentFileSizeAuthor
#2 php_web_errors.log_.tar_.gz682 bytesandypanix
#2 phpinfo.tar_.gz17.81 KBandypanix

Comments

mattyoung’s picture

What is you PHP version?

>The problem came out only when I try to create some new content.

What content are you creating? Does it have multicolumn checkboxes/radios in it?

Can you insert some debug print out?

  for ($i = 0 ; $i < $width ; ++$i) {                              //  <=========  line   321
    $height = ceil(($total - $counter) / ($width - $i));
    $a[$i] = array_slice($keys, $counter, $height);
    $counter += $height;
  }

error_log('=========$items===============');
error_log(print_r($items, TRUE));
error_log('=========$keys===============');
error_log(print_r($keys, TRUE));
error_log('=========$a===============');
error_log(print_r($a, TRUE));


  // transpose
  array_unshift($a, NULL);
  $b = call_user_func_array('array_map', $a);
  // transpose can result in NULL value at the end, clear them
  $last_row = &$b[count($b) - 1];                              //   <============     line 331

error_log('=========$b===============');
error_log(print_r($b, TRUE));
error_log('=========$last_row===============');
error_log(print_r($last_row, TRUE));


  while (end($last_row) == NULL) {               // <==========   line 332
    array_pop($last_row);                           // <==========    line 333
  }

Copy the output from php log and paste here.

andypanix’s picture

StatusFileSize
new17.81 KB
new682 bytes

Hi Matthew, it seems to happen only when creating content that does NOT have multicolumn checkboxes/radios in it. PHP version is 5.2, I was able to replicate the problem on my develop machine (PHP 5.2.10-2ubuntu6.4) and on my production server (PHP 5.2.4-2ubuntu5.10).

Attached you can find phpinfo output for my develop machine and the the php debug log.

mattyoung’s picture

Version: 6.x-1.5 » 6.x-1.6
Assigned: Unassigned » mattyoung
Status: Active » Fixed

Thank you for the feedback. I know what the problem is and it should be fixed in version 1.6 I just released. Please give it a try. The radios 'Bozza' and 'Lavoro finito' should just display in one column.

andypanix’s picture

Hi Matthew, great work! Version 1.6 resolve the issue and yes, one column for the radios 'Bozza' and 'Lavoro finito'.

And thanks again for this really useful module.

Andrea

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.