Drupal 7 mysql数据库变量不能用variables_get

时间:2018-12-07 14:02:06

标签: drupal-7 drupal-modules

我面临以下问题:我管理的站点使用模块EU Cookie合规版本:7.x-1.25。在Drupal 7.61中的PHP 7.6上,在模块的“设置”面板上,我收到了错误消息,应该在上一次更新之前对其进行修复,并且我检查了补丁,并对其进行了代码明智的应用。 我还检查了如果我使用用于获取模块变量的variables_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] => 
)

当在drupal代码中检查variables_get的内容时,我得到了缺少键的数组键的更大竞争(例如:withdraw_message),但是它执行的时间不长,因此向我展示了丢失数组键的位置(停止执行至早期)

我还要检查数据库,以检查是否保存了保存的数据。

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;
    }

事实:保存的设置在数据库中并且可以正确检索,但是在第一次重新获取和使用密钥之间,它们被密钥的默认值替换,并且这些默认值是不完整的。

0 个答案:

没有答案