diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-02 19:26:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-02 19:26:23 +0000 |
commit | 0baad49d620d9988837287cb5942eea764d3ed6f (patch) | |
tree | 146072f69b433cb7922572ba2ac627a83987edd4 /modules/search | |
parent | ef4513651e210784ba84eb310cf919e26f668bed (diff) | |
download | brdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.gz brdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.bz2 |
- Patch #635094 by plach: unify 'language neutral' language codes.
Diffstat (limited to 'modules/search')
-rw-r--r-- | modules/search/search.api.php | 4 | ||||
-rw-r--r-- | modules/search/search.test | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/modules/search/search.api.php b/modules/search/search.api.php index a3170087c..2a4919105 100644 --- a/modules/search/search.api.php +++ b/modules/search/search.api.php @@ -191,7 +191,7 @@ function hook_search_execute($keys = NULL) { $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); diff --git a/modules/search/search.test b/modules/search/search.test index 9145d3385..15cc1328d 100644 --- a/modules/search/search.test +++ b/modules/search/search.test @@ -280,17 +280,17 @@ class SearchAdvancedSearchForm extends DrupalWebTestCase { $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 DrupalWebTestCase { // 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 DrupalWebTestCase { $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 DrupalWebTestCase { '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.')); |