Problem/Motivation

Function list_allowed_values removed long ago but this plugin still using it

  public function getValueOptions() {
    $field_storage_definitions = \Drupal::entityManager()->getFieldStorageDefinitions($this->definition['entity_type']);
    $field_storage = $field_storage_definitions[$this->definition['field_name']];
    $this->valueOptions = list_allowed_values($field_storage);
  }

Proposed resolution

fix implementation and add tests

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

hussainweb’s picture

Status: Active » Needs review
FileSize
724 bytes

Just the fix for now.

hussainweb’s picture

Is there a test which I can refer/copy for this?

andypost’s picture

I found no tests about this plugin

dawehner’s picture

I found no tests about this plugin

Well kinda obviously, given that otherwise the tests would have failed, wouldn't have they?

andypost’s picture

@dawehner I have no idea how this plugin *could be* used...

cilefen’s picture

#5 ha

yched’s picture

Oh gee. Doesn't this mean that this class is just useless dead code ? (

damiankloip’s picture

damiankloip’s picture

yched’s picture

So this is on the 'field_list' filter, but nothing ever seems to reference that filter, what is it ever used for ?

Plus, on HEAD :
- If I add a "List (text)" field to article nodes with options a, b, c
- and edit admin/structure/views/view/frontpage,
- I can add a filter on the feld, which presents me the right options (a, b, c),
- and the filter works as expected.

So it seems the functionnality is present, and is not provided by this obviously broken plugin here ?

yched’s picture

It seems we have :
\Drupal\options\Plugin\views\filter\ListField (looks correct, and is exposed by options_field_views_data())
and
\Drupal\views\Plugin\views\filter\FieldList (is the broken one discussed here, not exposed anywhere by anyone)

So, isn't this just "rm \Drupal\views\Plugin\views\filter\FieldList" ?

longwave’s picture

I think \Drupal\views\Plugin\views\argument\FieldList can be removed as well, as that has also been replaced by \Drupal\options\Plugin\views\argument\NumberListField, and \Drupal\views\Plugin\views\argument\ListString has been replaced by \Drupal\options\Plugin\views\argument\StringListField.

The only thing I can find that refers to these is field.views.schema.yml (in the wrong module anyway?) and so it seems this can all be safely removed.

longwave’s picture

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

As @damienkloip said in #9, this is related to #2012130: Regression: Views integration for "list" field types is broken. In the patches before comment #68, these 3 files were deleted, but after a reroll in #68 the deletions were no longer in the patches (but should have been).

So it's indeed just leftover orphaned code.

  • alexpott committed d7d1dfa on 8.0.x
    Issue #2578433 by longwave, hussainweb: \Drupal\views\Plugin\views\...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed d7d1dfa and pushed to 8.0.x. Thanks!

I did not ask for an upgrade patch because these plugins were just broken.

Status: Fixed » Closed (fixed)

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