When viewing "my subscription" page, I get error:

array_merge() [function.array-merge]: Argument #1 is not an array in J:\ApacheVcsoszsz\modules\subscriptions\subscriptions.module on line 515.

array_merge() [function.array-merge]: Argument #2 is not an array in J:\ApacheVcsoszsz\modules\subscriptions\subscriptions.module on line 515.

(I use latest drupal and subscription module 4.6)

Comments

stevryn’s picture

I also get this same error.

shezz’s picture

I got the same error and got rid of it by changing the subscription.module at line#514...:

      $headers = array(t('type'), t('title'), t('operations'));
      	$subrows = array_merge($subrowsn, $subrowsb, $subrowst);

to

      $headers = array(t('type'), t('title'), t('operations'));
      	if (!is_array($subrowsn)) $subrowsn=array();
      	if (!is_array($subrowsb)) $subrowsb=array();
      	if (!is_array($subrowst)) $subrowst=array();
      	$subrows = array_merge($subrowsn, $subrowsb, $subrowst);

just like Bernd, who has it done with the similar array problem (http://drupal.org/node/24151).

I do not know, if there will be later any trouble.. but for the moment, it seems to work.

greets, Shezz

ullgren’s picture

Thanks!

davidb2710’s picture

This problem is caused by the fact that the subscriptions_page() function in subscriptions.module does not initialize the arrays.

In PHP 5 the array_merge() function requires the arguements to be arrays.

Because the variables have not been initialised, then they may be unset when the array_merge function is called. As they are unset they are not arrays. This generates the warning.

To fix:

function subscriptions_page() {
  // Initialize the array variables
  $subrowsn = array();
  $subrowsb = array();
  $subrowst = array();

  // Rest of function....
}

diaa’s picture

after Initializing the array variables it worked fine with me.

dziemecki’s picture

Assigned: Unassigned » dziemecki

I'm testing this code and will commit shortly if I have no problems.

dziemecki’s picture

Status: Active » Closed (fixed)

I've committed these changes.