Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When locale is enabled I get the following SQL error.
Warning: Illegal offset type in isset or empty in locale() (line 669 of /home/lsolesen/workspace/vih_dk_build/modules/locale/locale.module).
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'A more complete description calendar component than that provided by the summa' at line 1: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source_name, :source_description, :source_parser_ical_handler AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => da [:context] => [:source_name] => Description [:source_description] => A more complete description calendar component than that provided by the summary property. [:source_parser_ical_handler] => formatText ) i locale() (linje 676 af /home/vih/vih.dk/modules/locale/locale.module).
The undefined offset is $context in these lines from locale and the sql error refers to the following sql:
if (!isset($locale_t[$langcode][$context][$string])) {
// We do not have this translation cached, so get it from the DB.
$translation = db_query("SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'", array(
':language' => $langcode,
':source' => $string,
':context' => (string) $context,
))->fetchObject();
// ... more code
}
Comment | File | Size | Author |
---|---|---|---|
#2 | fix-locale-integration-issue-1415226-2.patch | 504 bytes | lsolesen |
Comments
Comment #1
lsolesen CreditAttribution: lsolesen commentedThe debug_backtrace() called right befoer the code can be seen her: http://pastebin.ca/2105973
Comment #2
lsolesen CreditAttribution: lsolesen commentedAttached patch which seems to fix the problem.
Comment #3
lsolesen CreditAttribution: lsolesen commentedComment #4
straight-shoota CreditAttribution: straight-shoota commentedSeems to solve the error.
Comment #5
plonk CreditAttribution: plonk commentedCan confirm this fix.
Comment #5.0
plonk CreditAttribution: plonk commentedAdded the undefined offset and code snippet from locale.