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.
If your site is not running in multilingual mode themekey will generate the following notice:
Notice: Use of undefined constant LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX - assumed 'LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX' in themekey_match_path() (regel 93 van [..]/sites/all/modules/themekey/themekey_base.inc).
Notice: Use of undefined constant LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX - assumed 'LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX' in themekey_match_path() (regel 94 van [..]/sites/all/modules/themekey/themekey_base.inc).
This makes sense, because locale.inc will not be loaded.
http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupa...
Possible solution: an extra check near line 93 for drupal_multilingual();
will remove the notices.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1598752.patch | 716 bytes | mkalkbrenner |
Comments
Comment #1
mkalkbrennerI'll take a closer look at this.
http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupa... conditionally includes language.inc, not locale.inc.
local.inc is included in several places across the core.
Comment #2
mkalkbrennerdrupal_multilingual() seems to be a valid solution.
Comment #3
jadwigo CreditAttribution: jadwigo commentedNow that you mention it, it does indeed call language.inc
I was checking through bootstrap and
drupal_language_initialize()
seemed like a logical place for locale.incAnyway, I've tested the patch, it applies and the notice is gone - so it works here.
Comment #4
mkalkbrennerThanks for the feedback. ThemeKey 7.x-2.2 will be released now.