I've been getting a lot of the following PHP warnings since I enabled apachesolr_multilingual and put a search form on every page of a site:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/staging/sites/all/modules/contrib/apachesolr_multilingual/apachesolr_multilingual.module on line 414.

Since $form['#submit'] might be empty/NULL when the hook_form_alter is run, it can trigger this warning.

The attached patch suppresses these warnings for me, but I'm thinking that an array_merge is used here because the order of submit functions is important. If so, this patch might not have the desired behavior.

This is my first patch from git, so apologies if it's in an incorrect format.

Thanks for your work on apachesolr_mulitlingual!
-G

CommentFileSizeAuthor
asm_hook_form_alter_array_merge.patch557 bytesgdl

Comments

mkalkbrenner’s picture

The order is important. I'll prepare a different patch to prevent the warning.

mkalkbrenner’s picture

Status: Active » Fixed

fixed and committed to 6.x-2.x and 7.x-1.x

Status: Fixed » Closed (fixed)

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

  • Commit 3522760 on 7.x-1.x, 6.x-3.x by mkalkbrenner:
    [#1109858] array_merge PHP warnings in...