Closed (fixed)
Project:
OG Panels
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2009 at 09:41 UTC
Updated:
21 Sep 2009 at 13:20 UTC
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
Comment #1
bomarmonk commentedSame exact error for me... confirming that this is a problem.
Comment #2
spencerwyatt commentedI'm getting the same error. Disabled, uninstalled and reinstalled module. Everything seems fine until I run update.php and then I get these errors.
Comment #3
vegardjo commentedsame here.. (subscribing)
Comment #4
adam_b commentedsubscribing
Comment #5
sparklet commentedsubscribing
Comment #6
jonathan commentedsubscribing, while I'm looking...
Comment #7
markus_petrux commentedI think the fault is at og_panels.install. Here:
Note the update number is 60001, where it should be 6001.
It probably wants to look like:
I don't know how the schema version number could be fixed though.
Comment #8
mikebell_ commentedTried 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
Comment #9
sbassett commentedsubscribing
Comment #10
markus_petrux commented@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.
Comment #11
FrankT commentedI can confirm that fixing og_panels_update_60001(), then visiting update.php and selecting og_panels update 60001 only fixes the bug.
Comment #12
tallsimon commentedthis worked for me too
Comment #13
FrankT commentedI 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.
Comment #14
markus_petrux commented@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:
But this needs to be decided by module maintainers. :P
Comment #15
markus_petrux commentedBetter title.
Comment #16
markus_petrux commentedThere's no patch, but the code change is pretty simple.
PS: Just marked #559500: Typo in update hook as a duplicate.
Comment #17
joshk commentedthis is fixed in todays dev commit
Comment #18
tallsimon commentedupdate number 50001 seems to be selected by default! selecting 60002 appears to fix the issue. thank you.