Installed panels dev alongside the new OG 2.x and recieved this error on the database update.


    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in D:\main\update.php on line 174.
    * warning: Invalid argument supplied for foreach() in D:\main\update.php on line 338.

Comments

bomarmonk’s picture

Same exact error for me... confirming that this is a problem.

spencerwyatt’s picture

I'm getting the same error. Disabled, uninstalled and reinstalled module. Everything seems fine until I run update.php and then I get these errors.

vegardjo’s picture

same here.. (subscribing)

adam_b’s picture

subscribing

sparklet’s picture

subscribing

jonathan’s picture

subscribing, while I'm looking...

markus_petrux’s picture

I think the fault is at og_panels.install. Here:

function og_panels_update_60001() {
  variable_set('page_manager_node_view_disabled', FALSE);
}

Note the update number is 60001, where it should be 6001.

It probably wants to look like:

function og_panels_update_60001() {
  variable_set('page_manager_node_view_disabled', FALSE);
  return array();
}

I don't know how the schema version number could be fixed though.

mikebell_’s picture

Tried the above tweak and got the following error:

* user warning: Duplicate column name 'weight' query: ALTER TABLE og_panels ADD COLUMN weight int(4) NOT NULL DEFAULT 0 in C:\xampp\htdocs\localtraders\sites\all\modules\og_panels\og_panels.install on line 104.
* user warning: Duplicate column name 'tab_num' query: ALTER TABLE og_panels ADD `tab_num` INT unsigned NOT NULL DEFAULT 0, ADD INDEX nid (nid), ADD INDEX page_title (page_title), ADD INDEX tab_num (tab_num), ADD INDEX did (did) in C:\xampp\htdocs\localtraders\includes\database.mysql-common.inc on line 298.

hope it helps someone a bit more knowledgeable than me

sbassett’s picture

subscribing

markus_petrux’s picture

@digital006: The originally reported problem happens because thew function og_panels_update_60001() was returning nothing. That is fixed adding return array() as in #7.

Then, if you visit update.php, you should not select og_panels update 6000, but only 60001, if you wish to try the fix to 60001. If you select 6000, then this update function will be executed again, and this is where all those new errors arise. This is becasue this function should only be executed once.

In summary, all you need to do is fix og_panels_update_60001(), then visit update.php and select og_panels update 60001 only.

FrankT’s picture

I can confirm that fixing og_panels_update_60001(), then visiting update.php and selecting og_panels update 60001 only fixes the bug.

tallsimon’s picture

this worked for me too

FrankT’s picture

I have to do a little drawback to my comment #11. The fix mentioned causes update.php not to fail. But the next time update.php runs, the database update is offered again.

markus_petrux’s picture

@FrankT #13: This is probably because the contents of the schema version column for this module in the {system} table has been truncated to smallint boundaries when the system tried to store 60001, and it probably contains 32767 which is lower than 60001, so the update.php script thinks your current version of the module needs to be updated again.

This needs to be fixed somehow by altering the schema version column for this module in the {system} table, and changing the name of the hook_update_N() coded here by mistake so that it uses a number that makes sense. But this needs to be addressed by module maintainers, as there would be several ways to do it and they would have to choose one. It would create more confusion if a fix was posted here and then they decide to do it otherwise.

The update function would have to look like the following from the start:

function og_panels_update_6001() {
  variable_set('page_manager_node_view_disabled', FALSE);
  return array();
}

But this needs to be decided by module maintainers. :P

markus_petrux’s picture

Title: Database update error » Errors in og_panels_update_60001()

Better title.

markus_petrux’s picture

Status: Active » Needs review

There's no patch, but the code change is pretty simple.

PS: Just marked #559500: Typo in update hook as a duplicate.

joshk’s picture

Status: Needs review » Fixed

this is fixed in todays dev commit

tallsimon’s picture

update number 50001 seems to be selected by default! selecting 60002 appears to fix the issue. thank you.

Status: Fixed » Closed (fixed)

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