Hi,
If I select "entity reference views select list" the select tag has not the first empty select (- choose the value -) also if the field is not required.
So I can't select an empty value for a field when I create a node.

CommentFileSizeAuthor
#3 ervs-emptyvalue-2943488-3-8x.patch781 bytesel1_1el

Comments

ConradFlashback created an issue. See original summary.

ConradFlashback’s picture

Issue summary: View changes
el1_1el’s picture

Assigned: Unassigned » el1_1el
Status: Active » Needs review
StatusFileSize
new781 bytes

surprised no one else noticed that. try this patch and lemme know.

youll have to change the default value at admin/structure/types/manage/[content_type]/fields/[field_name} also

ConradFlashback’s picture

Thanks for the fast reply el1_1el.
The patch works well.

  • el1_1el authored d0f810b on 8.x-1.x
    Issue #2943488 by el1_1el: Entity reference views select list not empty...
el1_1el’s picture

Status: Needs review » Fixed

committed to dev branch

Status: Fixed » Closed (fixed)

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

marceldeb’s picture

Version: 8.x-1.2 » 8.x-1.3

Im just commenting on this because this is still an issue in v1.3

Patch does work but not applied in production version

el1_1el’s picture

I just checked both the zip and tar of v1.3 and found

      // Add an empty option if the widget needs one.
      if ($empty_label = $this->getEmptyLabel()) {
        $options = ['_none' => $empty_label] + $options;
      }

in EntityReferenceViewsOptionsSelectWidget.php which is all that was in the patch. If that isnt working, reopen the issue. Thanks!