Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module trigger 2 notices for anonymous users:
Notice : Undefined variable: _SESSION dans include_once() (ligne 18 dans /.../sites/all/modules/languageinterface/languageinterface.module).
Notice : Undefined variable: _SESSION dans include_once() (ligne 27 dans /.../sites/all/modules/languageinterface/languageinterface.module).
One possible fix is to add a 'drupal_session_start();' just before the first '$referrer = $_SERVER["HTTP_REFERER"];'. But adding this also trigger 2 new notices:
Notice : Undefined index: cli dans include_once() (ligne 19 dans /.../sites/all/modules/languageinterface/languageinterface.module).
Notice : Undefined index: cli dans include_once() (ligne 28 dans /.../sites/all/modules/languageinterface/languageinterface.module).
To fix these new notices we need to initialize the $_SESSION['cli] array if it is not defined like this:
if (!isset($_SESSION['cli'])) {
$_SESSION['cli'] = array(
'lang' => array(),
'source' => array(),
'lang' => $language->language,
'source' => ''
);
}
Comment | File | Size | Author |
---|---|---|---|
#1 | notices_fix-2173085-1.patch | 989 bytes | idflood |
Comments
Comment #1
idflood CreditAttribution: idflood commentedComment #2
lklimek CreditAttribution: lklimek commentedI'm not sure if starting session for anonymous users is a good idea - it can break some caching setups.