Update to Drupal 8.0.5. For more information, see https://www.drupal.org/node/2679347

This commit is contained in:
Pantheon Automation 2016-03-02 12:40:24 -08:00 committed by Greg Anderson
parent 2a9f1f148d
commit fd3b12cf27
251 changed files with 5439 additions and 957 deletions

View file

@ -59,6 +59,9 @@ views.argument_validator.taxonomy_term_name:
sequence:
type: string
label: 'Vocabulary'
transform:
type: boolean
label: 'Transform dashes in URL to spaces in term name filter values'
views.argument_default.taxonomy_tid:
type: mapping

View file

@ -271,8 +271,10 @@ class TaxonomyIndexTid extends ManyToOne {
}
$tids = array();
foreach ($form_state->getValue(array('options', 'value')) as $value) {
$tids[] = $value['target_id'];
if ($values = $form_state->getValue(array('options', 'value'))) {
foreach ($values as $value) {
$tids[] = $value['target_id'];
}
}
$form_state->setValue(array('options', 'value'), $tids);
}
@ -335,8 +337,10 @@ class TaxonomyIndexTid extends ManyToOne {
return;
}
foreach ($form_state->getValue($identifier) as $value) {
$this->validated_exposed_input[] = $value['target_id'];
if ($values = $form_state->getValue($identifier)) {
foreach ($values as $value) {
$this->validated_exposed_input[] = $value['target_id'];
}
}
}

View file

@ -83,7 +83,7 @@ interface TermStorageInterface extends ContentEntityStorageInterface {
* table to save execution time and memory consumption when listing large
* numbers of terms. Defaults to FALSE.
*
* @return \Drupal\taxonomy\TermInterface[]
* @return object[]|\Drupal\taxonomy\TermInterface[]
* An array of term objects that are the children of the vocabulary $vid.
*/
public function loadTree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE);

View file

@ -28,14 +28,14 @@ class TaxonomyIndexTidUiTest extends UITestBase {
*
* @var array
*/
public static $testViews = array('test_filter_taxonomy_index_tid');
public static $testViews = array('test_filter_taxonomy_index_tid', 'test_taxonomy_term_name');
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['node', 'taxonomy', 'taxonomy_test_views'];
public static $modules = ['node', 'taxonomy', 'views', 'views_ui', 'taxonomy_test_views'];
/**
* A nested array of \Drupal\taxonomy\TermInterface objects.
@ -50,6 +50,9 @@ class TaxonomyIndexTidUiTest extends UITestBase {
protected function setUp() {
parent::setUp();
$this->adminUser = $this->drupalCreateUser(['administer taxonomy', 'administer views']);
$this->drupalLogin($this->adminUser);
Vocabulary::create([
'vid' => 'tags',
'name' => 'Tags',
@ -73,6 +76,11 @@ class TaxonomyIndexTidUiTest extends UITestBase {
}
}
ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views'));
Vocabulary::create([
'vid' => 'empty_vocabulary',
'name' => 'Empty Vocabulary',
])->save();
}
/**
@ -189,6 +197,29 @@ class TaxonomyIndexTidUiTest extends UITestBase {
$this->assertIdentical(1, count($xpath));
$xpath = $this->xpath('//div[@class="view-content"]//a[@href=:href]', [':href' => $node4->url()]);
$this->assertIdentical(1, count($xpath));
// Select 'Term ID' as the field to be displayed.
$edit = ['name[taxonomy_term_field_data.tid]' => TRUE];
$this->drupalPostForm('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/field', $edit, 'Add and configure fields');
// Select 'Term' and 'Vocabulary' as filters.
$edit = [
'name[taxonomy_term_field_data.tid]' => TRUE,
'name[taxonomy_term_field_data.vid]' => TRUE
];
$this->drupalPostForm('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/filter', $edit, 'Add and configure filter criteria');
// Select 'Empty Vocabulary' and 'Autocomplete' from the list of options.
$this->drupalPostForm('admin/structure/views/nojs/handler-extra/test_taxonomy_term_name/default/filter/tid', [], 'Apply and continue');
// Expose the filter.
$edit = ['options[expose_button][checkbox][checkbox]' => TRUE];
$this->drupalPostForm('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid', $edit, 'Expose filter');
$this->drupalPostForm('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid', $edit, 'Apply');
// Filter 'Taxonomy terms' belonging to 'Empty Vocabulary'.
$edit = ['options[value][empty_vocabulary]' => TRUE];
$this->drupalPostForm('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/vid', $edit, 'Apply');
$this->drupalPostForm('admin/structure/views/view/test_taxonomy_term_name/edit/default', [], 'Save');
$this->drupalPostForm(NULL, [], t('Update preview'));
$preview = $this->xpath("//div[@class='view-content']");
$this->assertTrue(empty($preview), 'No results.');
}
}

View file

@ -55,6 +55,9 @@ abstract class TaxonomyTestBase extends ViewTestBase {
*/
protected $term2;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->mockStandardInstall();
@ -119,10 +122,17 @@ abstract class TaxonomyTestBase extends ViewTestBase {
}
/**
* Returns a new term with random properties in vocabulary $vid.
* Creates and returns a taxonomy term.
*
* @param array $settings
* (Optional) An associative array of settings to pass to `entity_create`.
* (optional) An array of values to override the following default
* properties of the term:
* - name: A random string.
* - description: A random string.
* - format: First available text format.
* - vid: Vocabulary ID of self::$vocabulary object.
* - langcode: LANGCODE_NOT_SPECIFIED.
* Defaults to an empty array.
*
* @return \Drupal\taxonomy\Entity\Term
* The created taxonomy term.