For D7 we are now using '' (empty string) as undefined default language, for both locale, path, node and user modules. This issue hope to redefine this empty string as 'default'.

As mentioned in #334687: [DBTNG + XDB] NOT NULL fields using a DEFAULT '' clause , '' (empty string) is not always functioning for all database engine, e.g. Oracle will translate empty string as NULL automatically, which is not ANSI standard. It is also not too meaningful if using empty string as undefined default value. Use 'default' seems to be a possible replacement.

This patch can help #334687: [DBTNG + XDB] NOT NULL fields using a DEFAULT '' clause : once they are integrated, all 4 error message for path simpletest are solved. This patch also tested with all MySQL + simpletest test case and pass.

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

chx’s picture

Status: Needs work » Closed (won't fix)

We are still not into changing core because Oracle is buggy. I explained in painkstaking detail at http://drupal.org/node/334687

hswong3i’s picture

Status: Closed (won't fix) » Needs review
StatusFileSize
new20.26 KB

This idea is not something new, locale module also coming with the use of 'default'. With revamp default undefined language as 'default' we can sync with locale's handling in similar coding style and syntax, which are both i18n related.

modules/locale/locale.install (line 326):

      'textgroup' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'default',
        'description' => 'A module defined group of translations, see hook_locale().',
      ),

modules/locale/locale.module (line 380):

        $result = db_query("SELECT s.source, t.translation, t.language FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.textgroup = 'default' AND s.version = '%s' AND LENGTH(s.source) < 75", $langcode, VERSION);
...
    $translation = db_fetch_object(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 = '%s' WHERE s.source = '%s' AND s.textgroup = 'default'", $langcode, $string));
...
      db_query("INSERT INTO {locales_source} (location, source, textgroup, version) VALUES ('%s', '%s', 'default', '%s')", request_uri(), $string, VERSION);

includes/locale.inc (line 1675):

      $result = db_query("SELECT lid, location FROM {locales_source} WHERE source = '%s' AND textgroup = 'default'", $string);
...
        db_query("INSERT INTO {locales_source} (location, source, textgroup) VALUES ('%s', '%s', 'default')", $filepath, $string);

Status: Needs review » Needs work

The last submitted patch failed testing.

catch’s picture

Status: Needs work » Closed (won't fix)

There's a difference between locale.module providing a default group of language strings - similar to the default contrib module package of 'other' - something which is used in the UI, and changing a convention across the board. If this can at all be dealt with in the Oracle driver, which going by SQLite it should be, then it needs to be done there.