summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--modules/userreference/userreference.install22
2 files changed, 13 insertions, 10 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 551fc11..a3a7ee8 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -46,6 +46,7 @@ Bugfixes:
- #416134 Userreference, impossible to filter allowed values by blocked users. Requires update.php.
- Minor fix in multigroup. Remove the check for module_exists('fieldgroup'), which is something implicit.
- Minor fix in multigroup. Remove unused argument $form_id from invocation to worker functions in hook_form_alter().
+- #545942 warning: array_filter() [function.array-filter]: The first argument should be an array in userreference_update_6002().
Changes:
- #421116 Move content.js to js/content.admin.js for consistency with location of new js files.
diff --git a/modules/userreference/userreference.install b/modules/userreference/userreference.install
index aab346f..a65116a 100644
--- a/modules/userreference/userreference.install
+++ b/modules/userreference/userreference.install
@@ -128,16 +128,18 @@ function userreference_update_6002() {
while ($userreference = db_fetch_object($result)) {
$global_settings = unserialize($userreference->global_settings);
- $referenceable_status = array_filter($global_settings['referenceable_status']);
- $global_settings['referenceable_status'] = (!empty($referenceable_status) ? 1 : '');
-
- // We can't use update_sql() here because of curly braces in serialized
- // array.
- db_query("UPDATE {". content_field_tablename() ."} SET global_settings = '%s' WHERE field_name = '%s'", serialize($global_settings), $userreference->field_name);
- $ret[] = array(
- 'success' => TRUE,
- 'query' => t("The 'referenceable_status' option for %field has been fixed.", array('%field' => $userreference->field_name)),
- );
+ if (isset($global_settings['referenceable_status']) && is_array($global_settings['referenceable_status'])) {
+ $referenceable_status = array_filter($global_settings['referenceable_status']);
+ $global_settings['referenceable_status'] = (!empty($referenceable_status) ? 1 : '');
+
+ // We can't use update_sql() here because of curly braces in serialized
+ // array.
+ db_query("UPDATE {". content_field_tablename() ."} SET global_settings = '%s' WHERE field_name = '%s'", serialize($global_settings), $userreference->field_name);
+ $ret[] = array(
+ 'success' => TRUE,
+ 'query' => t("The 'referenceable_status' option for %field has been fixed.", array('%field' => $userreference->field_name)),
+ );
+ }
}
// Rebuild content caches only if necessary.