summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-02 19:26:23 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-02 19:26:23 +0000
commit0baad49d620d9988837287cb5942eea764d3ed6f (patch)
tree146072f69b433cb7922572ba2ac627a83987edd4 /modules/system
parentef4513651e210784ba84eb310cf919e26f668bed (diff)
downloadbrdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.gz
brdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.bz2
- Patch #635094 by plach: unify 'language neutral' language codes.
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.api.php2
-rw-r--r--modules/system/system.install10
-rw-r--r--modules/system/system.test24
-rw-r--r--modules/system/system.tokens.inc2
4 files changed, 24 insertions, 14 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 202c08732..3e0938fba 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -1264,7 +1264,7 @@ function hook_mail($key, &$message, $params) {
'%uid' => $node->uid,
'%node_url' => url('node/' . $node->nid, array('absolute' => TRUE)),
'%node_type' => node_type_get_name($node),
- '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'],
+ '%title' => $node->title[LANGUAGE_NONE][0]['value'],
'%teaser' => $node->teaser,
'%body' => $node->body,
);
diff --git a/modules/system/system.install b/modules/system/system.install
index 2b9af7a18..8bd1dcce8 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2813,6 +2813,16 @@ function system_update_7047() {
}
/**
+ * Convert path languages from the empty string to LANGUAGE_NONE.
+ */
+function system_update_7048() {
+ db_update('url_alias')
+ ->fields(array('language' => LANGUAGE_NONE))
+ ->condition('language', '')
+ ->execute();
+}
+
+/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/
diff --git a/modules/system/system.test b/modules/system/system.test
index ff43b97ec..9ecebd9ec 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -530,8 +530,8 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
$this->assertText(t('Access denied'), t('Found the default 403 page'));
$edit = array(
- 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(10)))),
- 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
+ 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(10)))),
+ 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
);
$node = $this->drupalCreateNode($edit);
@@ -539,13 +539,13 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/system/site-information', array('site_403' => 'node/' . $node->nid), t('Save configuration'));
$this->drupalGet('admin');
- $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Found the custom 403 page'));
+ $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Found the custom 403 page'));
// Logout and check that the user login block is shown on custom 403 pages.
$this->drupalLogout();
$this->drupalGet('admin');
- $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Found the custom 403 page'));
+ $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Found the custom 403 page'));
$this->assertText(t('User login'), t('Blocks are shown on the custom 403 page'));
// Log back in and remove the custom 403 page.
@@ -607,8 +607,8 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
$this->assertText(t('Page not found'), t('Found the default 404 page'));
$edit = array(
- 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(10)))),
- 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
+ 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(10)))),
+ 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
);
$node = $this->drupalCreateNode($edit);
@@ -616,7 +616,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/system/site-information', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
$this->drupalGet($this->randomName(10));
- $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Found the custom 404 page'));
+ $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Found the custom 404 page'));
}
}
@@ -880,7 +880,7 @@ class PageTitleFiltering extends DrupalWebTestCase {
drupal_set_title($title, PASS_THROUGH);
$this->assertTrue(strpos(drupal_get_title(), '<em>') !== FALSE, t('Tags in title are not converted to entities when $output is PASS_THROUGH.'));
// Generate node content.
- $langcode = FIELD_LANGUAGE_NONE;
+ $langcode = LANGUAGE_NONE;
$edit = array(
"title[$langcode][0][value]" => '!SimpleTest! ' . $title . $this->randomName(20),
"body[$langcode][0][value]" => '!SimpleTest! test body' . $this->randomName(200),
@@ -1346,7 +1346,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
// Create the initial objects.
$account = $this->drupalCreateUser();
$node = $this->drupalCreateNode(array('uid' => $account->uid));
- $node->title = array(FIELD_LANGUAGE_NONE => array(array('value' => '<blink>Blinking Text</blink>')));
+ $node->title = array(LANGUAGE_NONE => array(array('value' => '<blink>Blinking Text</blink>')));
global $user, $language;
$source = '[node:title]'; // Title of the node we passed in
@@ -1357,7 +1357,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$source .= '[date:short]'; // Short date format of REQUEST_TIME
$source .= '[bogus:token]'; // Nonexistent token, should be untouched
- $target = check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value']);
+ $target = check_plain($node->title[LANGUAGE_NONE][0]['value']);
$target .= check_plain($account->name);
$target .= format_interval(REQUEST_TIME - $node->created, 2, $language->language);
$target .= check_plain($user->name);
@@ -1375,10 +1375,10 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$raw_tokens = array('title' => '[node:title]');
$generated = token_generate('node', $raw_tokens, array('node' => $node));
- $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value'])), t('Token sanitized.'));
+ $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title[LANGUAGE_NONE][0]['value'])), t('Token sanitized.'));
$generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE));
- $this->assertFalse(strcmp($generated['[node:title]'], $node->title[FIELD_LANGUAGE_NONE][0]['value']), t('Unsanitized token generated properly.'));
+ $this->assertFalse(strcmp($generated['[node:title]'], $node->title[LANGUAGE_NONE][0]['value']), t('Unsanitized token generated properly.'));
}
}
diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc
index fb42f1633..f7f27d057 100644
--- a/modules/system/system.tokens.inc
+++ b/modules/system/system.tokens.inc
@@ -283,7 +283,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
case 'node':
if ($nid = $file->nid) {
$node = node_load($file->nid);
- $replacements[$original] = $sanitize ? filter_xss($node->title[FIELD_LANGUAGE_NONE][0]['value']) : $node->title[FIELD_LANGUAGE_NONE][0]['value'];
+ $replacements[$original] = $sanitize ? filter_xss($node->title[LANGUAGE_NONE][0]['value']) : $node->title[LANGUAGE_NONE][0]['value'];
}
break;