diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-09 21:54:01 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-09 21:54:01 +0000 |
commit | 147bb1389a18eca73015390cc46a5fe03abfcb88 (patch) | |
tree | c5798ac604e5fd2ded01f15db2f0e422b4077abb /modules/system | |
parent | 364238c585cb3c2f64b99a385c577f174cdf1f39 (diff) | |
download | brdo-147bb1389a18eca73015390cc46a5fe03abfcb88.tar.gz brdo-147bb1389a18eca73015390cc46a5fe03abfcb88.tar.bz2 |
#571654 follow-up by chx, peximo, plach, sun, et al:
Roll-back of node titles as fields. The Entity Translation module in
contrib can add this back, but for everyone else it creates a *huge* WTF.
Apologies for how late this is coming, but better now than post-alpha. :\
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 4 | ||||
-rw-r--r-- | modules/system/system.test | 24 | ||||
-rw-r--r-- | modules/system/system.tokens.inc | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 886e7f178..9a77da925 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1354,7 +1354,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[LANGUAGE_NONE][0]['value'], + '%title' => $node->title, '%teaser' => $node->teaser, '%body' => $node->body, ); @@ -2953,7 +2953,7 @@ function hook_tokens($type, $tokens, array $data = array(), array $options = arr break; case 'title': - $replacements[$original] = $sanitize ? check_plain($node->title[LANGUAGE_NONE][0]['value']) : $node->title[LANGUAGE_NONE][0]['value']; + $replacements[$original] = $sanitize ? check_plain($node->title) : $node->title; break; case 'edit-url': diff --git a/modules/system/system.test b/modules/system/system.test index 3cfa20d1c..4626fa4e0 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -571,7 +571,7 @@ class AccessDeniedTestCase extends DrupalWebTestCase { $this->assertResponse(403); $edit = array( - 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(10)))), + 'title' => $this->randomName(10), 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))), ); $node = $this->drupalCreateNode($edit); @@ -580,13 +580,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[LANGUAGE_NONE][0]['value'], t('Found the custom 403 page')); + $this->assertText($node->title, 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[LANGUAGE_NONE][0]['value'], t('Found the custom 403 page')); + $this->assertText($node->title, 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. @@ -649,7 +649,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase { $this->assertText(t('Page not found'), t('Found the default 404 page')); $edit = array( - 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(10)))), + 'title' => $this->randomName(10), 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(100)))), ); $node = $this->drupalCreateNode($edit); @@ -658,7 +658,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[LANGUAGE_NONE][0]['value'], t('Found the custom 404 page')); + $this->assertText($node->title, t('Found the custom 404 page')); } } @@ -924,16 +924,16 @@ class PageTitleFiltering extends DrupalWebTestCase { // Generate node content. $langcode = LANGUAGE_NONE; $edit = array( - "title[$langcode][0][value]" => '!SimpleTest! ' . $title . $this->randomName(20), + "title" => '!SimpleTest! ' . $title . $this->randomName(20), "body[$langcode][0][value]" => '!SimpleTest! test body' . $this->randomName(200), ); // Create the node with HTML in the title. $this->drupalPost('node/add/page', $edit, t('Save')); - $node = $this->drupalGetNodeByTitle($edit["title[$langcode][0][value]"]); + $node = $this->drupalGetNodeByTitle($edit["title"]); $this->assertNotNull($node, 'Node created and found in database'); $this->drupalGet("node/" . $node->nid); - $this->assertText(check_plain($edit["title[$langcode][0][value]"]), 'Check to make sure tags in the node title are converted.'); + $this->assertText(check_plain($edit["title"]), 'Check to make sure tags in the node title are converted.'); } } @@ -1415,7 +1415,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { // Create the initial objects. $account = $this->drupalCreateUser(); $node = $this->drupalCreateNode(array('uid' => $account->uid)); - $node->title = array(LANGUAGE_NONE => array(array('value' => '<blink>Blinking Text</blink>'))); + $node->title = '<blink>Blinking Text</blink>'; global $user, $language; $source = '[node:title]'; // Title of the node we passed in @@ -1426,7 +1426,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[LANGUAGE_NONE][0]['value']); + $target = check_plain($node->title); $target .= check_plain($account->name); $target .= format_interval(REQUEST_TIME - $node->created, 2, $language->language); $target .= check_plain($user->name); @@ -1444,10 +1444,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[LANGUAGE_NONE][0]['value'])), t('Token sanitized.')); + $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title)), t('Token sanitized.')); $generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE)); - $this->assertFalse(strcmp($generated['[node:title]'], $node->title[LANGUAGE_NONE][0]['value']), t('Unsanitized token generated properly.')); + $this->assertFalse(strcmp($generated['[node:title]'], $node->title), t('Unsanitized token generated properly.')); } } diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc index 876648fb4..6d8912021 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[LANGUAGE_NONE][0]['value']) : $node->title[LANGUAGE_NONE][0]['value']; + $replacements[$original] = $sanitize ? filter_xss($node->title) : $node->title; } break; |