Commit e53bf1fd authored by alexpott's avatar alexpott

Issue #2644554 by sergei_brill: Second argument of method...

Issue #2644554 by sergei_brill: Second argument of method OptionsWidgetBase::getSelectedOptions(FieldItemListInterface $items, $delta = 0) is not used in the method
parent a2e9644f
......@@ -37,7 +37,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
$element += array(
'#type' => 'select',
'#options' => $this->getOptions($items->getEntity()),
'#default_value' => $this->getSelectedOptions($items, $delta),
'#default_value' => $this->getSelectedOptions($items),
// Do not display a 'multiple' select box if there is only one option.
'#multiple' => $this->multiple && count($this->options) > 1,
);
......
......@@ -150,13 +150,11 @@ protected function getOptions(FieldableEntityInterface $entity) {
*
* @param \Drupal\Core\Field\FieldItemListInterface $items
* The field values.
* @param int $delta
* (optional) The delta of the item to get options for. Defaults to 0.
*
* @return array
* The array of corresponding selected options.
*/
protected function getSelectedOptions(FieldItemListInterface $items, $delta = 0) {
protected function getSelectedOptions(FieldItemListInterface $items) {
// We need to check against a flat list of options.
$flat_options = OptGroup::flattenOptions($this->getOptions($items->getEntity()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment