summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleh Vehera2018-10-05 13:46:09 (GMT)
committerOleh Vehera2018-10-05 13:46:09 (GMT)
commit9a907bdd3baf1d1d7e51b61ebd99bd1dd5075597 (patch)
tree226fddf8c56f7a23fd41641f3dcbb3b6f8604049
parente2b9ae1daeeb944d22575a121eeff680521101ce (diff)
Issue #2957243 by voleger: Fatal error: Call to undefined function variable_init()
-rw-r--r--lightbox2.install22
1 files changed, 12 insertions, 10 deletions
diff --git a/lightbox2.install b/lightbox2.install
index aced1cd..13caeb8 100644
--- a/lightbox2.install
+++ b/lightbox2.install
@@ -106,11 +106,13 @@ function lightbox2_uninstall() {
* too late now.
*/
function lightbox2_update_1() {
- $ret = array();
- $ret[] = update_sql('UPDATE {variable} SET name="lightbox2_lite"
- WHERE name="lightbox2_plus";');
-
- return $ret;
+ $variable_name = 'lightbox2_plus';
+ $var = variable_get($variable_name);
+ if ($var) {
+ variable_set('lightbox2_lite', $var);
+ variable_del($variable_name);
+ }
+ return array();
}
/**
@@ -186,11 +188,11 @@ function lightbox2_update_6001() {
* 'lightbox2_slideshow_pause_on_prev_click'.
*/
function lightbox2_update_6002() {
- $vars = variable_init();
- if (array_key_exists('lightbox2_slideshow_pause_on_prev_click', $vars)) {
- $value = $vars['lightbox2_slideshow_pause_on_prev_click'];
- variable_set('lightbox2_slideshow_pause_on_previous_click', $value);
- variable_del('lightbox2_slideshow_pause_on_prev_click');
+ $variable_name = 'lightbox2_slideshow_pause_on_prev_click';
+ $var = variable_get($variable_name);
+ if ($var) {
+ variable_set('lightbox2_slideshow_pause_on_previous_click', $var);
+ variable_del($variable_name);
}
return array();
}