I update from version 6.x-1.05 to 6.x-2.2. After I run update.php I get the following warnings:

* warning: array_merge(): Argument #2 is not an array in /srv/www/vhosts/euxinos.ro/httpdocs/update.php on line 174.
* warning: Invalid argument supplied for foreach() in /srv/www/vhosts/euxinos.ro/httpdocs/update.php on line 339.

The following queries were executed
dhtml_menu module
Update #6000

* DELETE FROM {blocks} WHERE module = 'dhtml_menu'

Update #6001

* No queries

Is it OK?

CommentFileSizeAuthor
#1 dhtml_menu-update-return-284311-1.patch502 bytescburschka

Comments

cburschka’s picture

Status: Active » Needs review
StatusFileSize
new502 bytes

Argh. This is a minor WTF of the database update API. Update functions HAVE to return an empty array, even if they executed no SQL queries at all.

This patch adds a return array() to the update function, which should remove the warning.

And as an answer, the update went fine and everything is okay. The warning was caused because the update system expected a status report about success/failure from the module, and didn't get one.

cburschka’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Needs review » Fixed

DRUPAL-6--3 is fine. This is now committed for 6.x-2.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

akwala’s picture

Project: DHTML Menu » Drupal core
Version: 6.x-2.x-dev » 6.8
Component: PHP Code » update.module
Category: support » bug

I just got this error in Drupal 6.8, when running update.php for the latest module updates for the following:
- Statistics Advanced Settings
- Bookmarks

The errors:

array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/example.com/update.php on line 174.

Invalid argument supplied for foreach() in /var/www/example.com/update.php on line 339.

akwala’s picture

Status: Closed (fixed) » Active

switched status to active.

dave reid’s picture

Title: Warning: array_merge(): Argument #2 is not an array in .../httpdocs/update.php on line 174 and more » Update function missing return array()
Project: Drupal core » Bookmarks
Version: 6.8 » 6.x-1.5
Component: update.module » Code

Well, I'm the module maintainer of statistics advanced settings and I double checked that all my module's update functions return an array. A quick check of the bookmarks module confirms there is an update function missing a return:

function bookmarks_update_6100() {
  db_query("INSERT INTO {menu_bookmarks} VALUES ('defaults','Defaults','The default bookmarks for all users.  This list will be used to pre-populate bookmarks for new users.')");
}
akwala’s picture

Thx, Dave, for checking and reporting.

--aslam

Anonymous’s picture

Status: Active » Fixed

6.x-1.6 resolves this issue.

akwala’s picture

I updated Bookmarks to 6.x-1.6. I didn't get the error, though there wasn't a db update associated with the 6.x-1.6 update. So, it would seem that the db update of 6.x-1.5 did succeed, despite the error/warning.

Status: Fixed » Closed (fixed)

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