summaryrefslogtreecommitdiff
path: root/modules/translation
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-09 21:54:01 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-09 21:54:01 +0000
commit147bb1389a18eca73015390cc46a5fe03abfcb88 (patch)
treec5798ac604e5fd2ded01f15db2f0e422b4077abb /modules/translation
parent364238c585cb3c2f64b99a385c577f174cdf1f39 (diff)
downloadbrdo-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/translation')
-rw-r--r--modules/translation/translation.module2
-rw-r--r--modules/translation/translation.pages.inc4
-rw-r--r--modules/translation/translation.test8
3 files changed, 7 insertions, 7 deletions
diff --git a/modules/translation/translation.module b/modules/translation/translation.module
index 00cd1054d..2074bb63a 100644
--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -229,7 +229,7 @@ function translation_node_prepare($node) {
if (!empty($source_node->tnid)) {
$translations = translation_node_get_translations($source_node->tnid);
if (isset($translations[$_GET['language']])) {
- drupal_set_message(t('A translation of %title in %language already exists, a new %type will be created instead of a translation.', array('%title' => $source_node->title[LANGUAGE_NONE][0]['value'], '%language' => $language_list[$_GET['language']]->name, '%type' => $node->type)), 'error');
+ drupal_set_message(t('A translation of %title in %language already exists, a new %type will be created instead of a translation.', array('%title' => $source_node->title, '%language' => $language_list[$_GET['language']]->name, '%type' => $node->type)), 'error');
return;
}
}
diff --git a/modules/translation/translation.pages.inc b/modules/translation/translation.pages.inc
index c5d38b179..50d8849ee 100644
--- a/modules/translation/translation.pages.inc
+++ b/modules/translation/translation.pages.inc
@@ -33,7 +33,7 @@ function translation_node_overview($node) {
// Existing translation in the translation set: display status.
// We load the full node to check whether the user can edit it.
$translation_node = node_load($translations[$language->language]->nid);
- $title = l($translation_node->title[LANGUAGE_NONE][0]['value'], 'node/' . $translation_node->nid);
+ $title = l($translation_node->title, 'node/' . $translation_node->nid);
if (node_access('update', $translation_node)) {
$options[] = l(t('edit'), "node/$translation_node->nid/edit");
}
@@ -54,7 +54,7 @@ function translation_node_overview($node) {
$rows[] = array($language_name, $title, $status, implode(" | ", $options));
}
- drupal_set_title(t('Translations of %title', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), PASS_THROUGH);
+ drupal_set_title(t('Translations of %title', array('%title' => $node->title)), PASS_THROUGH);
$build['translation_node_overview'] = array(
'#theme' => 'table',
diff --git a/modules/translation/translation.test b/modules/translation/translation.test
index aea57ef2b..10497427f 100644
--- a/modules/translation/translation.test
+++ b/modules/translation/translation.test
@@ -60,10 +60,10 @@ class TranslationTestCase extends DrupalWebTestCase {
// to return to the page then resubmitting the form without a refresh.
$edit = array();
$langcode = LANGUAGE_NONE;
- $edit["title[$langcode][0][value]"] = $this->randomName();
+ $edit["title"] = $this->randomName();
$edit["body[$langcode][0][value]"] = $this->randomName();
$this->drupalPost('node/add/page', $edit, t('Save'), array('query' => array('translation' => $node->nid, 'language' => 'es')));
- $duplicate = $this->drupalGetNodeByTitle($edit["title[$langcode][0][value]"]);
+ $duplicate = $this->drupalGetNodeByTitle($edit["title"]);
$this->assertEqual($duplicate->tnid, 0, t('The node does not have a tnid.'));
// Update original and mark translation as outdated.
@@ -129,7 +129,7 @@ class TranslationTestCase extends DrupalWebTestCase {
function createPage($title, $body, $language) {
$edit = array();
$langcode = LANGUAGE_NONE;
- $edit["title[$langcode][0][value]"] = $title;
+ $edit["title"] = $title;
$edit["body[$langcode][0][value]"] = $body;
$edit['language'] = $language;
$this->drupalPost('node/add/page', $edit, t('Save'));
@@ -155,7 +155,7 @@ class TranslationTestCase extends DrupalWebTestCase {
$edit = array();
$langcode = LANGUAGE_NONE;
- $edit["title[$langcode][0][value]"] = $title;
+ $edit["title"] = $title;
$edit["body[$language][0][value]"] = $body;
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertRaw(t('Page %title has been created.', array('%title' => $title)), t('Translation created.'));