3

I have created an entity reference view to display the values of a multi value field in Drupal 8.

The field is a date field.

In the view I have set the "Multiple Field Settings" so the date field values will be shown in separate rows.

When I preview the view, I can all of the date values shown is separate rows as expected.

I then create an entity reference field and select the view as its reference type /view.

The problem is, when I then view this field, I am only shown a single value instead of all the dates as seperate rows.

How do I setup a multi value field so I can select from all of its values in an entity reference field?

Thanks in advance.

1

Try to use Entity Reference Views Select module. For me it worked when I had the same issue.

  • I am using Entity Reference Views Select but it only returns one date value instead of all dates in the multi value field. Were you able to get it to work with multi value fields? – Daniel Jordan Jul 31 '17 at 12:32
  • Hm... I had so I had to write some custom code. I couldn't find some hook so what I did was to copy the folder and create 'my custom' module. The $row->_entity->id() is always the same, so what I did, after $output = $this->renderer->render($row_output); was to check if the field is my (multi value field) and for the specific field fetch the id $options[$out_id] = $out_val; I'm not sure if this is the correct way but I had to make it work and it did! – Ismini Jul 31 '17 at 12:43
  • Thanks. I have used same approach. Copied module and generated select options from field – Daniel Jordan Jul 31 '17 at 15:10
  • 1
    I have created an issue and quick patch for the problem at hand drupal.org/node/2898873#comment-12191060 – Daniel Jordan Aug 1 '17 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.