Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0

This commit is contained in:
Pantheon Automation 2016-10-06 15:16:20 -07:00 committed by Greg Anderson
parent 2f563ab520
commit f1c8716f57
1732 changed files with 52334 additions and 11780 deletions

View file

@ -79,7 +79,7 @@ class SearchController extends ControllerBase {
// and we don't want to build the results based on last time's request.
$build['#cache']['contexts'][] = 'url.query_args:keys';
if ($request->query->has('keys')) {
$keys = trim($request->get('keys'));
$keys = trim($request->query->get('keys'));
$plugin->setSearch($keys, $request->query->all(), $request->attributes->all());
}

View file

@ -42,7 +42,7 @@ class SearchBlockForm extends FormBase {
* The search page repository.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Render\RendererInterface
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
*/
public function __construct(SearchPageRepositoryInterface $search_page_repository, ConfigFactoryInterface $config_factory, RendererInterface $renderer) {

View file

@ -24,7 +24,7 @@ class SearchPageAddForm extends SearchPageFormBase {
*/
protected function actions(array $form, FormStateInterface $form_state) {
$actions = parent::actions($form, $form_state);
$actions['submit']['#value'] = $this->t('Add search page');
$actions['submit']['#value'] = $this->t('Save');
return $actions;
}

View file

@ -269,7 +269,7 @@ class SearchPageListBuilder extends DraggableListBuilder implements FormInterfac
);
$form['search_pages']['add_page']['add_search_submit'] = array(
'#type' => 'submit',
'#value' => $this->t('Add new page'),
'#value' => $this->t('Add search page'),
'#validate' => array('::validateAddSearchPage'),
'#submit' => array('::submitAddSearchPage'),
'#limit_validation_errors' => array(array('search_type')),

View file

@ -3,6 +3,7 @@
namespace Drupal\search\Tests;
use Drupal\Core\Url;
use Drupal\search\Entity\SearchPage;
/**
* Verify the search config settings form.
@ -145,7 +146,7 @@ class SearchConfigSettingsFormTest extends SearchTestBase {
);
$plugins = array_keys($plugin_info);
/** @var $entities \Drupal\search\SearchPageInterface[] */
$entities = entity_load_multiple('search_page');
$entities = SearchPage::loadMultiple();
// Disable all of the search pages.
foreach ($entities as $entity) {
$entity->disable()->save();
@ -236,26 +237,26 @@ class SearchConfigSettingsFormTest extends SearchTestBase {
// Add a search page.
$edit = array();
$edit['search_type'] = 'search_extra_type_search';
$this->drupalPostForm(NULL, $edit, t('Add new page'));
$this->drupalPostForm(NULL, $edit, t('Add search page'));
$this->assertTitle('Add new search page | Drupal');
$first = array();
$first['label'] = $this->randomString();
$first_id = $first['id'] = strtolower($this->randomMachineName(8));
$first['path'] = strtolower($this->randomMachineName(8));
$this->drupalPostForm(NULL, $first, t('Add search page'));
$this->drupalPostForm(NULL, $first, t('Save'));
$this->assertDefaultSearch($first_id, 'The default page matches the only search page.');
$this->assertRaw(t('The %label search page has been added.', array('%label' => $first['label'])));
// Attempt to add a search page with an existing path.
$edit = array();
$edit['search_type'] = 'search_extra_type_search';
$this->drupalPostForm(NULL, $edit, t('Add new page'));
$this->drupalPostForm(NULL, $edit, t('Add search page'));
$edit = array();
$edit['label'] = $this->randomString();
$edit['id'] = strtolower($this->randomMachineName(8));
$edit['path'] = $first['path'];
$this->drupalPostForm(NULL, $edit, t('Add search page'));
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText(t('The search page path must be unique.'));
// Add a second search page.
@ -263,7 +264,7 @@ class SearchConfigSettingsFormTest extends SearchTestBase {
$second['label'] = $this->randomString();
$second_id = $second['id'] = strtolower($this->randomMachineName(8));
$second['path'] = strtolower($this->randomMachineName(8));
$this->drupalPostForm(NULL, $second, t('Add search page'));
$this->drupalPostForm(NULL, $second, t('Save'));
$this->assertDefaultSearch($first_id, 'The default page matches the only search page.');
// Ensure both search pages have their tabs displayed.

View file

@ -6,6 +6,7 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\comment\Tests\CommentTestTrait;
use Drupal\Core\Url;
use Drupal\filter\Entity\FilterFormat;
use Drupal\search\Entity\SearchPage;
/**
* Indexes content and tests ranking factors.
@ -34,7 +35,7 @@ class SearchRankingTest extends SearchTestBase {
parent::setUp();
// Create a plugin instance.
$this->nodeSearch = entity_load('search_page', 'node_search');
$this->nodeSearch = SearchPage::load('node_search');
// Log in with sufficient privileges.
$this->drupalLogin($this->drupalCreateUser(array('post comments', 'skip comment approval', 'create page content', 'administer search')));
@ -126,7 +127,7 @@ class SearchRankingTest extends SearchTestBase {
$this->assertTrue($this->xpath('//select[@id="edit-rankings-' . $node_rank . '-value"]//option[@value="10"]'), 'Select list to prioritize ' . $node_rank . ' for node ranks is visible and set to 10.');
// Reload the plugin to get the up-to-date values.
$this->nodeSearch = entity_load('search_page', 'node_search');
$this->nodeSearch = SearchPage::load('node_search');
// Do the search and assert the results.
$this->nodeSearch->getPlugin()->setSearch('rocks', array(), array());
$set = $this->nodeSearch->getPlugin()->execute();

View file

@ -1,4 +1,5 @@
<?php
/**
* @file
* Test module setting up two tests, one for checking if the entity $langcode is