Переменные базы данных mysql в Drupal 7 не выбираются с помощью variable_get - PullRequest
0 голосов
/ 07 декабря 2018

Я столкнулся со следующей проблемой: Сайт, которым я управляю, использует модуль EU Cookie Compliance Version: 7.x-1.25.на PHP 7.6 в Drupal 7.61 На панели настроек модуля у меня есть сообщения об ошибках, которые должны быть исправлены при последнем обновлении, и я проверяю патч, и он применяется с учетом кода.Я также проверил, что я получу, если я использую variable_get, который использовался для получения переменных для модуля.

(
    [popup_enabled] => 1
    [popup_clicking_confirmation] => 1
    [popup_position] => 1
    [popup_agree_button_message] => OK
    [popup_disagree_button_message] => Nein, ich möchte mehr erfahren
    [popup_info] => Array
        (
            [value] => <p>Diese Website arbeitet mit Cookies, mit denen wir das Erlebnis auf unserer Website verbessern möchten. Wenn Sie die Seite weiterhin benutzen, akzeptieren Sie, Cookies von unserer Seite zu erhalten.</p>

            [format] => filtered_html
        )

    [popup_agreed_enabled] => 0
    [popup_hide_agreed] => 0
    [popup_find_more_button_message] => More information
    [popup_hide_button_message] => Hide
    [popup_agreed] => Array
        (
            [value] => <p>Thank you for accepting cookies on this site.</p>

            [format] => filtered_html
        )

    [popup_link] => node/460
    [popup_link_new_window] => 1
    [popup_height] => 
    [popup_width] => 100%
    [popup_delay] => 1000
    [popup_bg_hex] => c0087f
    [popup_text_hex] => ffffff
    [domains_option] => 1
    [domains_list] => 
    [exclude_paths] => 
)

при проверке содержимого variable_get в коде drupal я получаю большее значение conetn для ключа массивас пропущенными ключами (например: изъятие-сообщение), но он выполняется не долго, чтобы показать, где теряются ключи массива (остановлено выполнение раньше)

Я также проверяю базу данных, чтобы проверить, сохранились ли моиданные сохраняются, и это так.

a:45:{
    s:13:"popup_enabled";
    i:1;
    s:6:"method";
    s:6:"opt_in";
    s:20:"disabled_javascripts";
    s:0:"";
    s:19:"whitelisted_cookies";
    s:0:"";
    s:22:"consent_storage_method";
    s:12:"do_not_store";
    s:27:"popup_clicking_confirmation";
    b:0;
    s:10:"popup_info";
    a:2:{
        s:5:"value";
        s:207:"<p>Diese Website arbeitet mit Cookies, mit denen wir das Erlebnis auf unserer Website verbessern möchten. Wenn Sie die Seite weiterhin benutzen, akzeptieren Sie, Cookies von unserer Seite zu erhalten.</p>";
        s:6:"format";
        s:13:"filtered_html";
        }
    s:18:"use_mobile_message";
    i:0;
    s:17:"mobile_popup_info";
    a:2:{
        s:5:"value";
        s:0:"";
        s:6:"format";
        s:9:"full_html";
        }
    s:17:"mobile_breakpoint";
    s:3:"768";
    s:26:"popup_agree_button_message";
    s:2:"OK";
    s:20:"show_disagree_button";
    b:1;
    s:29:"popup_disagree_button_message";
    s:31:"Nein, ich möchte mehr erfahren";
    s:21:"disagree_button_label";
    s:8:"Ablehnen";
    s:16:"withdraw_enabled";
    i:0;
    s:16:"withdraw_message";
    a:2:{
        s:5:"value";
        s:0:"";
        s:6:"format";
        s:13:"filtered_html";
        }
    s:25:"withdraw_tab_button_label";
    s:0:"";
    s:28:"withdraw_action_button_label";
    s:0:"";
    s:20:"popup_agreed_enabled";
    i:0;
    s:17:"popup_hide_agreed";
    i:0;s:12:"popup_agreed";
    a:2:{
        s:5:"value";
        s:54:"<p>Thank you for accepting cookies on this site.</p>";
        s:6:"format";
        s:13:"filtered_html";
        }
    s:30:"popup_find_more_button_message";
    s:16:"More information";
    s:25:"popup_hide_button_message";
    s:4:"Hide";
    s:10:"popup_link";
    s:8:"node/460";
    s:21:"popup_link_new_window";
    i:1;
    s:14:"popup_position";
    b:1;
    s:12:"use_bare_css";
    i:0;
    s:14:"popup_text_hex";s:6:"ffffff";
    s:12:"popup_bg_hex";
    s:6:"c0087f";
    s:12:"popup_height";
    s:0:"";
    s:11:"popup_width";
    s:4:"100%";
    s:18:"fixed_top_position";
    i:0;
    s:11:"popup_delay";
    s:4:"1000";
    s:26:"disagree_do_not_show_popup";
    i:0;
    s:11:"reload_page";
    i:0;
    s:28:"popup_scrolling_confirmation";
    b:0;
    s:11:"cookie_name";
    s:0:"";
    s:14:"domains_option";
    s:1:"1";
    s:12:"domains_list";
    s:0:"";
    s:13:"exclude_paths";
    s:0:"";
    s:19:"exclude_admin_pages";
    i:0;
    s:13:"exclude_uid_1";
    i:0;
    s:12:"script_scope";
    s:6:"footer";
    s:33:"better_support_for_screen_readers";
    i:0;
    s:14:"cookie_session";
    i:0;
    }

Факт: сохраненные настройки находятся в базе данных и извлекаются правильно, но между первым восстановлением и использованием ключей они заменяются значениями по умолчанию дляключ и эти значения по умолчанию являются неполными.

...