diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-11 03:07:21 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-11 03:07:21 +0000 |
commit | b3265dbe174ce0efefa181b8af6c1eaea3ff22c2 (patch) | |
tree | aa7e8b709c162fd781748d8bebaa12c75727e01e /modules/search | |
parent | 64a1a0d67eb5aecc8e6d78469b19f58e8443c717 (diff) | |
download | brdo-b3265dbe174ce0efefa181b8af6c1eaea3ff22c2.tar.gz brdo-b3265dbe174ce0efefa181b8af6c1eaea3ff22c2.tar.bz2 |
#557292 by peximo, plach, catch, and yched: Convert node title to Field API.
Diffstat (limited to 'modules/search')
-rw-r--r-- | modules/search/search.api.php | 4 | ||||
-rw-r--r-- | modules/search/search.test | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/search/search.api.php b/modules/search/search.api.php index 0cfb1a1e6..a3170087c 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, + 'title' => $node->title[FIELD_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) . '</h1>' . $node->rendered; + $text = '<h1>' . check_plain($node->title[FIELD_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 7ffcbf2ab..357789039 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); - $this->assertText($this->node->title, t('Page node is found with 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.')); // Search for the title of the node with a POST query. - $edit = array('or' => $this->node->title); + $edit = array('or' => $this->node->title[FIELD_LANGUAGE_NONE][0]['value']); $this->drupalPost('search/node', $edit, t('Advanced search')); - $this->assertText($this->node->title, t('Page node is found with POST query.')); + $this->assertText($this->node->title[FIELD_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, t('Page node is found with POST query and type:page.')); + $this->assertText($this->node->title[FIELD_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' => 'Drupal rocks', 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => "Drupal's search rocks")))); + $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")))); foreach (array(0, 1) as $num) { if ($num == 1) { switch ($node_rank) { @@ -506,7 +506,7 @@ class SearchCommentTestCase extends DrupalWebTestCase { 'search_block_form' => $comment_body, ); $this->drupalPost('', $edit, t('Search')); - $this->assertText($node->title, t('Node found in search results.')); + $this->assertText($node->title[FIELD_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.')); |