diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php index 9327aa5..f26c256 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php @@ -22,12 +22,12 @@ * * @Plugin( * id = "entity_reference", - * title = @Translation("EntityReference"), + * title = @Translation("Entity Reference"), * admin = @Translation("Entity Reference Source"), * help = @Translation("Selects referenceable entities for an entity reference field."), * theme = "views_view", * uses_hook_menu = FALSE, - * entity_reference_display = TRUE + * entity_reference_display = TRUE * ) */ class EntityReference extends DisplayPluginBase { diff --git a/core/modules/user/lib/Drupal/user/Plugin/entity_reference/selection/UserSelection.php b/core/modules/user/lib/Drupal/user/Plugin/entity_reference/selection/UserSelection.php index 02e79ed..6c7c7b6 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/entity_reference/selection/UserSelection.php +++ b/core/modules/user/lib/Drupal/user/Plugin/entity_reference/selection/UserSelection.php @@ -69,7 +69,7 @@ public static function settingsForm(&$field, &$instance) { '#type' => 'checkboxes', '#title' => t('Restrict to the selected roles'), '#required' => TRUE, - '#options' => user_role_names(TRUE), + '#options' => array_diff_key(user_role_names(TRUE), drupal_map_assoc(array(DRUPAL_AUTHENTICATED_RID))), '#default_value' => $instance['settings']['handler_settings']['filter']['role'], ); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php b/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php index af709df..a36983d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php +++ b/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php @@ -18,7 +18,7 @@ * * @Plugin( * id = "views", - * module = "entity_reference", + * module = "views", * label = @Translation("Views: Filter by an entity reference view"), * group = "views", * weight = 0 @@ -123,7 +123,8 @@ protected function initializeView($match = NULL, $match_operator = 'CONTAINS', $ // Check that the view is valid and the display still exists. $this->view = views_get_view($view_name); if (!$this->view || !$this->view->access($display_name)) { - throw new \RuntimeException(t('The view %view_name is no longer eligible for the %field_name field.', array('%view_name' => $view_name, '%field_name' => $this->instance['label']))); + drupal_set_message(t('The reference view %view_name used in the %field_name field cannot be found.', array('%view_name' => $view_name, '%field_name' => $this->instance['label'])), 'warning'); + return FALSE; } $this->view->setDisplay($display_name);