Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.326 diff -u -p -r1.326 bootstrap.inc --- includes/bootstrap.inc 15 Nov 2009 21:41:06 -0000 1.326 +++ includes/bootstrap.inc 17 Nov 2009 14:35:34 -0000 @@ -194,6 +194,13 @@ define('LANGUAGE_TYPE_INTERFACE', 'langu define('LANGUAGE_TYPE_URL', 'language_url'); /** + * The language code assigned to untranslatable fields. + * + * Defined by ISO639-2 for "No linguistic content / Not applicable". + */ +define('LANGUAGE_NONE', 'zxx'); + +/** * Language written left to right. Possible value of $language->direction. */ define('LANGUAGE_LTR', 0); Index: includes/language.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/language.inc,v retrieving revision 1.23 diff -u -p -r1.23 language.inc --- includes/language.inc 24 Oct 2009 05:13:43 -0000 1.23 +++ includes/language.inc 17 Nov 2009 14:35:34 -0000 @@ -380,7 +380,7 @@ function language_fallback_get_candidate } $fallback_candidates = array_keys($fallback_candidates); - $fallback_candidates[] = FIELD_LANGUAGE_NONE; + $fallback_candidates[] = LANGUAGE_NONE; // Let other modules hook in and add/change candidates. drupal_alter('language_fallback_candidates', $fallback_candidates); Index: modules/aggregator/aggregator.test =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v retrieving revision 1.35 diff -u -p -r1.35 aggregator.test --- modules/aggregator/aggregator.test 11 Oct 2009 03:07:16 -0000 1.35 +++ modules/aggregator/aggregator.test 17 Nov 2009 14:35:34 -0000 @@ -249,7 +249,7 @@ EOF; } function createSampleNodes() { - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Post 5 articles. for ($i = 0; $i < 5; $i++) { $edit = array(); Index: modules/blog/blog.test =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.test,v retrieving revision 1.22 diff -u -p -r1.22 blog.test --- modules/blog/blog.test 8 Nov 2009 10:02:41 -0000 1.22 +++ modules/blog/blog.test 17 Nov 2009 14:35:34 -0000 @@ -138,20 +138,20 @@ class BlogTestCase extends DrupalWebTest // View blog node. $this->drupalGet('node/' . $node->nid); $this->assertResponse(200); - $this->assertTitle($node->title[FIELD_LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Blog node was displayed')); + $this->assertTitle($node->title[LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Blog node was displayed')); $this->assertText(t('Home ' . $crumb . ' Blogs ' . $crumb . ' @name' . $quote . 's blog', array('@name' => format_username($node_user))), t('Breadcrumbs were displayed')); // View blog edit node. $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertResponse($response); if ($response == 200) { - $this->assertTitle('Edit Blog entry ' . $node->title[FIELD_LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Blog edit node was displayed')); + $this->assertTitle('Edit Blog entry ' . $node->title[LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Blog edit node was displayed')); } if ($response == 200) { // Edit blog node. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = 'node/' . $node->nid; $edit["body[$langcode][0][value]"] = $this->randomName(256); $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); Index: modules/book/book.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v retrieving revision 1.26 diff -u -p -r1.26 book.admin.inc --- modules/book/book.admin.inc 8 Nov 2009 10:02:41 -0000 1.26 +++ modules/book/book.admin.inc 17 Nov 2009 14:35:34 -0000 @@ -78,7 +78,7 @@ function book_admin_settings_validate($f * @ingroup forms. */ function book_admin_edit($form, $form_state, $node) { - drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); + drupal_set_title($node->title[LANGUAGE_NONE][0]['value']); $form['#node'] = $node; _book_admin_table($node, $form); $form['save'] = array( @@ -131,7 +131,7 @@ function book_admin_edit_submit($form, & // Update the title if changed. if ($row['title']['#default_value'] != $values['title']) { $node = node_load($values['nid'], FALSE); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $node->title = array($langcode => array(array('value' => $values['title']))); $node->book['link_title'] = $values['title']; $node->revision = 1; Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.524 diff -u -p -r1.524 book.module --- modules/book/book.module 8 Nov 2009 10:02:41 -0000 1.524 +++ modules/book/book.module 17 Nov 2009 14:35:34 -0000 @@ -478,7 +478,7 @@ function _book_add_form_elements(&$form, if (isset($node->nid) && ($nid == $node->book['original_bid']) && ($node->book['parent_depth_limit'] == 0)) { // This is the top level node in a maximum depth book and thus cannot be moved. - $options[$node->nid] = $node->title[FIELD_LANGUAGE_NONE][0]['value']; + $options[$node->nid] = $node->title[LANGUAGE_NONE][0]['value']; } else { foreach (book_get_books() as $book) { @@ -527,7 +527,7 @@ function _book_update_outline($node) { $new = empty($node->book['mlid']); $node->book['link_path'] = 'node/' . $node->nid; - $node->book['link_title'] = $node->title[FIELD_LANGUAGE_NONE][0]['value']; + $node->book['link_title'] = $node->title[LANGUAGE_NONE][0]['value']; $node->book['parent_mismatch'] = FALSE; // The normal case. if ($node->book['bid'] == $node->nid) { @@ -883,7 +883,7 @@ function book_form_node_delete_confirm_a if (isset($node->book) && $node->book['has_children']) { $form['book_warning'] = array( - '#markup' => '

' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])) . '

', + '#markup' => '

' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])) . '

', '#weight' => -10, ); } @@ -1106,7 +1106,7 @@ function book_node_export($node, $childr */ function template_preprocess_book_node_export_html(&$variables) { $variables['depth'] = $variables['node']->book['depth']; - $variables['title'] = check_plain($variables['node']->title[FIELD_LANGUAGE_NONE][0]['value']); + $variables['title'] = check_plain($variables['node']->title[LANGUAGE_NONE][0]['value']); $variables['content'] = $variables['node']->rendered; } Index: modules/book/book.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.pages.inc,v retrieving revision 1.21 diff -u -p -r1.21 book.pages.inc --- modules/book/book.pages.inc 8 Nov 2009 10:02:41 -0000 1.21 +++ modules/book/book.pages.inc 17 Nov 2009 14:35:34 -0000 @@ -79,7 +79,7 @@ function book_export_html($nid) { $contents = book_export_traverse($tree, 'book_node_export'); } - return theme('book_export_html', array('title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], 'contents' => $contents, 'depth' => $node->book['depth'])); + return theme('book_export_html', array('title' => $node->title[LANGUAGE_NONE][0]['value'], 'contents' => $contents, 'depth' => $node->book['depth'])); } else { drupal_access_denied(); @@ -90,7 +90,7 @@ function book_export_html($nid) { * Menu callback; show the outline form for a single node. */ function book_outline($node) { - drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); + drupal_set_title($node->title[LANGUAGE_NONE][0]['value']); return drupal_get_form('book_outline_form', $node); } @@ -188,7 +188,7 @@ function book_outline_form_submit($form, */ function book_remove_form($form, &$form_state, $node) { $form['#node'] = $node; - $title = array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']); + $title = array('%title' => $node->title[LANGUAGE_NONE][0]['value']); if ($node->book['has_children']) { $description = t('%title has associated child pages, which will be relocated automatically to maintain their connection to the book. To recreate the hierarchy (as it was before removing this page), %title may be added again using the Outline tab, and each of its former child pages will need to be relocated manually.', $title); Index: modules/book/book.test =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.test,v retrieving revision 1.20 diff -u -p -r1.20 book.test --- modules/book/book.test 8 Nov 2009 10:02:41 -0000 1.20 +++ modules/book/book.test 17 Nov 2009 14:35:34 -0000 @@ -110,7 +110,7 @@ class BookTestCase extends DrupalWebTest // Check previous, up, and next links. if ($previous) { - $this->assertRaw(l('‹ ' . $previous->title[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $previous->nid, array('attributes' => array('class' => array('page-previous'), 'title' => t('Go to previous page')))), t('Previous page link found.')); + $this->assertRaw(l('‹ ' . $previous->title[LANGUAGE_NONE][0]['value'], 'node/' . $previous->nid, array('attributes' => array('class' => array('page-previous'), 'title' => t('Go to previous page')))), t('Previous page link found.')); } if ($up) { @@ -118,7 +118,7 @@ class BookTestCase extends DrupalWebTest } if ($next) { - $this->assertRaw(l($next->title[FIELD_LANGUAGE_NONE][0]['value'] . ' ›', 'node/' . $next->nid, array('attributes' => array('class' => array('page-next'), 'title' => t('Go to next page')))), t('Next page link found.')); + $this->assertRaw(l($next->title[LANGUAGE_NONE][0]['value'] . ' ›', 'node/' . $next->nid, array('attributes' => array('class' => array('page-next'), 'title' => t('Go to next page')))), t('Next page link found.')); } // Compute the expected breadcrumb. @@ -140,8 +140,8 @@ class BookTestCase extends DrupalWebTest // Check printer friendly version. $this->drupalGet('book/export/html/' . $node->nid); - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Printer friendly title found.')); - $this->assertRaw(check_markup($node->body[FIELD_LANGUAGE_NONE][0]['value'], $node->body[FIELD_LANGUAGE_NONE][0]['format']), t('Printer friendly body found.')); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Printer friendly title found.')); + $this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'], $node->body[LANGUAGE_NONE][0]['format']), t('Printer friendly body found.')); $number++; } @@ -154,7 +154,7 @@ class BookTestCase extends DrupalWebTest function generateOutlinePattern($nodes) { $outline = ''; foreach ($nodes as $node) { - $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->title[FIELD_LANGUAGE_NONE][0]['value'] . ')(.*?)'; + $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->title[LANGUAGE_NONE][0]['value'] . ')(.*?)'; } return '/
/s'; @@ -172,7 +172,7 @@ class BookTestCase extends DrupalWebTest static $number = 0; // Used to ensure that when sorted nodes stay in same order. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $number . ' - SimpleTest test node ' . $this->randomName(10); $edit["body[$langcode][0][value]"] = 'SimpleTest test body ' . $this->randomName(32) . ' ' . $this->randomName(32); $edit['book[bid]'] = $book_nid; Index: modules/comment/comment.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.pages.inc,v retrieving revision 1.29 diff -u -p -r1.29 comment.pages.inc --- modules/comment/comment.pages.inc 8 Nov 2009 10:02:41 -0000 1.29 +++ modules/comment/comment.pages.inc 17 Nov 2009 14:35:34 -0000 @@ -29,7 +29,7 @@ */ function comment_reply($node, $pid = NULL) { // Set the breadcrumb trail. - drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $node->nid))); + drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title[LANGUAGE_NONE][0]['value'], 'node/' . $node->nid))); $op = isset($_POST['op']) ? $_POST['op'] : ''; $build = array(); Index: modules/comment/comment.tokens.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.tokens.inc,v retrieving revision 1.6 diff -u -p -r1.6 comment.tokens.inc --- modules/comment/comment.tokens.inc 16 Oct 2009 20:40:05 -0000 1.6 +++ modules/comment/comment.tokens.inc 17 Nov 2009 14:35:34 -0000 @@ -209,7 +209,7 @@ function comment_tokens($type, $tokens, case 'node': $node = node_load($comment->nid); - $title = $node->title[FIELD_LANGUAGE_NONE][0]['value']; + $title = $node->title[LANGUAGE_NONE][0]['value']; $replacements[$original] = $sanitize ? filter_xss($title) : $title; break; } Index: modules/dblog/dblog.test =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.test,v retrieving revision 1.29 diff -u -p -r1.29 dblog.test --- modules/dblog/dblog.test 11 Oct 2009 03:07:18 -0000 1.29 +++ modules/dblog/dblog.test 17 Nov 2009 14:35:34 -0000 @@ -266,7 +266,7 @@ class DBLogTestCase extends DrupalWebTes // Create node using form to generate add content event (which is not triggered by drupalCreateNode). $edit = $this->getContent($type); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $title = $edit["title[$langcode][0][value]"]; $this->drupalPost('node/add/' . $type, $edit, t('Save')); $this->assertResponse(200); @@ -321,7 +321,7 @@ class DBLogTestCase extends DrupalWebTes * @return array Content. */ private function getContent($type) { - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; switch ($type) { case 'poll': $content = array( @@ -357,7 +357,7 @@ class DBLogTestCase extends DrupalWebTes break; default: - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $content = array( "body[$langcode][0][value]" => $this->randomName(32), ); Index: modules/field/field.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v retrieving revision 1.50 diff -u -p -r1.50 field.api.php --- modules/field/field.api.php 12 Nov 2009 21:03:36 -0000 1.50 +++ modules/field/field.api.php 17 Nov 2009 14:35:34 -0000 @@ -1360,7 +1360,7 @@ function hook_field_storage_pre_insert($ foreach ($language as $delta) { $query->values(array( 'nid' => $object->nid, - 'title' => $object->title[FIELD_LANGUAGE_NONE][0]['value'], + 'title' => $object->title[LANGUAGE_NONE][0]['value'], 'tid' => $delta['value'], 'sticky' => $object->sticky, 'created' => $object->created, Index: modules/field/field.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.module,v retrieving revision 1.47 diff -u -p -r1.47 field.module --- modules/field/field.module 31 Oct 2009 18:00:48 -0000 1.47 +++ modules/field/field.module 17 Nov 2009 14:34:57 -0000 @@ -70,13 +70,6 @@ module_load_include('inc', 'field', 'fie define('FIELD_CARDINALITY_UNLIMITED', -1); /** - * The language code assigned to untranslatable fields. - * - * Defined by ISO639-2 for "No linguistic content / Not applicable". - */ -define('FIELD_LANGUAGE_NONE', 'zxx'); - -/** * TODO */ define('FIELD_BEHAVIOR_NONE', 0x0001); Index: modules/field/field.multilingual.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.multilingual.inc,v retrieving revision 1.4 diff -u -p -r1.4 field.multilingual.inc --- modules/field/field.multilingual.inc 31 Oct 2009 16:06:35 -0000 1.4 +++ modules/field/field.multilingual.inc 17 Nov 2009 14:35:34 -0000 @@ -18,7 +18,7 @@ function field_multilingual_settings_cha * * If an entity has a translation handler and the given field is translatable, * a (not necessarily strict) subset of the current enabled languages will be - * returned, otherwise only FIELD_LANGUAGE_NONE will be returned. Since the + * returned, otherwise only LANGUAGE_NONE will be returned. Since the * default value for a 'translatable' entity property is FALSE, we ensure that * only entities that are able to handle translations actually get translatable * fields. @@ -58,7 +58,7 @@ function field_multilingual_available_la } } else { - $result = $field_languages[$field_name] = array(FIELD_LANGUAGE_NONE); + $result = $field_languages[$field_name] = array(LANGUAGE_NONE); } } else { @@ -71,13 +71,13 @@ function field_multilingual_available_la /** * Return available content languages. * - * The languages that may be associated to fields include FIELD_LANGAUGE_NONE. + * The languages that may be associated to fields include LANGUAGE_NONE. * * @return * An array of language codes. */ function field_multilingual_content_languages() { - return array_keys(language_list() + array(FIELD_LANGUAGE_NONE => NULL)); + return array_keys(language_list() + array(LANGUAGE_NONE => NULL)); } /** @@ -132,12 +132,6 @@ function field_multilingual_valid_langua if (in_array($langcode, $enabled_languages)) { return $langcode; } - // @todo Currently, node language neutral code is an empty string. Node passes - // $node->language as language parameter to field_attach_form(). We might - // want to unify the two "language neutral" language codes. - if ($langcode === '') { - return FIELD_LANGUAGE_NONE; - } global $language; $langcode = $default ? language_default('language') : $language->language; if (in_array($langcode, $enabled_languages)) { Index: modules/field/field.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.test,v retrieving revision 1.67 diff -u -p -r1.67 field.test --- modules/field/field.test 12 Nov 2009 20:07:06 -0000 1.67 +++ modules/field/field.test 17 Nov 2009 14:35:34 -0000 @@ -97,7 +97,7 @@ class FieldAttachStorageTestCase extends // field_test_field_load() in field_test.module). $this->instance['settings']['test_hook_field_load'] = TRUE; field_update_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $entity_type = 'test_entity'; $values = array(); @@ -154,7 +154,7 @@ class FieldAttachStorageTestCase extends */ function testFieldAttachLoadMultiple() { $entity_type = 'test_entity'; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Define 2 bundles. $bundles = array( @@ -230,7 +230,7 @@ class FieldAttachStorageTestCase extends */ function testFieldAttachSaveLoadDifferentStorage() { $entity_type = 'test_entity'; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Create two fields using different storage backends, and their instances. $fields = array( @@ -324,7 +324,7 @@ class FieldAttachStorageTestCase extends function testFieldAttachSaveMissingData() { $entity_type = 'test_entity'; $entity_init = field_test_create_stub_entity(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Insert: Field is missing. $entity = clone($entity_init); @@ -406,7 +406,7 @@ class FieldAttachStorageTestCase extends $entity_type = 'test_entity'; $entity_init = field_test_create_stub_entity(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Insert: Field is NULL. $entity = clone($entity_init); @@ -433,7 +433,7 @@ class FieldAttachStorageTestCase extends */ function testFieldAttachDelete() { $entity_type = 'test_entity'; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $rev[0] = field_test_create_stub_entity(0, 0, $this->instance['bundle']); // Create revision 0 @@ -498,7 +498,7 @@ class FieldAttachStorageTestCase extends // Save an object with data in the field. $entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $values = $this->_generateTestFieldValues($this->field['cardinality']); $entity->{$this->field_name}[$langcode] = $values; $entity_type = 'test_entity'; @@ -557,7 +557,7 @@ class FieldAttachStorageTestCase extends // Save an object with data for both fields $entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $values = $this->_generateTestFieldValues($this->field['cardinality']); $entity->{$this->field_name}[$langcode] = $values; $entity->{$field_name}[$langcode] = $this->_generateTestFieldValues(1); @@ -589,7 +589,7 @@ class FieldAttachStorageTestCase extends */ function testFieldAttachQuery() { $cardinality = $this->field['cardinality']; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Create an additional bundle with an instance of the field. field_test_create_bundle('test_bundle_1', 'Test Bundle 1'); @@ -740,7 +740,7 @@ class FieldAttachStorageTestCase extends // Create first object revision with random (distinct) values. $entity_type = 'test_entity'; $entities = array(1 => field_test_create_stub_entity(1, 1), 2 => field_test_create_stub_entity(1, 2)); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $values = array(); for ($delta = 0; $delta < $cardinality; $delta++) { do { @@ -812,7 +812,7 @@ class FieldAttachOtherTestCase extends F function testFieldAttachView() { $entity_type = 'test_entity'; $entity_init = field_test_create_stub_entity(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Populate values to be displayed. $values = $this->_generateTestFieldValues($this->field['cardinality']); @@ -937,7 +937,7 @@ class FieldAttachOtherTestCase extends F function testFieldAttachCache() { // Initialize random values and a test entity. $entity_init = field_test_create_stub_entity(1, 1, $this->instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $values = $this->_generateTestFieldValues($this->field['cardinality']); // Non-cacheable entity type. @@ -1029,7 +1029,7 @@ class FieldAttachOtherTestCase extends F function testFieldAttachValidate() { $entity_type = 'test_entity'; $entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Set up values to generate errors $values = array(); @@ -1074,7 +1074,7 @@ class FieldAttachOtherTestCase extends F $form = $form_state = array(); field_attach_form($entity_type, $entity, $form, $form_state); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $this->assertEqual($form[$this->field_name][$langcode]['#title'], $this->instance['label'], "Form title is {$this->instance['label']}"); for ($delta = 0; $delta < $this->field['cardinality']; $delta++) { // field_test_widget uses 'textfield' @@ -1108,7 +1108,7 @@ class FieldAttachOtherTestCase extends F // Leave an empty value. 'field_test' fields are empty if empty(). $values[1]['value'] = 0; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $form_state['values'] = array($this->field_name => array($langcode => $values)); field_attach_submit($entity_type, $entity, $form, $form_state); @@ -1373,7 +1373,7 @@ class FieldFormTestCase extends FieldTes $this->instance['field_name'] = $this->field_name; field_create_field($this->field); field_create_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Display creation form. $this->drupalGet('test-entity/add/test-bundle'); @@ -1427,7 +1427,7 @@ class FieldFormTestCase extends FieldTes $this->instance['required'] = TRUE; field_create_field($this->field); field_create_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Submit with missing required value. $edit = array(); @@ -1465,7 +1465,7 @@ class FieldFormTestCase extends FieldTes $this->instance['field_name'] = $this->field_name; field_create_field($this->field); field_create_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Display creation form -> 1 widget. $this->drupalGet('test-entity/add/test-bundle'); @@ -1546,7 +1546,7 @@ class FieldFormTestCase extends FieldTes $this->instance['field_name'] = $this->field_name; field_create_field($this->field); field_create_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Display creation form -> 1 widget. $this->drupalGet('test-entity/add/test-bundle'); @@ -1914,7 +1914,7 @@ class FieldCrudTestCase extends FieldTes // Save an object with data for the field $entity = field_test_create_stub_entity(0, 0, $instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $values[0]['value'] = mt_rand(1, 127); $entity->{$field['field_name']}[$langcode] = $values; $entity_type = 'test_entity'; @@ -1970,17 +1970,17 @@ class FieldCrudTestCase extends FieldTes // Save values with 2, 3, and 4 decimal places. $entity = field_test_create_stub_entity(0, 0, $instance['bundle']); - $entity->decimal53[FIELD_LANGUAGE_NONE][0]['value'] = '1.23'; - $entity->decimal53[FIELD_LANGUAGE_NONE][1]['value'] = '1.235'; - $entity->decimal53[FIELD_LANGUAGE_NONE][2]['value'] = '1.2355'; + $entity->decimal53[LANGUAGE_NONE][0]['value'] = '1.23'; + $entity->decimal53[LANGUAGE_NONE][1]['value'] = '1.235'; + $entity->decimal53[LANGUAGE_NONE][2]['value'] = '1.2355'; field_attach_insert('test_entity', $entity); $entity = field_test_create_stub_entity(0, 0, $instance['bundle']); // Verify that the updated 5.3 field rounds to 3 decimal places. field_attach_load('test_entity', array(0 => $entity)); - $this->assertEqual($entity->decimal53[FIELD_LANGUAGE_NONE][0]['value'], '1.23', t('2 decimal places are left alone')); - $this->assertEqual($entity->decimal53[FIELD_LANGUAGE_NONE][1]['value'], '1.235', t('3 decimal places are left alone')); - $this->assertEqual($entity->decimal53[FIELD_LANGUAGE_NONE][2]['value'], '1.236', t('4 decimal places are rounded to 3')); + $this->assertEqual($entity->decimal53[LANGUAGE_NONE][0]['value'], '1.23', t('2 decimal places are left alone')); + $this->assertEqual($entity->decimal53[LANGUAGE_NONE][1]['value'], '1.235', t('3 decimal places are left alone')); + $this->assertEqual($entity->decimal53[LANGUAGE_NONE][2]['value'], '1.236', t('4 decimal places are rounded to 3')); } /** @@ -2330,7 +2330,7 @@ class FieldTranslationsTestCase extends $langcode = language_default(); $suggested_languages = array($langcode->language); $available_languages = field_multilingual_available_languages($this->obj_type, $field, $suggested_languages); - $this->assertTrue(count($available_languages) == 1 && $available_languages[0] === FIELD_LANGUAGE_NONE, t('Untranslatable entity: suggested language ignored.')); + $this->assertTrue(count($available_languages) == 1 && $available_languages[0] === LANGUAGE_NONE, t('Untranslatable entity: suggested language ignored.')); // Enable field translations for the entity. field_test_entity_info_translatable('test_entity', TRUE); @@ -2339,9 +2339,9 @@ class FieldTranslationsTestCase extends $this->field['settings']['test_hook_in'] = TRUE; $enabled_languages = array_keys(language_list()); $available_languages = field_multilingual_available_languages($this->obj_type, $this->field); - $this->assertTrue(in_array(FIELD_LANGUAGE_NONE, $available_languages), t('%language is an available language.', array('%language' => FIELD_LANGUAGE_NONE))); + $this->assertTrue(in_array(LANGUAGE_NONE, $available_languages), t('%language is an available language.', array('%language' => LANGUAGE_NONE))); foreach ($available_languages as $delta => $langcode) { - if ($langcode != FIELD_LANGUAGE_NONE) { + if ($langcode != LANGUAGE_NONE) { $this->assertTrue(in_array($langcode, $enabled_languages), t('%language is an enabled language.', array('%language' => $langcode))); } } @@ -2352,7 +2352,7 @@ class FieldTranslationsTestCase extends $this->field['translatable'] = FALSE; $this->field_name = $this->field['field_name'] = $this->instance['field_name'] = drupal_strtolower($this->randomName() . '_field_name'); $available_languages = field_multilingual_available_languages($this->obj_type, $this->field); - $this->assertTrue(count($available_languages) == 1 && $available_languages[0] === FIELD_LANGUAGE_NONE, t('For untranslatable fields only neutral language is available.')); + $this->assertTrue(count($available_languages) == 1 && $available_languages[0] === LANGUAGE_NONE, t('For untranslatable fields only neutral language is available.')); // Test language suggestions. $this->field['settings']['test_hook_in'] = FALSE; @@ -2577,7 +2577,7 @@ class FieldBulkDeleteTestCase extends Fi for ($i = 0; $i < 10; $i++) { $entity = field_test_create_stub_entity($id, $id, $bundle); foreach ($this->fields as $field) { - $entity->{$field['field_name']}[FIELD_LANGUAGE_NONE] = $this->_generateTestFieldValues($field['cardinality']); + $entity->{$field['field_name']}[LANGUAGE_NONE] = $this->_generateTestFieldValues($field['cardinality']); } $this->entities[$id] = $entity; field_attach_insert($this->entity_type, $entity); Index: modules/field/modules/field_sql_storage/field_sql_storage.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/field_sql_storage/field_sql_storage.test,v retrieving revision 1.13 diff -u -p -r1.13 field_sql_storage.test --- modules/field/modules/field_sql_storage/field_sql_storage.test 10 Nov 2009 17:27:53 -0000 1.13 +++ modules/field/modules/field_sql_storage/field_sql_storage.test 17 Nov 2009 14:35:34 -0000 @@ -57,7 +57,7 @@ class FieldSqlStorageTestCase extends Dr function testFieldAttachLoad() { $entity_type = 'test_entity'; $eid = 0; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $etid = _field_sql_storage_etid($entity_type); $columns = array('etid', 'entity_id', 'revision_id', 'delta', 'language', $this->field_name . '_value'); @@ -126,7 +126,7 @@ class FieldSqlStorageTestCase extends Dr function testFieldAttachInsertAndUpdate() { $entity_type = 'test_entity'; $entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Test insert. $values = array(); @@ -207,7 +207,7 @@ class FieldSqlStorageTestCase extends Dr function testFieldAttachSaveMissingData() { $entity_type = 'test_entity'; $entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Insert: Field is missing field_attach_insert($entity_type, $entity); @@ -306,7 +306,7 @@ class FieldSqlStorageTestCase extends Dr $instance = array('field_name' => 'decimal52', 'object_type' => 'test_entity', 'bundle' => FIELD_TEST_BUNDLE); $instance = field_create_instance($instance); $entity = field_test_create_stub_entity(0, 0, $instance['bundle']); - $entity->decimal52[FIELD_LANGUAGE_NONE][0]['value'] = '1.235'; + $entity->decimal52[LANGUAGE_NONE][0]['value'] = '1.235'; field_attach_insert('test_entity', $entity); // Attempt to update the field in a way that would work without data. @@ -344,7 +344,7 @@ class FieldSqlStorageTestCase extends Dr // Add data so the table cannot be dropped. $entity = field_test_create_stub_entity(0, 0, $instance['bundle']); - $entity->{$field_name}[FIELD_LANGUAGE_NONE][0]['value'] = 'field data'; + $entity->{$field_name}[LANGUAGE_NONE][0]['value'] = 'field data'; field_attach_insert('test_entity', $entity); // Add an index @@ -367,7 +367,7 @@ class FieldSqlStorageTestCase extends Dr // Verify that the tables were not dropped. $entity = field_test_create_stub_entity(0, 0, $instance['bundle']); field_attach_load('test_entity', array(0 => $entity)); - $this->assertEqual($entity->{$field_name}[FIELD_LANGUAGE_NONE][0]['value'], 'field data', t("Index changes performed without dropping the tables")); + $this->assertEqual($entity->{$field_name}[LANGUAGE_NONE][0]['value'], 'field data', t("Index changes performed without dropping the tables")); } } Index: modules/field/modules/list/list.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.test,v retrieving revision 1.1 diff -u -p -r1.1 list.test --- modules/field/modules/list/list.test 18 Oct 2009 18:46:11 -0000 1.1 +++ modules/field/modules/list/list.test 17 Nov 2009 14:35:34 -0000 @@ -42,28 +42,28 @@ class ListFieldTestCase extends DrupalWe // All three options appear. $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][1]), t('Option 1 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][3]), t('Option 3 exists')); // Removed options do not appear. $this->card_1['settings']['allowed_values'] = "2|Two"; field_update_field($this->card_1); $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 does not exist')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 does not exist')); + $this->assertTrue(empty($form['card_1'][LANGUAGE_NONE]['value'][1]), t('Option 1 does not exist')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); + $this->assertTrue(empty($form['card_1'][LANGUAGE_NONE]['value'][3]), t('Option 3 does not exist')); // Completely new options appear. $this->card_1['settings']['allowed_values'] = "10|Update\n20|Twenty"; field_update_field($this->card_1); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 does not exist')); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 does not exist')); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 does not exist')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][10]), t('Option 10 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][20]), t('Option 20 exists')); + $this->assertTrue(empty($form['card_1'][LANGUAGE_NONE]['value'][1]), t('Option 1 does not exist')); + $this->assertTrue(empty($form['card_1'][LANGUAGE_NONE]['value'][2]), t('Option 2 does not exist')); + $this->assertTrue(empty($form['card_1'][LANGUAGE_NONE]['value'][3]), t('Option 3 does not exist')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][10]), t('Option 10 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][20]), t('Option 20 exists')); // Options are reset when a new field with the same name is created. field_delete_field($this->card_1['field_name']); @@ -81,9 +81,9 @@ class ListFieldTestCase extends DrupalWe $this->instance_1 = field_create_instance($this->instance_1); $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][1]), t('Option 1 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); + $this->assertTrue(!empty($form['card_1'][LANGUAGE_NONE]['value'][3]), t('Option 3 exists')); } } Index: modules/field/modules/options/options.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/options/options.test,v retrieving revision 1.3 diff -u -p -r1.3 options.test --- modules/field/modules/options/options.test 10 Nov 2009 17:27:53 -0000 1.3 +++ modules/field/modules/options/options.test 17 Nov 2009 14:35:34 -0000 @@ -123,7 +123,7 @@ class OptionsWidgetsTestCase extends Dru $this->assertIsNotChecked($render, 'edit-card-1-zxx-value-3'); // With field data, the selected button is checked. - $entity->card_1[FIELD_LANGUAGE_NONE][0]['value'] = '2'; + $entity->card_1[LANGUAGE_NONE][0]['value'] = '2'; $form = drupal_get_form('field_test_entity_form', $entity); $render = drupal_render($form); $this->assertIsNotChecked($render, 'edit-card-1-zxx-value-1'); @@ -161,8 +161,8 @@ class OptionsWidgetsTestCase extends Dru $this->assertIsNotChecked($render, 'edit-card-2-zxx-value-3'); // With field data, the specified items are checked. - $entity->card_2[FIELD_LANGUAGE_NONE][0]['value'] = '2'; - $entity->card_2[FIELD_LANGUAGE_NONE][1]['value'] = '3'; + $entity->card_2[LANGUAGE_NONE][0]['value'] = '2'; + $entity->card_2[LANGUAGE_NONE][1]['value'] = '3'; $form = drupal_get_form('field_test_entity_form', $entity); $render = drupal_render($form); $this->assertIsNotChecked($render, 'edit-card-2-zxx-value-1'); @@ -201,8 +201,8 @@ class OptionsWidgetsTestCase extends Dru $this->assertIsNotSelected($render, 3); // With field data, the specified options are selected. - $entity->card_2[FIELD_LANGUAGE_NONE][0]['value'] = '2'; - $entity->card_2[FIELD_LANGUAGE_NONE][1]['value'] = '1'; + $entity->card_2[LANGUAGE_NONE][0]['value'] = '2'; + $entity->card_2[LANGUAGE_NONE][1]['value'] = '1'; $form = drupal_get_form('field_test_entity_form', $entity); $render = drupal_render($form); $this->assertIsSelected($render, 1); @@ -211,13 +211,13 @@ class OptionsWidgetsTestCase extends Dru // A non-required select list has an empty key. $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(isset($form['card_2'][FIELD_LANGUAGE_NONE]['value']['#options']['']), 'A non-required select list has an empty key.'); + $this->assertTrue(isset($form['card_2'][LANGUAGE_NONE]['value']['#options']['']), 'A non-required select list has an empty key.'); // A required select list does not have an empty key. $instance['required'] = TRUE; field_update_instance($instance); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(!isset($form['card_2'][FIELD_LANGUAGE_NONE]['value']['#options']['']), 'A required select list does not have an empty key.'); + $this->assertTrue(!isset($form['card_2'][LANGUAGE_NONE]['value']['#options']['']), 'A required select list does not have an empty key.'); // We don't have to test that a required select list with one // option is auto-selected because the browser does it for us. Index: modules/field/modules/text/text.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.test,v retrieving revision 1.14 diff -u -p -r1.14 text.test --- modules/field/modules/text/text.test 16 Oct 2009 03:47:14 -0000 1.14 +++ modules/field/modules/text/text.test 17 Nov 2009 14:35:34 -0000 @@ -54,7 +54,7 @@ class TextFieldTestCase extends DrupalWe field_create_instance($this->instance); // Test valid and invalid values with field_attach_validate(). $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; for ($i = 0; $i <= $max_length + 2; $i++) { $entity->{$this->field['field_name']}[$langcode][0]['value'] = str_repeat('x', $i); try { @@ -97,7 +97,7 @@ class TextFieldTestCase extends DrupalWe ) ); field_create_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Display creation form. $this->drupalGet('test-entity/add/test-bundle'); @@ -151,7 +151,7 @@ class TextFieldTestCase extends DrupalWe ) ); field_create_instance($this->instance); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; // Delete all text formats besides the plain text fallback format. $this->drupalLogin($this->admin_user); Index: modules/field_ui/field_ui.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v retrieving revision 1.29 diff -u -p -r1.29 field_ui.admin.inc --- modules/field_ui/field_ui.admin.inc 11 Nov 2009 06:58:24 -0000 1.29 +++ modules/field_ui/field_ui.admin.inc 17 Nov 2009 14:35:34 -0000 @@ -1228,7 +1228,7 @@ function field_ui_default_value_widget($ ); function_exists('field_default_form'); // @todo Allow multiple values (requires more work on 'add more' JS handler). - $widget_form = field_default_form(NULL, NULL, $field, $instance, FIELD_LANGUAGE_NONE, $items, $form, $form_state, 0); + $widget_form = field_default_form(NULL, NULL, $field, $instance, LANGUAGE_NONE, $items, $form, $form_state, 0); $form['instance']['default_value_widget'] += $widget_form; $form['#fields'][$field['field_name']]['form_path'] = array( 'instance', Index: modules/file/tests/file.test =================================================================== RCS file: /cvs/drupal/drupal/modules/file/tests/file.test,v retrieving revision 1.7 diff -u -p -r1.7 file.test --- modules/file/tests/file.test 10 Nov 2009 17:27:53 -0000 1.7 +++ modules/file/tests/file.test 17 Nov 2009 14:35:34 -0000 @@ -88,7 +88,7 @@ class FileFieldTestCase extends DrupalWe * Upload a file to a node. */ function uploadNodeFile($file, $field_name, $nid_or_type, $new_revision = TRUE) { - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit = array( "title[$langcode][0][value]" => $this->randomName(), 'revision' => (string) (int) $new_revision, @@ -97,11 +97,11 @@ class FileFieldTestCase extends DrupalWe if (is_numeric($nid_or_type)) { $node = node_load($nid_or_type); $delta = isset($node->$field_name) ? count($node->$field_name) : 0; - $edit['files[' . $field_name . '_' . FIELD_LANGUAGE_NONE . '_' . $delta . ']'] = realpath($file->uri); + $edit['files[' . $field_name . '_' . LANGUAGE_NONE . '_' . $delta . ']'] = realpath($file->uri); $this->drupalPost('node/' . $nid_or_type . '/edit', $edit, t('Save')); } else { - $edit['files[' . $field_name . '_' . FIELD_LANGUAGE_NONE . '_0]'] = realpath($file->uri); + $edit['files[' . $field_name . '_' . LANGUAGE_NONE . '_0]'] = realpath($file->uri); $type_name = str_replace('_', '-', $nid_or_type); $this->drupalPost('node/add/' . $type_name, $edit, t('Save')); } @@ -130,7 +130,7 @@ class FileFieldTestCase extends DrupalWe */ function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) { $edit = array( - 'files[' . $field_name . '_' . FIELD_LANGUAGE_NONE . '_0]' => realpath($file->uri), + 'files[' . $field_name . '_' . LANGUAGE_NONE . '_0]' => realpath($file->uri), 'revision' => (string) (int) $new_revision, ); @@ -211,7 +211,7 @@ class FileFieldRevisionTestCase extends // Check that the file exists on disk and in the database. $node = node_load($nid, NULL, TRUE); - $node_file_r1 = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file_r1 = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $node_vid_r1 = $node->vid; $this->assertFileExists($node_file_r1, t('New file saved to disk on node creation.')); $this->assertFileEntryExists($node_file_r1, t('File entry exists in database on node creation.')); @@ -219,14 +219,14 @@ class FileFieldRevisionTestCase extends // Upload another file to the same node in a new revision. $this->replaceNodeFile($test_file, $field_name, $nid); $node = node_load($nid, NULL, TRUE); - $node_file_r2 = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file_r2 = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $node_vid_r2 = $node->vid; $this->assertFileExists($node_file_r2, t('Replacement file exists on disk after creating new revision.')); $this->assertFileEntryExists($node_file_r2, t('Replacement file entry exists in database after creating new revision.')); // Check that the original file is still in place on the first revision. $node = node_load($nid, $node_vid_r1, TRUE); - $this->assertEqual($node_file_r1, (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0], t('Original file still in place after replacing file in new revision.')); + $this->assertEqual($node_file_r1, (object) $node->{$field_name}[LANGUAGE_NONE][0], t('Original file still in place after replacing file in new revision.')); $this->assertFileExists($node_file_r1, t('Original file still in place after replacing file in new revision.')); $this->assertFileEntryExists($node_file_r1, t('Original file entry still in place after replacing file in new revision')); @@ -234,14 +234,14 @@ class FileFieldRevisionTestCase extends // Check that the file is still the same as the previous revision. $this->drupalPost('node/' . $nid . '/edit', array('revision' => '1'), t('Save')); $node = node_load($nid, NULL, TRUE); - $node_file_r3 = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file_r3 = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $node_vid_r3 = $node->vid; $this->assertEqual($node_file_r2, $node_file_r3, t('Previous revision file still in place after creating a new revision without a new file.')); // Revert to the first revision and check that the original file is active. $this->drupalPost('node/' . $nid . '/revisions/' . $node_vid_r1 . '/revert', array(), t('Revert')); $node = node_load($nid, NULL, TRUE); - $node_file_r4 = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file_r4 = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $node_vid_r4 = $node->vid; $this->assertEqual($node_file_r1, $node_file_r4, t('Original revision file still in place after reverting to the original revision.')); @@ -305,12 +305,12 @@ class FileFieldDisplayTestCase extends F // Check that the default formatter is displaying with the file name. $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $default_output = theme('file_link', array('file' => $node_file)); $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.')); // Turn the "display" option off and check that the file is no longer displayed. - $edit = array($field_name . '[' . FIELD_LANGUAGE_NONE . '][0][display]' => FALSE); + $edit = array($field_name . '[' . LANGUAGE_NONE . '][0][display]' => FALSE); $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save')); $this->assertNoRaw($default_output, t('Field is hidden when "display" option is unchecked.')); @@ -346,7 +346,7 @@ class FileFieldValidateTestCase extends $test_file = $this->getTestFile('text'); // Try to post a new node without uploading a file. - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit = array("title[$langcode][0][value]" => $this->randomName()); $this->drupalPost('node/add/' . $type_name, $edit, t('Save')); $this->assertRaw(t('!title field is required.', array('!title' => $instance['label'])), t('Node save failed when required file field was empty.')); @@ -355,7 +355,7 @@ class FileFieldValidateTestCase extends $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertFileExists($node_file, t('File exists after uploading to the required field.')); $this->assertFileEntryExists($node_file, t('File entry exists after uploading to the required field.')); @@ -371,7 +371,7 @@ class FileFieldValidateTestCase extends // Create a new node with the uploaded file into the multivalue field. $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertFileExists($node_file, t('File exists after uploading to the required multiple value field.')); $this->assertFileEntryExists($node_file, t('File entry exists after uploading to the required multipel value field.')); @@ -407,7 +407,7 @@ class FileFieldValidateTestCase extends // Create a new node with the small file, which should pass. $nid = $this->uploadNodeFile($small_file, $field_name, $type_name); $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertFileExists($node_file, t('File exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->filesize), '%maxsize' => $max_filesize))); $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->filesize), '%maxsize' => $max_filesize))); @@ -423,7 +423,7 @@ class FileFieldValidateTestCase extends // Upload the big file successfully. $nid = $this->uploadNodeFile($large_file, $field_name, $type_name); $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertFileExists($node_file, t('File exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->filesize)))); $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->filesize)))); @@ -450,7 +450,7 @@ class FileFieldValidateTestCase extends // Check that the file can be uploaded with no extension checking. $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertFileExists($node_file, t('File exists after uploading a file with no extension checking.')); $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file with no extension checking.')); @@ -468,7 +468,7 @@ class FileFieldValidateTestCase extends // Check that the file can be uploaded with extension checking. $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertFileExists($node_file, t('File exists after uploading a file with extension checking.')); $this->assertFileEntryExists($node_file, t('File entry exists after uploading a file with extension checking.')); @@ -503,7 +503,7 @@ class FileFieldPathTestCase extends File // Check that the file was uploaded to the file root. $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertPathMatch('public://' . $test_file->filename, $node_file->uri, t('The file %file was uploaded to the correct path.', array('%file' => $node_file->uri))); // Change the path to contain multiple subdirectories. @@ -514,7 +514,7 @@ class FileFieldPathTestCase extends File // Check that the file was uploaded into the subdirectory. $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $this->assertPathMatch('public://foo/bar/baz/' . $test_file->filename, $node_file->uri, t('The file %file was uploaded to the correct path.', array('%file' => $node_file->uri))); // Check the path when used with tokens. @@ -526,7 +526,7 @@ class FileFieldPathTestCase extends File // Check that the file was uploaded into the subdirectory. $node = node_load($nid, NULL, TRUE); - $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; + $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; $data = array('user' => $this->admin_user); $subdirectory = token_replace('[user:uid]/[user:name]', $data); $this->assertPathMatch('public://' . $subdirectory . '/' . $test_file->filename, $node_file->uri, t('The file %file was uploaded to the correct path with token replacements.', array('%file' => $node_file->uri))); Index: modules/filter/filter.test =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v retrieving revision 1.47 diff -u -p -r1.47 filter.test --- modules/filter/filter.test 10 Nov 2009 17:27:53 -0000 1.47 +++ modules/filter/filter.test 17 Nov 2009 14:35:34 -0000 @@ -274,7 +274,7 @@ class FilterAdminTestCase extends Drupal $text = $body . '' . $extra_text . ''; $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(); $edit["body[$langcode][0][value]"] = $text; $edit["body[$langcode][0][value_format]"] = $filtered; Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.533 diff -u -p -r1.533 forum.module --- modules/forum/forum.module 12 Nov 2009 20:30:22 -0000 1.533 +++ modules/forum/forum.module 17 Nov 2009 14:35:34 -0000 @@ -429,7 +429,7 @@ function forum_field_storage_pre_insert( foreach ($language as $delta) { $query->values(array( 'nid' => $object->nid, - 'title' => $object->title[FIELD_LANGUAGE_NONE][0]['value'], + 'title' => $object->title[LANGUAGE_NONE][0]['value'], 'tid' => $delta['value'], 'sticky' => $object->sticky, 'created' => $object->created, @@ -463,7 +463,7 @@ function forum_field_storage_pre_update( foreach ($language as $delta) { $query->values(array( 'nid' => $object->nid, - 'title' => $object->title[FIELD_LANGUAGE_NONE][0]['value'], + 'title' => $object->title[LANGUAGE_NONE][0]['value'], 'tid' => $delta['value'], 'sticky' => $object->sticky, 'created' => $object->created, Index: modules/forum/forum.test =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.test,v retrieving revision 1.40 diff -u -p -r1.40 forum.test --- modules/forum/forum.test 12 Nov 2009 20:30:22 -0000 1.40 +++ modules/forum/forum.test 17 Nov 2009 14:35:34 -0000 @@ -263,7 +263,7 @@ class ForumTestCase extends DrupalWebTes // select items list. $tid = $forum['tid']; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit = array( "title[$langcode][0][value]" => $title, "body[$langcode][0][value]" => $body, @@ -340,20 +340,20 @@ class ForumTestCase extends DrupalWebTes // View forum node. $this->drupalGet('node/' . $node->nid); $this->assertResponse(200); - $this->assertTitle($node->title[FIELD_LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Forum node was displayed')); + $this->assertTitle($node->title[LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Forum node was displayed')); $this->assertText(t('Home ' . $crumb . ' Forums ' . $crumb . ' @container ' . $crumb . ' @forum', array('@container' => $this->container['name'], '@forum' => $this->forum['name'])), t('Breadcrumbs were displayed')); // View forum edit node. $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertResponse($response); if ($response == 200) { - $this->assertTitle('Edit Forum topic ' . $node->title[FIELD_LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Forum edit node was displayed')); + $this->assertTitle('Edit Forum topic ' . $node->title[LANGUAGE_NONE][0]['value'] . ' | Drupal', t('Forum edit node was displayed')); } if ($response == 200) { // Edit forum node (including moving it to another forum). $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = 'node/' . $node->nid; $edit["body[$langcode][0][value]"] = $this->randomName(256); // Assume the topic is initially associated with $forum. Index: modules/locale/locale.field.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.field.inc,v retrieving revision 1.3 diff -u -p -r1.3 locale.field.inc --- modules/locale/locale.field.inc 2 Nov 2009 05:57:05 -0000 1.3 +++ modules/locale/locale.field.inc 17 Nov 2009 14:35:34 -0000 @@ -16,7 +16,7 @@ function locale_field_node_form_update_f $node = (object) $form_state['values']; $available_languages = field_multilingual_content_languages(); // @todo: Unify language neutral language codes. - $selected_language = empty($node->language) ? FIELD_LANGUAGE_NONE : $node->language; + $selected_language = empty($node->language) ? LANGUAGE_NONE : $node->language; list(, , $bundle) = entity_extract_ids('node', $node); foreach (field_info_instances('node', $bundle) as $instance) { Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.268 diff -u -p -r1.268 locale.module --- modules/locale/locale.module 10 Nov 2009 17:27:53 -0000 1.268 +++ modules/locale/locale.module 17 Nov 2009 14:35:34 -0000 @@ -415,7 +415,7 @@ function locale_form_alter(&$form, &$for '#type' => 'select', '#title' => t('Language'), '#default_value' => (isset($form['#node']->language) ? $form['#node']->language : ''), - '#options' => array('' => t('Language neutral')) + locale_language_list('name'), + '#options' => array(LANGUAGE_NONE => t('Language neutral')) + locale_language_list('name'), ); } // Node type without language selector: assign the default for new nodes Index: modules/locale/locale.test =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v retrieving revision 1.51 diff -u -p -r1.51 locale.test --- modules/locale/locale.test 10 Nov 2009 17:27:53 -0000 1.51 +++ modules/locale/locale.test 17 Nov 2009 14:35:34 -0000 @@ -1287,11 +1287,11 @@ class LocalePathFunctionalTest extends D // Confirm English language path alias works. $this->drupalGet($english_path); - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('English alias works.')); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('English alias works.')); // Confirm custom language path alias works. $this->drupalGet($prefix . '/' . $custom_language_path); - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Custom language alias works.')); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Custom language alias works.')); $this->drupalLogout(); } @@ -1398,7 +1398,7 @@ class LocaleContentFunctionalTest extend $node_body = $this->randomName(); $edit = array( 'type' => 'page', - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $node_title))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $node_title))), 'body' => array($langcode => array(array('value' => $node_body))), 'language' => $langcode, ); @@ -1657,7 +1657,7 @@ class LocaleMultilingualFieldsFunctional */ function testMultilingualNodeForm() { // Create page content. - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $title_key = "title[$langcode][0][value]"; $title_value = $this->randomName(8); $body_key = "body[$langcode][0][value]"; @@ -1674,7 +1674,7 @@ class LocaleMultilingualFieldsFunctional $node = $this->drupalGetNodeByTitle($edit[$title_key]); $this->assertTrue($node, t('Node found in database.')); - $assert = isset($node->body['en']) && !isset($node->body[FIELD_LANGUAGE_NONE]) && $node->body['en'][0]['value'] == $body_value; + $assert = isset($node->body['en']) && !isset($node->body[LANGUAGE_NONE]) && $node->body['en'][0]['value'] == $body_value; $this->assertTrue($assert, t('Field language correctly set.')); // Change node language. @@ -1696,7 +1696,7 @@ class LocaleMultilingualFieldsFunctional */ function testMultilingualDisplaySettings() { // Create page content. - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $title_key = "title[$langcode][0][value]"; $title_value = $this->randomName(8); $body_key = "body[$langcode][0][value]"; Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.217 diff -u -p -r1.217 menu.module --- modules/menu/menu.module 8 Nov 2009 10:02:41 -0000 1.217 +++ modules/menu/menu.module 17 Nov 2009 14:35:34 -0000 @@ -478,7 +478,7 @@ function menu_node_save($node) { $link['link_path'] = "node/$node->nid"; // If not already set, use the node's title as link title attribute. if (empty($link['options']['attributes']['title']) && !$link['customized']) { - $link['options']['attributes']['title'] = trim($node->title[FIELD_LANGUAGE_NONE][0]['value']); + $link['options']['attributes']['title'] = trim($node->title[LANGUAGE_NONE][0]['value']); } if (!menu_link_save($link)) { drupal_set_message(t('There was an error saving the menu link.'), 'error'); Index: modules/menu/menu.test =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.test,v retrieving revision 1.26 diff -u -p -r1.26 menu.test --- modules/menu/menu.test 10 Nov 2009 17:27:53 -0000 1.26 +++ modules/menu/menu.test 17 Nov 2009 14:35:34 -0000 @@ -315,7 +315,7 @@ class MenuTestCase extends DrupalWebTest // Verify menu link link. $this->clickLink($title); - $title = $parent_node->title[FIELD_LANGUAGE_NONE][0]['value']; + $title = $parent_node->title[LANGUAGE_NONE][0]['value']; $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Parent menu link link target was correct')); } @@ -325,7 +325,7 @@ class MenuTestCase extends DrupalWebTest // Verify menu link link. $this->clickLink($title); - $title = $item_node->title[FIELD_LANGUAGE_NONE][0]['value']; + $title = $item_node->title[LANGUAGE_NONE][0]['value']; $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Menu link link target was correct')); } Index: modules/node/node.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v retrieving revision 1.78 diff -u -p -r1.78 node.admin.inc --- modules/node/node.admin.inc 17 Nov 2009 02:50:41 -0000 1.78 +++ modules/node/node.admin.inc 17 Nov 2009 14:35:34 -0000 @@ -108,7 +108,7 @@ function node_filters() { } // Language filter if there is a list of languages if ($languages = module_invoke('locale', 'language_list')) { - $languages = array('' => t('Language neutral')) + $languages; + $languages = array(LANGUAGE_NONE => t('Language neutral')) + $languages; $filters['language'] = array( 'title' => t('language'), 'options' => array( @@ -169,7 +169,7 @@ function node_filter_form() { $value = $value->name; } elseif ($type == 'language') { - $value = empty($value) ? t('Language neutral') : module_invoke('locale', 'language_name', $value); + $value = $value == LANGUAGE_NONE ? t('Language neutral') : module_invoke('locale', 'language_name', $value); } else { $value = $filters[$type]['options'][$value]; @@ -356,7 +356,7 @@ function _node_mass_update_batch_process $node = _node_mass_update_helper($nid, $updates); // Store result for post-processing in the finished callback. - $context['results'][] = l($node->title[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $node->nid); + $context['results'][] = l($node->title[LANGUAGE_NONE][0]['value'], 'node/' . $node->nid); // Update our progress information. $context['sandbox']['progress']++; @@ -436,7 +436,7 @@ function node_admin_nodes() { // Enable language column if translation module is enabled // or if we have any node with language. - $multilanguage = (module_exists('translation') || db_query("SELECT COUNT(*) FROM {node} WHERE language <> ''")->fetchField()); + $multilanguage = (module_exists('translation') || db_query("SELECT COUNT(*) FROM {node} WHERE language <> '%s'", array(LANGUAGE_NONE))->fetchField()); // Build the sortable table header. $header = array( @@ -482,12 +482,12 @@ function node_admin_nodes() { $destination = drupal_get_destination(); $options = array(); foreach ($nodes as $node) { - $l_options = !empty($node->language) ? array('language' => $languages[$node->language]) : array(); + $l_options = $node->language != LANGUAGE_NONE ? array('language' => $languages[$node->language]) : array(); $options[$node->nid] = array( 'title' => array( 'data' => array( '#type' => 'link', - '#title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], + '#title' => $node->title[LANGUAGE_NONE][0]['value'], '#href' => 'node/' . $node->nid, '#options' => $l_options, '#suffix' => ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))), @@ -499,7 +499,7 @@ function node_admin_nodes() { 'changed' => format_date($node->changed, 'short'), ); if ($multilanguage) { - $options[$node->nid]['language'] = empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name); + $options[$node->nid]['language'] = $node->language == LANGUAGE_NONE ? t('Language neutral') : t($languages[$node->language]->name); } // Build a list of all the accessible operations for the current node. $operations = array(); Index: modules/node/node.install =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.install,v retrieving revision 1.35 diff -u -p -r1.35 node.install --- modules/node/node.install 14 Nov 2009 07:58:49 -0000 1.35 +++ modules/node/node.install 17 Nov 2009 14:35:34 -0000 @@ -490,21 +490,21 @@ function node_update_7006(&$context) { 'vid' => $revision->vid, 'type' => $revision->type, ); - $node->title[FIELD_LANGUAGE_NONE][0]['value'] = $revision->title; + $node->title[LANGUAGE_NONE][0]['value'] = $revision->title; if (!empty($revision->teaser) && $revision->teaser != text_summary($revision->body)) { - $node->body[FIELD_LANGUAGE_NONE][0]['summary'] = $revision->teaser; + $node->body[LANGUAGE_NONE][0]['summary'] = $revision->teaser; } // Do this after text_summary() above. $break = ''; if (substr($revision->body, 0, strlen($break)) == $break) { $revision->body = substr($revision->body, strlen($break)); } - $node->body[FIELD_LANGUAGE_NONE][0]['value'] = $revision->body; + $node->body[LANGUAGE_NONE][0]['value'] = $revision->body; // Explicitly store the current default text format if the revision // did not have its own text format. Similar conversions for other // core modules are performed in filter_update_7005(), but we do this // one here since we are already migrating the data. - $node->body[FIELD_LANGUAGE_NONE][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1); + $node->body[LANGUAGE_NONE][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1); // This is a core update and no contrib modules are enabled yet, so // we can assume default field storage for a faster update. field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array()); Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1168 diff -u -p -r1.1168 node.module --- modules/node/node.module 15 Nov 2009 00:23:57 -0000 1.1168 +++ modules/node/node.module 17 Nov 2009 14:35:34 -0000 @@ -982,7 +982,7 @@ function node_save($node) { // column. After this we restore the field data structure to the previous node // title field. $title_field = $node->title; - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $node->title = $title_field[$langcode][0]['value']; // Generate the node table query and the node_revisions table query. @@ -1213,7 +1213,7 @@ function node_build_content($node, $buil $links['node_readmore'] = array( 'title' => t('Read more'), 'href' => 'node/' . $node->nid, - 'attributes' => array('rel' => 'tag', 'title' => strip_tags($node->title[FIELD_LANGUAGE_NONE][0]['value'])) + 'attributes' => array('rel' => 'tag', 'title' => strip_tags($node->title[LANGUAGE_NONE][0]['value'])) ); } $node->content['links']['node'] = array( @@ -1284,7 +1284,7 @@ function node_language_provider($languag */ function node_show($node, $message = FALSE) { if ($message) { - drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], '%date' => format_date($node->revision_timestamp))), PASS_THROUGH); + drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title[LANGUAGE_NONE][0]['value'], '%date' => format_date($node->revision_timestamp))), PASS_THROUGH); } // Update the history table, stating that this user viewed this node. @@ -1318,7 +1318,7 @@ function template_preprocess_node(&$vari $variables['date'] = format_date($node->created); $variables['name'] = theme('username', array('account' => $node)); $variables['node_url'] = url('node/' . $node->nid); - $variables['node_title'] = check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value']); + $variables['node_title'] = check_plain($node->title[LANGUAGE_NONE][0]['value']); $variables['page'] = (bool)menu_get_object(); if (!empty($node->in_preview)) { @@ -1572,7 +1572,7 @@ function node_search_execute($keys = NUL $results[] = array( 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), 'type' => check_plain(node_type_get_name($node)), - 'title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], + 'title' => $node->title[LANGUAGE_NONE][0]['value'], 'user' => theme('username', array('account' => $node)), 'date' => $node->changed, 'node' => $node, @@ -2061,7 +2061,7 @@ function node_feed($nids = FALSE, $chann $item_text .= drupal_render($build); } - $items .= format_rss_item($node->title[FIELD_LANGUAGE_NONE][0]['value'], $node->link, $item_text, $node->rss_elements); + $items .= format_rss_item($node->title[LANGUAGE_NONE][0]['value'], $node->link, $item_text, $node->rss_elements); } $channel_defaults = array( @@ -2206,7 +2206,7 @@ function _node_index_node($node) { unset($build['#theme']); $node->rendered = drupal_render($build); - $text = '

' . check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value']) . '

' . $node->rendered; + $text = '

' . check_plain($node->title[LANGUAGE_NONE][0]['value']) . '

' . $node->rendered; // Fetch extra data normally not visible $extra = module_invoke_all('node_update_index', $node); @@ -3031,7 +3031,7 @@ function node_action_info() { */ function node_publish_action($node, $context = array()) { $node->status = NODE_PUBLISHED; - watchdog('action', 'Set @type %title to published.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Set @type %title to published.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3040,7 +3040,7 @@ function node_publish_action($node, $con */ function node_unpublish_action($node, $context = array()) { $node->status = NODE_NOT_PUBLISHED; - watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3049,7 +3049,7 @@ function node_unpublish_action($node, $c */ function node_make_sticky_action($node, $context = array()) { $node->sticky = NODE_STICKY; - watchdog('action', 'Set @type %title to sticky.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Set @type %title to sticky.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3058,7 +3058,7 @@ function node_make_sticky_action($node, */ function node_make_unsticky_action($node, $context = array()) { $node->sticky = NODE_NOT_STICKY; - watchdog('action', 'Set @type %title to unsticky.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Set @type %title to unsticky.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3067,7 +3067,7 @@ function node_make_unsticky_action($node */ function node_promote_action($node, $context = array()) { $node->promote = NODE_PROMOTED; - watchdog('action', 'Promoted @type %title to front page.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Promoted @type %title to front page.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3076,7 +3076,7 @@ function node_promote_action($node, $con */ function node_unpromote_action($node, $context = array()) { $node->promote = NODE_NOT_PROMOTED; - watchdog('action', 'Removed @type %title from front page.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Removed @type %title from front page.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3085,7 +3085,7 @@ function node_unpromote_action($node, $c */ function node_save_action($node) { node_save($node); - watchdog('action', 'Saved @type %title', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Saved @type %title', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); } /** @@ -3095,7 +3095,7 @@ function node_save_action($node) { function node_assign_owner_action($node, $context) { $node->uid = $context['owner_uid']; $owner_name = db_query("SELECT name FROM {users} WHERE uid = :uid", array(':uid' => $context['owner_uid']))->fetchField(); - watchdog('action', 'Changed owner of @type %title to uid %name.', array('@type' => node_type_get_type($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], '%name' => $owner_name)); + watchdog('action', 'Changed owner of @type %title to uid %name.', array('@type' => node_type_get_type($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'], '%name' => $owner_name)); } function node_assign_owner_action_form($context) { @@ -3176,7 +3176,7 @@ function node_unpublish_by_keyword_actio foreach ($context['keywords'] as $keyword) { if (strpos(drupal_render(node_build(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) { $node->status = NODE_NOT_PUBLISHED; - watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); + watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); break; } } Index: modules/node/node.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v retrieving revision 1.100 diff -u -p -r1.100 node.pages.inc --- modules/node/node.pages.inc 8 Nov 2009 10:02:41 -0000 1.100 +++ modules/node/node.pages.inc 17 Nov 2009 14:35:34 -0000 @@ -12,7 +12,7 @@ */ function node_page_edit($node) { $type_name = node_type_get_name($node); - drupal_set_title(t('Edit @type @title', array('@type' => $type_name, '@title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), PASS_THROUGH); + drupal_set_title(t('Edit @type @title', array('@type' => $type_name, '@title' => $node->title[LANGUAGE_NONE][0]['value'])), PASS_THROUGH); return drupal_get_form($node->type . '_node_form', $node); } @@ -62,7 +62,7 @@ function node_add($type) { // If a node type has been specified, validate its existence. if (isset($types[$type])) { // Initialize settings: - $node = (object)array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => ''); + $node = (object)array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => LANGUAGE_NONE); drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH); $output = drupal_get_form($type . '_node_form', $node); @@ -417,8 +417,8 @@ function node_form_submit($form, &$form_ $insert = empty($node->nid); node_save($node); $node_link = l(t('view'), 'node/' . $node->nid); - $watchdog_args = array('@type' => $node->type, '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']); - $t_args = array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']); + $watchdog_args = array('@type' => $node->type, '%title' => $node->title[LANGUAGE_NONE][0]['value']); + $t_args = array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value']); if ($insert) { watchdog('content', '@type: added %title.', $watchdog_args, WATCHDOG_NOTICE, $node_link); @@ -467,7 +467,7 @@ function node_delete_confirm($form, &$fo ); return confirm_form($form, - t('Are you sure you want to delete %title?', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), + t('Are you sure you want to delete %title?', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), 'node/' . $node->nid, t('This action cannot be undone.'), t('Delete'), @@ -482,8 +482,8 @@ function node_delete_confirm_submit($for if ($form_state['values']['confirm']) { $node = node_load($form_state['values']['nid']); node_delete($form_state['values']['nid']); - watchdog('content', '@type: deleted %title.', array('@type' => $node->type, '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])); - drupal_set_message(t('@type %title has been deleted.', array('@type' => node_type_get_name($node), '%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']))); + watchdog('content', '@type: deleted %title.', array('@type' => $node->type, '%title' => $node->title[LANGUAGE_NONE][0]['value'])); + drupal_set_message(t('@type %title has been deleted.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value']))); } $form_state['redirect'] = ''; @@ -493,7 +493,7 @@ function node_delete_confirm_submit($for * Generate an overview table of older revisions of a node. */ function node_revision_overview($node) { - drupal_set_title(t('Revisions for %title', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), PASS_THROUGH); + drupal_set_title(t('Revisions for %title', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), PASS_THROUGH); $header = array(t('Revision'), array('data' => t('Operations'), 'colspan' => 2)); @@ -555,8 +555,8 @@ function node_revision_revert_confirm_su node_save($node_revision); - watchdog('content', '@type: reverted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title[FIELD_LANGUAGE_NONE][0]['value'], '%revision' => $node_revision->vid)); - drupal_set_message(t('@type %title has been reverted back to the revision from %revision-date.', array('@type' => node_type_get_name($node_revision), '%title' => $node_revision->title[FIELD_LANGUAGE_NONE][0]['value'], '%revision-date' => format_date($node_revision->revision_timestamp)))); + watchdog('content', '@type: reverted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title[LANGUAGE_NONE][0]['value'], '%revision' => $node_revision->vid)); + drupal_set_message(t('@type %title has been reverted back to the revision from %revision-date.', array('@type' => node_type_get_name($node_revision), '%title' => $node_revision->title[LANGUAGE_NONE][0]['value'], '%revision-date' => format_date($node_revision->revision_timestamp)))); $form_state['redirect'] = 'node/' . $node_revision->nid . '/revisions'; } @@ -569,8 +569,8 @@ function node_revision_delete_confirm_su $node_revision = $form['#node_revision']; node_revision_delete($node_revision->vid); - watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title[FIELD_LANGUAGE_NONE][0]['value'], '%revision' => $node_revision->vid)); - drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_type_get_name($node_revision), '%title' => $node_revision->title[FIELD_LANGUAGE_NONE][0]['value']))); + watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title[LANGUAGE_NONE][0]['value'], '%revision' => $node_revision->vid)); + drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_type_get_name($node_revision), '%title' => $node_revision->title[LANGUAGE_NONE][0]['value']))); $form_state['redirect'] = 'node/' . $node_revision->nid; if (db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid', array(':nid' => $node_revision->nid))->fetchField() > 1) { $form_state['redirect'] .= '/revisions'; Index: modules/node/node.test =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.test,v retrieving revision 1.55 diff -u -p -r1.55 node.test --- modules/node/node.test 14 Nov 2009 07:58:49 -0000 1.55 +++ modules/node/node.test 17 Nov 2009 14:35:34 -0000 @@ -31,15 +31,15 @@ class NodeLoadMultipleUnitTest extends D // Confirm that promoted nodes appear in the default node listing. $this->drupalGet('node'); - $this->assertText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node title appears on the default listing.')); - $this->assertText($node2->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node title appears on the default listing.')); - $this->assertNoText($node3->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node title does not appear in the default listing.')); - $this->assertNoText($node4->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node title does not appear in the default listing.')); + $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], t('Node title appears on the default listing.')); + $this->assertText($node2->title[LANGUAGE_NONE][0]['value'], t('Node title appears on the default listing.')); + $this->assertNoText($node3->title[LANGUAGE_NONE][0]['value'], t('Node title does not appear in the default listing.')); + $this->assertNoText($node4->title[LANGUAGE_NONE][0]['value'], t('Node title does not appear in the default listing.')); // Load nodes with only a condition. Nodes 3 and 4 will be loaded. $nodes = node_load_multiple(NULL, array('promote' => 0)); - $this->assertEqual($node3->title[FIELD_LANGUAGE_NONE][0]['value'], $nodes[$node3->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node was loaded.')); - $this->assertEqual($node4->title[FIELD_LANGUAGE_NONE][0]['value'], $nodes[$node4->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node was loaded.')); + $this->assertEqual($node3->title[LANGUAGE_NONE][0]['value'], $nodes[$node3->nid]->title[LANGUAGE_NONE][0]['value'], t('Node was loaded.')); + $this->assertEqual($node4->title[LANGUAGE_NONE][0]['value'], $nodes[$node4->nid]->title[LANGUAGE_NONE][0]['value'], t('Node was loaded.')); $count = count($nodes); $this->assertTrue($count == 2, t('@count nodes loaded.', array('@count' => $count))); @@ -58,9 +58,9 @@ class NodeLoadMultipleUnitTest extends D $nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article')); $count = count($nodes); $this->assertTrue($count == 3, t('@count nodes loaded', array('@count' => $count))); - $this->assertEqual($nodes[$node1->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node1->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); - $this->assertEqual($nodes[$node2->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node2->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); - $this->assertEqual($nodes[$node3->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node3->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); + $this->assertEqual($nodes[$node1->nid]->title[LANGUAGE_NONE][0]['value'], $node1->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); + $this->assertEqual($nodes[$node2->nid]->title[LANGUAGE_NONE][0]['value'], $node2->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); + $this->assertEqual($nodes[$node3->nid]->title[LANGUAGE_NONE][0]['value'], $node3->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); $this->assertFalse(isset($nodes[$node4->nid])); // Now that all nodes have been loaded into the static cache, ensure that @@ -68,16 +68,16 @@ class NodeLoadMultipleUnitTest extends D $nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article')); $count = count($nodes); $this->assertTrue($count == 3, t('@count nodes loaded.', array('@count' => $count))); - $this->assertEqual($nodes[$node1->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node1->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded')); - $this->assertEqual($nodes[$node2->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node2->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded')); - $this->assertEqual($nodes[$node3->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node3->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded')); + $this->assertEqual($nodes[$node1->nid]->title[LANGUAGE_NONE][0]['value'], $node1->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded')); + $this->assertEqual($nodes[$node2->nid]->title[LANGUAGE_NONE][0]['value'], $node2->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded')); + $this->assertEqual($nodes[$node3->nid]->title[LANGUAGE_NONE][0]['value'], $node3->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded')); $this->assertFalse(isset($nodes[$node4->nid]), t('Node was not loaded')); // Load nodes by nid, where type = article and promote = 0. $nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article', 'promote' => 0)); $count = count($nodes); $this->assertTrue($count == 1, t('@count node loaded', array('@count' => $count))); - $this->assertEqual($nodes[$node3->nid]->title[FIELD_LANGUAGE_NONE][0]['value'], $node3->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); + $this->assertEqual($nodes[$node3->nid]->title[LANGUAGE_NONE][0]['value'], $node3->title[LANGUAGE_NONE][0]['value'], t('Node successfully loaded.')); } } @@ -141,7 +141,7 @@ class NodeRevisionsTestCase extends Drup // Confirm the correct revision text appears on "view revisions" page. $this->drupalGet("node/$node->nid/revisions/$node->vid/view"); - $this->assertText($node->body[FIELD_LANGUAGE_NONE][0]['value'], t('Correct text displays for version.')); + $this->assertText($node->body[LANGUAGE_NONE][0]['value'], t('Correct text displays for version.')); // Confirm the correct log message appears on "revisions overview" page. $this->drupalGet("node/$node->nid/revisions"); @@ -152,16 +152,16 @@ class NodeRevisionsTestCase extends Drup // Confirm that revisions revert properly. $this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/revert", array(), t('Revert')); $this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.', - array('@type' => 'Page', '%title' => $nodes[1]->title[FIELD_LANGUAGE_NONE][0]['value'], + array('@type' => 'Page', '%title' => $nodes[1]->title[LANGUAGE_NONE][0]['value'], '%revision-date' => format_date($nodes[1]->revision_timestamp))), t('Revision reverted.')); $reverted_node = node_load($node->nid); - $this->assertTrue(($nodes[1]->body[FIELD_LANGUAGE_NONE][0]['value'] == $reverted_node->body[FIELD_LANGUAGE_NONE][0]['value']), t('Node reverted correctly.')); + $this->assertTrue(($nodes[1]->body[LANGUAGE_NONE][0]['value'] == $reverted_node->body[LANGUAGE_NONE][0]['value']), t('Node reverted correctly.')); // Confirm revisions delete properly. $this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/delete", array(), t('Delete')); $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($nodes[1]->revision_timestamp), - '@type' => 'Page', '%title' => $nodes[1]->title[FIELD_LANGUAGE_NONE][0]['value'])), t('Revision deleted.')); + '@type' => 'Page', '%title' => $nodes[1]->title[LANGUAGE_NONE][0]['value'])), t('Revision deleted.')); $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, t('Revision not found.')); } } @@ -186,7 +186,7 @@ class PageEditTestCase extends DrupalWeb * Check node edit functionality. */ function testPageEdit() { - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $title_key = "title[$langcode][0][value]"; $body_key = "body[$langcode][0][value]"; // Create node to edit. @@ -268,7 +268,7 @@ class PagePreviewTestCase extends Drupal * Check the node preview functionality. */ function testPagePreview() { - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $title_key = "title[$langcode][0][value]"; $body_key = "body[$langcode][0][value]"; @@ -292,7 +292,7 @@ class PagePreviewTestCase extends Drupal * Check the node preview functionality, when using revisions. */ function testPagePreviewWithRevisions() { - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $title_key = "title[$langcode][0][value]"; $body_key = "body[$langcode][0][value]"; // Force revision on page content. @@ -341,7 +341,7 @@ class PageCreationTestCase extends Drupa function testPageCreation() { // Create a node. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(8); $edit["body[$langcode][0][value]"] = $this->randomName(16); $this->drupalPost('node/add/page', $edit, t('Save')); @@ -409,7 +409,7 @@ class SummaryLengthTestCase extends Drup function testSummaryLength() { // Create a node to view. $settings = array( - 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae arcu at leo cursus laoreet. Curabitur dui tortor, adipiscing malesuada tempor in, bibendum ac diam. Cras non tellus a libero pellentesque condimentum. What is a Drupalism? Suspendisse ac lacus libero. Ut non est vel nisl faucibus interdum nec sed leo. Pellentesque sem risus, vulputate eu semper eget, auctor in libero. Ut fermentum est vitae metus convallis scelerisque. Phasellus pellentesque rhoncus tellus, eu dignissim purus posuere id. Quisque eu fringilla ligula. Morbi ullamcorper, lorem et mattis egestas, tortor neque pretium velit, eget eleifend odio turpis eu purus. Donec vitae metus quis leo pretium tincidunt a pulvinar sem. Morbi adipiscing laoreet mauris vel placerat. Nullam elementum, nisl sit amet scelerisque malesuada, dolor nunc hendrerit quam, eu ultrices erat est in orci. Curabitur feugiat egestas nisl sed accumsan.'))), + 'body' => array(LANGUAGE_NONE => array(array('value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae arcu at leo cursus laoreet. Curabitur dui tortor, adipiscing malesuada tempor in, bibendum ac diam. Cras non tellus a libero pellentesque condimentum. What is a Drupalism? Suspendisse ac lacus libero. Ut non est vel nisl faucibus interdum nec sed leo. Pellentesque sem risus, vulputate eu semper eget, auctor in libero. Ut fermentum est vitae metus convallis scelerisque. Phasellus pellentesque rhoncus tellus, eu dignissim purus posuere id. Quisque eu fringilla ligula. Morbi ullamcorper, lorem et mattis egestas, tortor neque pretium velit, eget eleifend odio turpis eu purus. Donec vitae metus quis leo pretium tincidunt a pulvinar sem. Morbi adipiscing laoreet mauris vel placerat. Nullam elementum, nisl sit amet scelerisque malesuada, dolor nunc hendrerit quam, eu ultrices erat est in orci. Curabitur feugiat egestas nisl sed accumsan.'))), 'promote' => 1, ); $node = $this->drupalCreateNode($settings); @@ -452,7 +452,7 @@ class NodeTitleXSSTestCase extends Drupa $xss = ''; $title = $xss . $this->randomName(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit = array( "title[$langcode][0][value]" => $title, ); @@ -460,7 +460,7 @@ class NodeTitleXSSTestCase extends Drupa $this->drupalPost('node/add/page', $edit, t('Preview')); $this->assertNoRaw($xss, t('Harmful tags are escaped when previewing a node.')); - $settings = array('title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $title)))); + $settings = array('title' => array(LANGUAGE_NONE => array(array('value' => $title)))); $node = $this->drupalCreateNode($settings); $this->drupalGet('node/' . $node->nid); @@ -534,7 +534,7 @@ class NodePostSettingsTestCase extends D // Create a node. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(8); $edit["body[$langcode][0][value]"] = $this->randomName(16); $this->drupalPost('node/add/page', $edit, t('Save')); @@ -556,7 +556,7 @@ class NodePostSettingsTestCase extends D // Create a node. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(8); $edit["body[$langcode][0][value]"] = $this->randomName(16); $this->drupalPost('node/add/page', $edit, t('Save')); @@ -801,8 +801,8 @@ class NodeSaveTestCase extends DrupalWeb $test_nid = $max_nid + mt_rand(1000, 1000000); $title = $this->randomName(8); $node = array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $title))), - 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(32)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $title))), + 'body' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(32)))), 'uid' => $this->web_user->uid, 'type' => 'article', 'nid' => $test_nid, @@ -1091,23 +1091,23 @@ class NodeTitleTestCase extends DrupalWe function testNodeTitle() { // Create page content with title $settings = array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), ); $node = $this->drupalCreateNode($settings); // Test tag. $this->drupalGet("node/$node->nid"); $xpath = '//title'; - $this->assertEqual(current($this->xpath($xpath)), $node->title[FIELD_LANGUAGE_NONE][0]['value'] .' | Drupal', 'Page title is equal to node title.', 'Node'); + $this->assertEqual(current($this->xpath($xpath)), $node->title[LANGUAGE_NONE][0]['value'] .' | Drupal', 'Page title is equal to node title.', 'Node'); // Test breadcrumb in comment preview. $this->drupalGet("comment/reply/$node->nid"); $xpath = '//div[@class="breadcrumb"]/a[last()]'; - $this->assertEqual(current($this->xpath($xpath)), $node->title[FIELD_LANGUAGE_NONE][0]['value'], 'Node breadcrumb is equal to node title.', 'Node'); + $this->assertEqual(current($this->xpath($xpath)), $node->title[LANGUAGE_NONE][0]['value'], 'Node breadcrumb is equal to node title.', 'Node'); // Test node title in comment preview. $xpath = '//div[@id="node-'. $node->nid .'"]/h2/a'; - $this->assertEqual(current($this->xpath($xpath)), $node->title[FIELD_LANGUAGE_NONE][0]['value'], 'Node preview title is equal to node title.', 'Node'); + $this->assertEqual(current($this->xpath($xpath)), $node->title[LANGUAGE_NONE][0]['value'], 'Node preview title is equal to node title.', 'Node'); } } Index: modules/node/node.tokens.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.tokens.inc,v retrieving revision 1.6 diff -u -p -r1.6 node.tokens.inc --- modules/node/node.tokens.inc 5 Nov 2009 03:35:29 -0000 1.6 +++ modules/node/node.tokens.inc 17 Nov 2009 14:35:34 -0000 @@ -134,18 +134,18 @@ function node_tokens($type, $tokens, arr break; case 'title': - $replacements[$original] = $sanitize ? check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value']) : $node->title[FIELD_LANGUAGE_NONE][0]['value']; + $replacements[$original] = $sanitize ? check_plain($node->title[LANGUAGE_NONE][0]['value']) : $node->title[LANGUAGE_NONE][0]['value']; break; case 'body': if (!empty($node->body)) { - $replacements[$original] = $sanitize ? $node->body[FIELD_LANGUAGE_NONE][0]['safe'] : $node->body[FIELD_LANGUAGE_NONE][0]['value']; + $replacements[$original] = $sanitize ? $node->body[LANGUAGE_NONE][0]['safe'] : $node->body[LANGUAGE_NONE][0]['value']; } break; case 'summary': if (!empty($node->body)) { - $replacements[$original] = $sanitize ? $node->body[FIELD_LANGUAGE_NONE][0]['safe_summary'] : $node->body[FIELD_LANGUAGE_NONE][0]['summary']; + $replacements[$original] = $sanitize ? $node->body[LANGUAGE_NONE][0]['safe_summary'] : $node->body[LANGUAGE_NONE][0]['summary']; } break; Index: modules/path/path.test =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.test,v retrieving revision 1.26 diff -u -p -r1.26 path.test --- modules/path/path.test 8 Nov 2009 11:19:02 -0000 1.26 +++ modules/path/path.test 17 Nov 2009 14:35:34 -0000 @@ -63,7 +63,7 @@ class PathTestCase extends DrupalWebTest // Confirm that the alias works. $this->drupalGet($edit['alias']); - $this->assertText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], 'Alias works.'); + $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Alias works.'); // Change alias. $pid = $this->getPID($edit['alias']); @@ -74,7 +74,7 @@ class PathTestCase extends DrupalWebTest // Confirm that the alias works. $this->drupalGet($edit['alias']); - $this->assertText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], 'Changed alias works.'); + $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Changed alias works.'); drupal_static_reset('drupal_lookup_path'); // Confirm that previous alias no longer works. @@ -115,7 +115,7 @@ class PathTestCase extends DrupalWebTest // Confirm that the alias works. $this->drupalGet($edit['path[alias]']); - $this->assertText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], 'Alias works.'); + $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Alias works.'); // Change alias. $previous = $edit['path[alias]']; @@ -124,11 +124,11 @@ class PathTestCase extends DrupalWebTest // Confirm that the alias works. $this->drupalGet($edit['path[alias]']); - $this->assertText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], 'Changed alias works.'); + $this->assertText($node1->title[LANGUAGE_NONE][0]['value'], 'Changed alias works.'); // Make sure that previous alias no longer works. $this->drupalGet($previous); - $this->assertNoText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], 'Previous alias no longer works.'); + $this->assertNoText($node1->title[LANGUAGE_NONE][0]['value'], 'Previous alias no longer works.'); $this->assertResponse(404); // Create second test node. @@ -264,7 +264,7 @@ class PathLanguageTestCase extends Drupa // Confirm that the alias works. $this->drupalGet($edit['path[alias]']); - $this->assertText($english_node->title[FIELD_LANGUAGE_NONE][0]['value'], 'Alias works.'); + $this->assertText($english_node->title[LANGUAGE_NONE][0]['value'], 'Alias works.'); // Translate the node into French. $this->drupalGet('node/' . $english_node->nid . '/translate'); @@ -272,7 +272,7 @@ class PathLanguageTestCase extends Drupa $edit = array(); $langcode = 'fr'; $edit["body[$langcode][0][value]"] = $this->randomName(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(); $edit['path[alias]'] = $this->randomName(); $this->drupalPost(NULL, $edit, t('Save')); @@ -286,7 +286,7 @@ class PathLanguageTestCase extends Drupa // Confirm that the alias works. $this->drupalGet('fr/' . $edit['path[alias]']); - $this->assertText($french_node->title[FIELD_LANGUAGE_NONE][0]['value'], 'Alias for French translation works.'); + $this->assertText($french_node->title[LANGUAGE_NONE][0]['value'], 'Alias for French translation works.'); // Confirm that the alias is returned by url(). drupal_static_reset('language_list'); Index: modules/php/php.test =================================================================== RCS file: /cvs/drupal/drupal/modules/php/php.test,v retrieving revision 1.18 diff -u -p -r1.18 php.test --- modules/php/php.test 11 Oct 2009 03:07:19 -0000 1.18 +++ modules/php/php.test 17 Nov 2009 14:35:34 -0000 @@ -30,7 +30,7 @@ class PHPTestCase extends DrupalWebTestC * @return stdObject Node object. */ function createNodeWithCode() { - return $this->drupalCreateNode(array('body' => array(FIELD_LANGUAGE_NONE => array(array('value' => '<?php print "SimpleTest PHP was executed!"; ?>'))))); + return $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => '<?php print "SimpleTest PHP was executed!"; ?>'))))); } } @@ -64,10 +64,10 @@ class PHPFilterTestCase extends PHPTestC // Change filter to PHP filter and see that PHP code is evaluated. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["body[$langcode][0][value_format]"] = $this->php_code_format; $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), t('PHP code filter turned on.')); + $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), t('PHP code filter turned on.')); // Make sure that the PHP code shows up as text. $this->assertNoText('print', t('PHP code isn\'t displayed.')); Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.323 diff -u -p -r1.323 poll.module --- modules/poll/poll.module 8 Nov 2009 10:02:41 -0000 1.323 +++ modules/poll/poll.module 17 Nov 2009 14:35:34 -0000 @@ -711,7 +711,7 @@ function poll_vote($form, &$form_state) function template_preprocess_poll_vote(&$variables) { $form = $variables['form']; $variables['choice'] = drupal_render($form['choice']); - $variables['title'] = check_plain($form['#node']->title[FIELD_LANGUAGE_NONE][0]['value']); + $variables['title'] = check_plain($form['#node']->title[LANGUAGE_NONE][0]['value']); $variables['vote'] = drupal_render($form['vote']); $variables['rest'] = drupal_render_children($form); $variables['block'] = $form['#block']; @@ -743,7 +743,7 @@ function poll_view_results($node, $build } } - return theme('poll_results', array('raw_title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], 'results' => $poll_results, 'votes' => $total_votes, 'raw_links' => isset($node->links) ? $node->links : array(), 'block' => $block, 'nid' => $node->nid, 'vote' => isset($node->vote) ? $node->vote : NULL)); + return theme('poll_results', array('raw_title' => $node->title[LANGUAGE_NONE][0]['value'], 'results' => $poll_results, 'votes' => $total_votes, 'raw_links' => isset($node->links) ? $node->links : array(), 'block' => $block, 'nid' => $node->nid, 'vote' => isset($node->vote) ? $node->vote : NULL)); } Index: modules/poll/poll.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v retrieving revision 1.25 diff -u -p -r1.25 poll.pages.inc --- modules/poll/poll.pages.inc 8 Nov 2009 10:02:41 -0000 1.25 +++ modules/poll/poll.pages.inc 17 Nov 2009 14:35:34 -0000 @@ -51,7 +51,7 @@ function poll_page() { */ function poll_votes($node) { $votes_per_page = 20; - drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); + drupal_set_title($node->title[LANGUAGE_NONE][0]['value']); $header[] = array('data' => t('Visitor'), 'field' => 'u.name'); $header[] = array('data' => t('Vote'), 'field' => 'pc.chtext'); @@ -92,7 +92,7 @@ function poll_votes($node) { * Callback for the 'results' tab for polls you can vote on */ function poll_results($node) { - drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); + drupal_set_title($node->title[LANGUAGE_NONE][0]['value']); $node->show_results = TRUE; return node_show($node); } Index: modules/poll/poll.test =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.test,v retrieving revision 1.25 diff -u -p -r1.25 poll.test --- modules/poll/poll.test 16 Oct 2009 23:48:37 -0000 1.25 +++ modules/poll/poll.test 17 Nov 2009 14:35:34 -0000 @@ -57,7 +57,7 @@ class PollTestCase extends DrupalWebTest $already_submitted_choices = array_slice($choices, 0, $index); $new_choices = array_values(array_slice($choices, $index, $max_new_choices)); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit = array( "title[$langcode][0][value]" => $title ); @@ -332,7 +332,7 @@ class PollJSAddChoice extends DrupalWebT $web_user = $this->drupalCreateUser(array('create poll content', 'access content')); $this->drupalLogin($web_user); $this->drupalGet('node/add/poll'); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit = array( "title[$langcode][0][value]" => $this->randomName(), 'choice[new:0][chtext]' => $this->randomName(), Index: modules/search/search.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.api.php,v retrieving revision 1.18 diff -u -p -r1.18 search.api.php --- modules/search/search.api.php 11 Oct 2009 03:07:19 -0000 1.18 +++ modules/search/search.api.php 17 Nov 2009 14:35:34 -0000 @@ -191,7 +191,7 @@ function hook_search_execute($keys = NUL $results[] = array( 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), 'type' => check_plain(node_type_get_name($node)), - 'title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], + 'title' => $node->title[LANGUAGE_NONE][0]['value'], 'user' => theme('username', array('account' => $node)), 'date' => $node->changed, 'node' => $node, @@ -267,7 +267,7 @@ function hook_update_index() { node_build_content($node, 'search_index'); $node->rendered = drupal_render($node->content); - $text = '<h1>' . check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value']) . '</h1>' . $node->rendered; + $text = '<h1>' . check_plain($node->title[LANGUAGE_NONE][0]['value']) . '</h1>' . $node->rendered; // Fetch extra data normally not visible $extra = module_invoke_all('node_update_index', $node); Index: modules/search/search.test =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.test,v retrieving revision 1.42 diff -u -p -r1.42 search.test --- modules/search/search.test 19 Oct 2009 23:28:40 -0000 1.42 +++ modules/search/search.test 17 Nov 2009 14:35:34 -0000 @@ -280,17 +280,17 @@ class SearchAdvancedSearchForm extends D $this->assertNoText($this->node->title, t('Page node is not found with dummy title.')); // Search for the title of the node with a GET query. - $this->drupalGet('search/node/' . $this->node->title[FIELD_LANGUAGE_NONE][0]['value']); - $this->assertText($this->node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Page node is found with GET query.')); + $this->drupalGet('search/node/' . $this->node->title[LANGUAGE_NONE][0]['value']); + $this->assertText($this->node->title[LANGUAGE_NONE][0]['value'], t('Page node is found with GET query.')); // Search for the title of the node with a POST query. - $edit = array('or' => $this->node->title[FIELD_LANGUAGE_NONE][0]['value']); + $edit = array('or' => $this->node->title[LANGUAGE_NONE][0]['value']); $this->drupalPost('search/node', $edit, t('Advanced search')); - $this->assertText($this->node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Page node is found with POST query.')); + $this->assertText($this->node->title[LANGUAGE_NONE][0]['value'], t('Page node is found with POST query.')); // Advanced search type option. $this->drupalPost('search/node', array_merge($edit, array('type[page]' => 'page')), t('Advanced search')); - $this->assertText($this->node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Page node is found with POST query and type:page.')); + $this->assertText($this->node->title[LANGUAGE_NONE][0]['value'], t('Page node is found with POST query and type:page.')); $this->drupalPost('search/node', array_merge($edit, array('type[article]' => 'article')), t('Advanced search')); $this->assertText('bike shed', t('Article node is not found with POST query and type:article.')); @@ -322,7 +322,7 @@ class SearchRankingTestCase extends Drup // Create nodes for testing. foreach ($node_ranks as $node_rank) { - $settings = array('type' => 'page', 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => 'Drupal rocks'))), 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => "Drupal's search rocks")))); + $settings = array('type' => 'page', 'title' => array(LANGUAGE_NONE => array(array('value' => 'Drupal rocks'))), 'body' => array(LANGUAGE_NONE => array(array('value' => "Drupal's search rocks")))); foreach (array(0, 1) as $num) { if ($num == 1) { switch ($node_rank) { @@ -331,7 +331,7 @@ class SearchRankingTestCase extends Drup $settings[$node_rank] = 1; break; case 'relevance': - $settings['body'][FIELD_LANGUAGE_NONE][0]['value'] .= " really rocks"; + $settings['body'][LANGUAGE_NONE][0]['value'] .= " really rocks"; break; case 'recent': $settings['created'] = REQUEST_TIME + 3600; @@ -501,7 +501,7 @@ class SearchCommentTestCase extends Drup 'search_block_form' => $comment_body, ); $this->drupalPost('', $edit, t('Search')); - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node found in search results.')); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Node found in search results.')); // Verify that comment is rendered using proper format. $this->assertText($edit_comment['subject'], t('Comment subject found in search results.')); Index: modules/simpletest/drupal_web_test_case.php =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v retrieving revision 1.170 diff -u -p -r1.170 drupal_web_test_case.php --- modules/simpletest/drupal_web_test_case.php 14 Nov 2009 07:58:49 -0000 1.170 +++ modules/simpletest/drupal_web_test_case.php 17 Nov 2009 14:35:34 -0000 @@ -693,8 +693,8 @@ class DrupalWebTestCase extends DrupalTe protected function drupalCreateNode($settings = array()) { // Populate defaults array. $settings += array( - 'body' => array(FIELD_LANGUAGE_NONE => array(array())), - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'body' => array(LANGUAGE_NONE => array(array())), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'comment' => 2, 'changed' => REQUEST_TIME, 'moderate' => 0, @@ -730,7 +730,7 @@ class DrupalWebTestCase extends DrupalTe 'value' => $this->randomName(32), 'format' => filter_default_format(), ); - $langcode = !empty($settings['language']) ? $settings['language'] : FIELD_LANGUAGE_NONE; + $langcode = !empty($settings['language']) ? $settings['language'] : LANGUAGE_NONE; $settings['body'][$langcode][0] += $body; $node = (object) $settings; Index: modules/simpletest/tests/common.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v retrieving revision 1.90 diff -u -p -r1.90 common.test --- modules/simpletest/tests/common.test 11 Nov 2009 00:48:56 -0000 1.90 +++ modules/simpletest/tests/common.test 17 Nov 2009 14:35:34 -0000 @@ -604,7 +604,7 @@ class CascadingStylesheetsTestCase exten $settings = array( 'type' => 'page', 'body' => array( - FIELD_LANGUAGE_NONE => array( + LANGUAGE_NONE => array( array( 'value' => t('This tests the inline CSS!') . "<?php drupal_add_css('$css', 'inline'); ?>", // The "PHP code" format is always the most recent one added, since Index: modules/statistics/statistics.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.pages.inc,v retrieving revision 1.20 diff -u -p -r1.20 statistics.pages.inc --- modules/statistics/statistics.pages.inc 1 Nov 2009 21:26:44 -0000 1.20 +++ modules/statistics/statistics.pages.inc 17 Nov 2009 14:35:34 -0000 @@ -42,7 +42,7 @@ function statistics_node_tracker() { $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4)); } - drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); + drupal_set_title($node->title[LANGUAGE_NONE][0]['value']); $build['statistics_table'] = array( '#theme' => 'table', '#header' => $header, Index: modules/system/system.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v retrieving revision 1.103 diff -u -p -r1.103 system.api.php --- modules/system/system.api.php 15 Nov 2009 08:48:39 -0000 1.103 +++ modules/system/system.api.php 17 Nov 2009 14:35:34 -0000 @@ -1216,7 +1216,7 @@ function hook_mail($key, &$message, $par '%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, ); Index: modules/system/system.test =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.test,v retrieving revision 1.90 diff -u -p -r1.90 system.test --- modules/system/system.test 23 Oct 2009 00:45:51 -0000 1.90 +++ modules/system/system.test 17 Nov 2009 14:35:34 -0000 @@ -530,8 +530,8 @@ class AccessDeniedTestCase extends Drupa $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 Drupa $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 Drupa $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 Drupa $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 DrupalW 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), @@ -1344,7 +1344,7 @@ class TokenReplaceTestCase extends Drupa // 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 @@ -1355,7 +1355,7 @@ class TokenReplaceTestCase extends Drupa $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); @@ -1373,10 +1373,10 @@ class TokenReplaceTestCase extends Drupa $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.')); } } Index: modules/system/system.tokens.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.tokens.inc,v retrieving revision 1.4 diff -u -p -r1.4 system.tokens.inc --- modules/system/system.tokens.inc 11 Oct 2009 03:07:20 -0000 1.4 +++ modules/system/system.tokens.inc 17 Nov 2009 14:35:34 -0000 @@ -283,7 +283,7 @@ function system_tokens($type, $tokens, 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; Index: modules/taxonomy/taxonomy.test =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v retrieving revision 1.58 diff -u -p -r1.58 taxonomy.test --- modules/taxonomy/taxonomy.test 11 Nov 2009 17:10:49 -0000 1.58 +++ modules/taxonomy/taxonomy.test 17 Nov 2009 14:35:34 -0000 @@ -378,7 +378,7 @@ class TaxonomyTermTestCase extends Taxon // Post an article. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(); $edit["body[$langcode][0][value]"] = $this->randomName(); $edit[$this->instance['field_name'] . '[' . $langcode .'][value][]'] = $term1->tid; @@ -413,7 +413,7 @@ class TaxonomyTermTestCase extends Taxon ); $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $this->randomName(); $edit["body[$langcode][0][value]"] = $this->randomName(); // Insert the terms in a comma separated list. Vocabulary 1 is a @@ -749,7 +749,7 @@ class TaxonomyTermFieldTestCase extends field_create_instance($this->instance); // Test valid and invalid values with field_attach_validate(). - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $term = $this->createTerm($this->vocabulary); $entity->{$this->field_name}[$langcode][0]['value'] = $term->tid; @@ -807,7 +807,7 @@ class TaxonomyTermFieldTestCase extends $term = $this->createTerm($this->vocabulary); // Display creation form. - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $this->drupalGet('test-entity/add/test-bundle'); $this->assertFieldByName("{$this->field_name}[$langcode][value]", '', t('Widget is displayed')); Index: modules/tracker/tracker.test =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.test,v retrieving revision 1.13 diff -u -p -r1.13 tracker.test --- modules/tracker/tracker.test 14 Nov 2009 07:58:50 -0000 1.13 +++ modules/tracker/tracker.test 17 Nov 2009 14:35:34 -0000 @@ -32,17 +32,17 @@ class TrackerTest extends DrupalWebTestC $this->drupalLogin($this->user); $unpublished = $this->drupalCreateNode(array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'status' => 0, )); $published = $this->drupalCreateNode(array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'status' => 1, )); $this->drupalGet('tracker'); - $this->assertNoText($unpublished->title[FIELD_LANGUAGE_NONE][0]['value'], t('Unpublished node do not show up in the tracker listing.')); - $this->assertText($published->title[FIELD_LANGUAGE_NONE][0]['value'], t('Published node show up in the tracker listing.')); + $this->assertNoText($unpublished->title[LANGUAGE_NONE][0]['value'], t('Unpublished node do not show up in the tracker listing.')); + $this->assertText($published->title[LANGUAGE_NONE][0]['value'], t('Published node show up in the tracker listing.')); $this->assertLink(t('My recent posts'), 0, t('User tab shows up on the global tracker page.')); } @@ -53,22 +53,22 @@ class TrackerTest extends DrupalWebTestC $this->drupalLogin($this->user); $unpublished = $this->drupalCreateNode(array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->user->uid, 'status' => 0, )); $my_published = $this->drupalCreateNode(array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->user->uid, 'status' => 1, )); $other_published_no_comment = $this->drupalCreateNode(array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->other_user->uid, 'status' => 1, )); $other_published_my_comment = $this->drupalCreateNode(array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->other_user->uid, 'status' => 1, )); @@ -79,10 +79,10 @@ class TrackerTest extends DrupalWebTestC $this->drupalPost('comment/reply/' . $other_published_my_comment->nid, $comment, t('Save')); $this->drupalGet('user/' . $this->user->uid . '/track'); - $this->assertNoText($unpublished->title[FIELD_LANGUAGE_NONE][0]['value'], t("Unpublished nodes do not show up in the users's tracker listing.")); - $this->assertText($my_published->title[FIELD_LANGUAGE_NONE][0]['value'], t("Published nodes show up in the user's tracker listing.")); - $this->assertNoText($other_published_no_comment->title[FIELD_LANGUAGE_NONE][0]['value'], t("Other user's nodes do not show up in the user's tracker listing.")); - $this->assertText($other_published_my_comment->title[FIELD_LANGUAGE_NONE][0]['value'], t("Nodes that the user has commented on appear in the user's tracker listing.")); + $this->assertNoText($unpublished->title[LANGUAGE_NONE][0]['value'], t("Unpublished nodes do not show up in the users's tracker listing.")); + $this->assertText($my_published->title[LANGUAGE_NONE][0]['value'], t("Published nodes show up in the user's tracker listing.")); + $this->assertNoText($other_published_no_comment->title[LANGUAGE_NONE][0]['value'], t("Other user's nodes do not show up in the user's tracker listing.")); + $this->assertText($other_published_my_comment->title[LANGUAGE_NONE][0]['value'], t("Nodes that the user has commented on appear in the user's tracker listing.")); } /** @@ -92,11 +92,11 @@ class TrackerTest extends DrupalWebTestC $this->drupalLogin($this->user); $edit = array( - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), ); $node = $this->drupalCreateNode($edit); - $title = $edit['title'][FIELD_LANGUAGE_NONE][0]['value']; + $title = $edit['title'][LANGUAGE_NONE][0]['value']; $this->drupalGet('tracker'); $this->assertPattern('/' . $title . '.*new/', t('New nodes are flagged as such in the tracker listing.')); @@ -121,7 +121,7 @@ class TrackerTest extends DrupalWebTestC $node = $this->drupalCreateNode(array( 'comment' => 2, - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), )); // Add a comment to the page. @@ -163,7 +163,7 @@ class TrackerTest extends DrupalWebTestC for ($i = 1; $i <= 3; $i++) { $edits[$i] = array( 'comment' => 2, - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName()))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName()))), ); $nodes[$i] = $this->drupalCreateNode($edits[$i]); } @@ -193,7 +193,7 @@ class TrackerTest extends DrupalWebTestC // Assert that all node titles are displayed. foreach ($nodes as $i => $node) { - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); } $this->assertText('1 new', t('New comment is counted on the tracker listing pages.')); $this->assertText('updated', t('Node is listed as updated')); @@ -204,7 +204,7 @@ class TrackerTest extends DrupalWebTestC // Assert that all node titles are displayed. foreach ($nodes as $i => $node) { - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); } $this->assertText('1 new', t('New comment is counted on the tracker listing pages.')); } @@ -218,12 +218,12 @@ class TrackerTest extends DrupalWebTestC $node = $this->drupalCreateNode(array( 'comment' => 2, - 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName()))), + 'title' => array(LANGUAGE_NONE => array(array('value' => $this->randomName()))), )); // Assert that the node is displayed. $this->drupalGet('tracker'); - $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node is displayed on the tracker listing pages.')); + $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Node is displayed on the tracker listing pages.')); // Unpublish the node and ensure that it's no longer displayed. $edit = array( Index: modules/translation/translation.module =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v retrieving revision 1.64 diff -u -p -r1.64 translation.module --- modules/translation/translation.module 8 Nov 2009 10:02:41 -0000 1.64 +++ modules/translation/translation.module 17 Nov 2009 14:35:34 -0000 @@ -76,7 +76,7 @@ function translation_menu() { * all languages). */ function _translation_tab_access($node) { - if (!empty($node->language) && translation_supported_type($node->type)) { + if ($node->language != LANGUAGE_NONE && translation_supported_type($node->type)) { return user_access('translate content'); } return FALSE; @@ -123,7 +123,7 @@ function translation_form_alter(&$form, // Disable languages for existing translations, so it is not possible to switch this // node to some language which is already in the translation set. Also remove the // language neutral option. - unset($form['language']['#options']['']); + unset($form['language']['#options'][LANGUAGE_NONE]); foreach (translation_node_get_translations($node->tnid) as $translation) { if ($translation->nid != $node->nid) { unset($form['language']['#options'][$translation->language]); @@ -202,7 +202,7 @@ function translation_node_prepare($node) $translations = translation_node_get_translations($source_node->tnid); if (isset($translations[$language])) { $languages = language_list(); - 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[FIELD_LANGUAGE_NONE][0]['value'], '%language' => $languages[$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_NONE][0]['value'], '%language' => $languages[$language]->name, '%type' => $node->type)), 'error'); return; } } Index: modules/translation/translation.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.pages.inc,v retrieving revision 1.12 diff -u -p -r1.12 translation.pages.inc --- modules/translation/translation.pages.inc 8 Nov 2009 10:02:41 -0000 1.12 +++ modules/translation/translation.pages.inc 17 Nov 2009 14:35:34 -0000 @@ -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[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $translation_node->nid); + $title = l($translation_node->title[LANGUAGE_NONE][0]['value'], '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[FIELD_LANGUAGE_NONE][0]['value'])), PASS_THROUGH); + drupal_set_title(t('Translations of %title', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), PASS_THROUGH); $build['translation_node_overview'] = array( '#theme' => 'table', Index: modules/translation/translation.test =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.test,v retrieving revision 1.20 diff -u -p -r1.20 translation.test --- modules/translation/translation.test 16 Oct 2009 02:04:44 -0000 1.20 +++ modules/translation/translation.test 17 Nov 2009 14:35:34 -0000 @@ -59,7 +59,7 @@ class TranslationTestCase extends Drupal // Attempt a resubmission of the form - this emulates using the back button // to return to the page then resubmitting the form without a refresh. $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $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'))); @@ -128,7 +128,7 @@ class TranslationTestCase extends Drupal */ function createPage($title, $body, $language) { $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $title; $edit["body[$langcode][0][value]"] = $body; $edit['language'] = $language; @@ -154,7 +154,7 @@ class TranslationTestCase extends Drupal $this->drupalGet('node/add/page', array('query' => array('translation' => $nid, 'language' => $language))); $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = $title; $edit["body[$language][0][value]"] = $body; $this->drupalPost(NULL, $edit, t('Save')); Index: modules/trigger/trigger.test =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.test,v retrieving revision 1.21 diff -u -p -r1.21 trigger.test --- modules/trigger/trigger.test 18 Oct 2009 06:56:24 -0000 1.21 +++ modules/trigger/trigger.test 17 Nov 2009 14:35:34 -0000 @@ -37,7 +37,7 @@ class TriggerContentTestCase extends Dru $web_user = $this->drupalCreateUser(array('create page content', 'access content', 'administer nodes')); $this->drupalLogin($web_user); $edit = array(); - $langcode = FIELD_LANGUAGE_NONE; + $langcode = LANGUAGE_NONE; $edit["title[$langcode][0][value]"] = '!SimpleTest test node! ' . $this->randomName(10); $edit["body[$langcode][0][value]"] = '!SimpleTest test body! ' . $this->randomName(32) . ' ' . $this->randomName(32); $edit[$info['property']] = !$info['expected']; Index: modules/upload/upload.test =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v retrieving revision 1.29 diff -u -p -r1.29 upload.test --- modules/upload/upload.test 8 Nov 2009 10:02:41 -0000 1.29 +++ modules/upload/upload.test 17 Nov 2009 14:35:34 -0000 @@ -74,7 +74,7 @@ class UploadTestCase extends DrupalWebTe $edit = array(); $edit['files[' . $upload->fid . '][description]'] = $new_name = substr($upload->description, 1); $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), 'File renamed successfully.'); + $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), 'File renamed successfully.'); $this->assertText($new_name, $new_name . ' found on node.'); $this->assertNoText($upload->description, $upload->description . ' not found on node.'); @@ -83,7 +83,7 @@ class UploadTestCase extends DrupalWebTe $edit = array(); $edit['files[' . $upload->fid . '][remove]'] = TRUE; $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), 'File deleted successfully.'); + $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), 'File deleted successfully.'); $this->assertNoText($new_name, $new_name . ' not found on node.'); $uri = 'public://' . $upload->description; @@ -197,7 +197,7 @@ class UploadTestCase extends DrupalWebTe $edit['files[upload]'] = $filename; //edit-upload $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); if ($assert) { - $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])), 'File attached successfully.'); + $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])), 'File attached successfully.'); } }