Missing $ret in update 6202

TCRobbert - August 24, 2009 - 08:49
Project:Domain Access
Version:6.x-2.0-rc9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Just updated to RC9. Unfortunately update.php returned the following:
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /xxx/xxx/public_html/update.php on line 174.
* warning: Invalid argument supplied for foreach() in /xxx/xxx/public_html/update.php on line 338.

Which resulted in:
The following queries were executed
domain module
Update #6202

* No queries

Running the latest drupal with many modules on the latest dot deb.

#1

voxpelli - August 24, 2009 - 12:02

I think this is caused by the update function not returning an array - it should return an empty array.

So everything works - the update function just fails to mention that to Drupal and Drupal therefor thinks it needs to go and throw errors.

#2

agentrickard - August 24, 2009 - 13:32

Yes. True. You can safely ignore the error message. The function should be:

function domain_update_6202() {
  $ret = array();
  $options = variable_get('domain_form_elements', array());
  if (isset($options['author'])) {
    unset($options['author']);
  }
  if (isset($options['menu'])) {
    unset($options['menu']);
  }
  variable_set('domain_form_elements', $options);
  return $ret;
}

#3

agentrickard - August 24, 2009 - 13:36
Status:active» fixed

Fixed. Looks like we need an rc10. Grrrr.

#4

agentrickard - August 24, 2009 - 14:09
Title:update.php returned error for line 174 and line 338 when updating to RC9» Missing $ret in update 6202

Title change for links.

#5

System Message - September 7, 2009 - 14:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.