My view which has an 'Entity Reference' display won't show my 'NO RESULTS BEHAVIOUR'. If I add a new display to the view of, for example, page, the 'NO RESULTS BEHAVIOUR' shows up fine.

Is there something I'm missing or is this a bug?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

das-peter’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
4.02 KB

I just stumbled over this and decided to patch it up.
For now the "No Results Behavior" only works with another view with a entity reference display - and it's unlikely that we can change that.
The created code vastly bases on views_handler_area_view::render(). Unfortunately we can't re-use the method because we need access to the views object used to render, but the handler doesn't expose the object atm.

irowboat’s picture

Works for me. Thank you.

das-peter’s picture

Fixed an issue with the validator.

Chris Matthews’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 5 year old patch in #3 to EntityReference_SelectionHandler_Views.class.php and entityreference_plugin_display.inc does not apply to the latest 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch plugins/selection/EntityReference_SelectionHandler_Views.class.php...
Hunk #1 succeeded at 130 (offset 21 lines).
error: while searching for:
      // Get the results.
      $entities = $this->view->execute_display($display_name, $args);
      $result = array_keys($entities);
    }
    return $result;
  }

error: patch failed: plugins/selection/EntityReference_SelectionHandler_Views.class.php:139
error: plugins/selection/EntityReference_SelectionHandler_Views.class.php: patch does not apply

Checking patch views/entityreference_plugin_display.inc...
Neeraj420’s picture

Any update on this please?

I am facing similar issue, or is there any other workaround please.