Skip to content

Commit

Permalink
Add back in Entity in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool committed Jan 19, 2022
1 parent 0ef6335 commit f3d9167
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions entityreference.module
Expand Up @@ -13,7 +13,7 @@ define('ENTITYREFERENCE_DENIED', '- Restricted access -');
function entityreference_field_info() {
return array(
'entityreference' => array(
'label' => 'Reference',
'label' => 'Entity Reference',
'description' => t('Defines a field type for referencing other entities.'),
'settings' => array(
'target_type' => 'node',
Expand Down Expand Up @@ -1433,7 +1433,7 @@ function entityreference_entityreference_selection_plugins() {
);
if (module_exists('views')) {
$plugins['views'] = array(
'title' => t('Views: Filter by a reference view'),
'title' => t('Views: Filter by an entity reference view'),
'class' => 'EntityReferenceSelectionHandlerViews',
'weight' => 0,
);
Expand Down
2 changes: 1 addition & 1 deletion plugins/selection/EntityReferenceSelectionHandlerViews.inc
Expand Up @@ -52,7 +52,7 @@ class EntityReferenceSelectionHandlerViews implements EntityReferenceSelectionHa
'#required' => TRUE,
'#options' => $options,
'#default_value' => $default,
'#description' => '<p>' . t('Choose the view and display that select the entities that can be referenced.<br />Only views with a display of type "Reference" are eligible.') . '</p>',
'#description' => '<p>' . t('Choose the view and display that select the entities that can be referenced.<br />Only views with a display of type "Entity Reference" are eligible.') . '</p>',
);

$default = !empty($view_settings['args']) ? implode(', ', $view_settings['args']) : '';
Expand Down
8 changes: 4 additions & 4 deletions views/entityreference.views.inc
Expand Up @@ -25,7 +25,7 @@ function entityreference_field_views_data($field) {
'base' => $entity_info['base table'],
'base field' => $entity_info['entity keys']['id'],
'label' => t('@entity referenced from !field_name', $parameters),
'group' => t('Reference'),
'group' => t('Entity Reference'),
'title' => t('Referenced Entity'),
'help' => t('A bridge to the @entity entity that is referenced via !field_name', $parameters),
);
Expand Down Expand Up @@ -77,7 +77,7 @@ function entityreference_field_views_data_views_data_alter(&$data, $field) {
'base' => $entity_info['base table'],
'base field' => $entity_info['entity keys']['id'],
'label' => t('@entity referencing @target_entity from !field_name', $replacements),
'group' => t('Reference'),
'group' => t('Entity Reference'),
'title' => t('Referencing entity'),
'help' => t('A bridge to the @entity entity that is referencing @target_entity via !field_name', $replacements),
'join_extra' => array(
Expand All @@ -103,7 +103,7 @@ function entityreference_views_plugins() {
$plugins = array(
'display' => array(
'entityreference' => array(
'title' => t('Reference'),
'title' => t('Entity Reference'),
'admin' => t('Reference Source'),
'help' => 'Selects referenceable entities for a reference field',
'handler' => 'entityreference_plugin_display',
Expand All @@ -118,7 +118,7 @@ function entityreference_views_plugins() {
),
'style' => array(
'entityreference_style' => array(
'title' => t('Reference list'),
'title' => t('Entity Reference list'),
'help' => 'Returns results as a list of labels and rendered rows.',
'handler' => 'entityreference_plugin_style',
'theme' => 'views_view_unformatted',
Expand Down
4 changes: 2 additions & 2 deletions views/entityreference_plugin_display.inc
Expand Up @@ -111,15 +111,15 @@ class entityreference_plugin_display extends views_plugin_display {
// Verify that search fields are set up.
$style_options = $this->get_option('style_options');
if (!isset($style_options['search_fields'])) {
$errors[] = t('Display "@display" needs a selected search fields to work properly. See the settings for the Reference list format.', array('@display' => $this->display->display_title));
$errors[] = t('Display "@display" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title));
}
else {
// Verify that the search fields used actually exist.
//$fields = array_keys($this->view->get_items('field'));
$fields = array_keys($this->handlers['field']);
foreach ($style_options['search_fields'] as $field_alias => $enabled) {
if ($enabled && !in_array($field_alias, $fields)) {
$errors[] = t('Display "@display" uses field %field as search field, but the field is no longer present. See the settings for the Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));
$errors[] = t('Display "@display" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion views/entityreference_plugin_row_fields.inc
Expand Up @@ -21,7 +21,7 @@ class entityreference_plugin_row_fields extends views_plugin_row_fields {
parent::options_form($form, $form_state);

// Expand the description of the 'Inline field' checkboxes.
$form['inline']['#description'] .= '<br />' . t("<strong>Note:</strong> In 'Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
$form['inline']['#description'] .= '<br />' . t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
}

function pre_render($row) {
Expand Down

0 comments on commit f3d9167

Please sign in to comment.