Problem/Motivation

Now that we have a generic 'entity_autocomplete' form element, TermAutocompleteController::autocompletePerVid() is completely useless.

Proposed resolution

Convert its usage to 'entity_autocomplete' and remove all the dead code.

Remaining tasks

None.

User interface changes

Nope.

API changes

Nope.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Prioritized changes Follow-up for a critical issue #1959806: Provide a generic 'entity_autocomplete' Form API element.
CommentFileSizeAuthor
#1 2428881.patch11.24 KBamateescu

Comments

amateescu’s picture

Status: Active » Needs review
StatusFileSize
new11.24 KB

5 files changed, 15 insertions(+), 217 deletions(-) :)

wim leers’s picture

-class ViewsTaxonomyAutocompleteTest extends ViewTestBase {

Devil's advocate: why not keep this test?

amateescu’s picture

Because the thing it's testing doesn't exist anymore and we already have tests for 'entity_autocomplete'.

wim leers’s picture

It looks great to me. I think a Views person should RTBC this though.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Pretty straight forward nice clean up new entity_autocomplete element++

andypost’s picture

+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -159,26 +160,19 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
+      $terms = $this->value ? Term::loadMultiple(($this->value)) : array();

just a nit, extra (()) could be fixed on re-roll/commit

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 30ea8f7 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
index 573448d..05cc092 100644
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -160,7 +160,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
     }
 
     if ($this->options['type'] == 'textfield') {
-      $terms = $this->value ? Term::loadMultiple(($this->value)) : array();
+      $terms = $this->value ? Term::loadMultiple($this->value) : array();
       $form['value'] = array(
         '#title' => $this->options['limit'] ? $this->t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->label())) : $this->t('Select terms'),
         '#type' => 'textfield',

Fixed on commit.

  • alexpott committed 30ea8f7 on 8.0.x
    Issue #2428881 by amateescu: Remove TermAutocompleteController::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.