Issue #2422039 by idebr: Double escaping in search result info

8.0.x
Alex Pott 2015-02-13 13:10:41 +00:00
parent 7f6f61f4a2
commit 584907e1ac
2 changed files with 10 additions and 2 deletions

View File

@ -59,6 +59,10 @@ function template_preprocess_search_result(&$variables) {
$variables['snippet'] = isset($result['snippet']) ? $result['snippet'] : '';
// Provide separated and grouped meta information..
$variables['info_split'] = $info;
$variables['info'] = implode(' - ', $info);
$variables['info'] = array(
'#type' => 'inline_template',
'#template' => '{{ info|safe_join(" - ") }}',
'#context' => array('info' => $info),
);
}

View File

@ -26,7 +26,7 @@ class SearchNodePunctuationTest extends SearchTestBase {
node_access_rebuild();
// Create a test user and log in.
$this->testUser = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search'));
$this->testUser = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search', 'access user profiles'));
$this->drupalLogin($this->testUser);
}
@ -47,5 +47,9 @@ class SearchNodePunctuationTest extends SearchTestBase {
$edit = array('keys' => '"bunny\'s"');
$this->drupalPostForm('search/node', $edit, t('Search'));
$this->assertText($node->label());
// Check if the author is linked correctly to the user profile page.
$username = $node->getOwner()->getUsername();
$this->assertLink($username);
}
}