diff --git a/config/optional/views.view.group_members.yml b/config/optional/views.view.group_members.yml index 24f6900c1f4c56fd9d26e5f96c593786dc57bc84..c8ea60fe24ade28010d4d180010df104f595ef82 100644 --- a/config/optional/views.view.group_members.yml +++ b/config/optional/views.view.group_members.yml @@ -652,9 +652,9 @@ display: group_type: group admin_label: 'Member account' required: true - group_content_plugins: + group_relation_plugins: group_membership: group_membership - plugin_id: group_content_to_entity + plugin_id: group_relationship_to_entity entity_type: group_relationship arguments: gid: diff --git a/config/schema/group.views.schema.yml b/config/schema/group.views.schema.yml index 597d759e97a70e6b0ec470fd1e86f81c665628b8..598f096c5b39fa0e79f49600a0a0aca4443eacd8 100644 --- a/config/schema/group.views.schema.yml +++ b/config/schema/group.views.schema.yml @@ -26,21 +26,21 @@ views.argument_default.group_id_from_url: views_relationship_with_group_plugin_filter: type: 'views_relationship' mapping: - group_content_plugins: + group_relation_plugins: type: 'sequence' label: 'Group relation plugins' sequence: type: 'string' label: 'Group relation plugin ID' -views.relationship.group_content_to_entity: +views.relationship.group_relationship_to_entity: type: 'views_relationship_with_group_plugin_filter' label: 'Group relationship to entity reference' -views.relationship.group_content_to_entity_reverse: +views.relationship.group_relationship_to_entity_reverse: type: 'views_relationship_with_group_plugin_filter' label: 'Reverse group relationship to entity reference' -views.relationship.group_to_group_content: +views.relationship.group_to_group_relationship: type: 'views_relationship_with_group_plugin_filter' label: 'Group to group relationship' diff --git a/group.views.inc b/group.views.inc index 4b48c35769d9a939d02358b0345a5ed5c8d274a8..9b60a88cb15ecd79954047c01c5d9dd73000d798 100644 --- a/group.views.inc +++ b/group.views.inc @@ -43,7 +43,7 @@ function group_views_data_alter(array &$data) { // This relationship will allow a content entity to easily map to the group // content entity that ties it to a group, optionally filtering by plugin. - $data[$entity_data_table]['group_content'] = [ + $data[$entity_data_table]['group_relationship'] = [ 'title' => t('Group relationship for @entity_type', $t_args), 'help' => t('Relates to the group relationship entities that represent the @entity_type.', $t_args), 'relationship' => [ @@ -51,7 +51,7 @@ function group_views_data_alter(array &$data) { 'base' => $data_table, 'base field' => 'entity_id', 'relationship field' => $entity_type->getKey('id'), - 'id' => 'group_content_to_entity_reverse', + 'id' => 'group_relationship_to_entity_reverse', 'label' => t('@entity_type group relationship', $t_args), ], ]; diff --git a/modules/gnode/config/optional/views.view.group_nodes.yml b/modules/gnode/config/optional/views.view.group_nodes.yml index 83c35e792d0141fcec54c94614ad7662cf72c1d5..806203972b840137f196700de1b8902a53cebade 100644 --- a/modules/gnode/config/optional/views.view.group_nodes.yml +++ b/modules/gnode/config/optional/views.view.group_nodes.yml @@ -858,23 +858,23 @@ display: content: 'No content available.' plugin_id: text_custom relationships: - group_content: - id: group_content + group_relationship: + id: group_relationship table: node_field_data - field: group_content + field: group_relationship relationship: none group_type: group admin_label: 'Content relation' required: true - group_content_plugins: { } + group_relation_plugins: { } entity_type: node - plugin_id: group_content_to_entity_reverse + plugin_id: group_relationship_to_entity_reverse arguments: gid: id: gid table: group_relationship_field_data field: gid - relationship: group_content + relationship: group_relationship group_type: group admin_label: '' default_action: 'access denied' diff --git a/src/Entity/Views/GroupRelationshipViewsData.php b/src/Entity/Views/GroupRelationshipViewsData.php index 7a5a07705222657f82972f2081fb40327a93a2b9..e44f5551e8ca40ea6605487431e3425922375881 100644 --- a/src/Entity/Views/GroupRelationshipViewsData.php +++ b/src/Entity/Views/GroupRelationshipViewsData.php @@ -65,7 +65,7 @@ class GroupRelationshipViewsData extends EntityViewsData { // Create a unique field name for this views field. $field_name = 'gc__' . $entity_type_id; - // We only add one 'group_content' relationship per entity type. + // We only add one 'group_relationship' relationship per entity type. if (isset($data[$entity_data_table][$field_name])) { continue; } @@ -84,7 +84,7 @@ class GroupRelationshipViewsData extends EntityViewsData { 'base' => $entity_data_table, 'base field' => $entity_type->getKey('id'), 'relationship field' => 'entity_id', - 'id' => 'group_content_to_entity', + 'id' => 'group_relationship_to_entity', 'label' => $this->t('Group relationship @entity_type', $t_args), 'target_entity_type' => $entity_type_id, ], diff --git a/src/Entity/Views/GroupViewsData.php b/src/Entity/Views/GroupViewsData.php index 6a971f7865d4064e909ca9ba3851e1fb839e9b24..3d225823838da2b60cf578c3ba68adafcc86372b 100644 --- a/src/Entity/Views/GroupViewsData.php +++ b/src/Entity/Views/GroupViewsData.php @@ -21,10 +21,10 @@ class GroupViewsData extends EntityViewsData { 'numeric' => TRUE, ]; - $data['groups_field_data']['group_content_id']['relationship'] = [ + $data['groups_field_data']['group_relationship_id']['relationship'] = [ 'title' => $this->t('Group relationship'), 'help' => $this->t('Relate to the group relationship entities. From there you can relate to the actual grouped entities.'), - 'id' => 'group_to_group_content', + 'id' => 'group_to_group_relationship', 'base' => 'group_relationship_field_data', 'base field' => 'gid', 'field' => 'id', diff --git a/src/Plugin/views/relationship/GroupRelationshipToEntity.php b/src/Plugin/views/relationship/GroupRelationshipToEntity.php index 2fb87668a39314950646babfd61091334336d760..8a76ad00fce1ba27644dd8c0ad51651609a7d329 100644 --- a/src/Plugin/views/relationship/GroupRelationshipToEntity.php +++ b/src/Plugin/views/relationship/GroupRelationshipToEntity.php @@ -10,7 +10,7 @@ namespace Drupal\group\Plugin\views\relationship; * * @ingroup views_relationship_handlers * - * @ViewsRelationship("group_content_to_entity") + * @ViewsRelationship("group_relationship_to_entity") */ class GroupRelationshipToEntity extends GroupRelationshipToEntityBase { diff --git a/src/Plugin/views/relationship/GroupRelationshipToEntityBase.php b/src/Plugin/views/relationship/GroupRelationshipToEntityBase.php index 4667b92c56dbc5e5ca225683df1d712f80e55300..36bd1cdd9766b43f6dd0663b06345b02ea238ac8 100644 --- a/src/Plugin/views/relationship/GroupRelationshipToEntityBase.php +++ b/src/Plugin/views/relationship/GroupRelationshipToEntityBase.php @@ -81,7 +81,7 @@ abstract class GroupRelationshipToEntityBase extends RelationshipPluginBase { */ protected function defineOptions() { $options = parent::defineOptions(); - $options['group_content_plugins']['default'] = []; + $options['group_relation_plugins']['default'] = []; return $options; } @@ -100,13 +100,13 @@ abstract class GroupRelationshipToEntityBase extends RelationshipPluginBase { } } - $form['group_content_plugins'] = [ + $form['group_relation_plugins'] = [ '#type' => 'checkboxes', '#title' => $this->t('Filter by plugin'), '#description' => $this->t('Refine the result by plugin. Leave empty to select all plugins, including those that could be added after this relationship was configured.'), '#options' => $options, '#weight' => -2, - '#default_value' => $this->options['group_content_plugins'], + '#default_value' => $this->options['group_relation_plugins'], ]; } @@ -135,7 +135,7 @@ abstract class GroupRelationshipToEntityBase extends RelationshipPluginBase { } // Add the plugin IDs to the query if any were selected. - $plugin_ids = array_filter($this->options['group_content_plugins']); + $plugin_ids = array_filter($this->options['group_relation_plugins']); if (!empty($plugin_ids)) { $def['extra'][] = [ $this->getJoinFieldType() => 'plugin_id', diff --git a/src/Plugin/views/relationship/GroupRelationshipToEntityReverse.php b/src/Plugin/views/relationship/GroupRelationshipToEntityReverse.php index 3edd53662188df6dd32d34977ff1cddf0a111333..f75c9cdcb8aaa863d86aaf8da4c8dfc4a8a41882 100644 --- a/src/Plugin/views/relationship/GroupRelationshipToEntityReverse.php +++ b/src/Plugin/views/relationship/GroupRelationshipToEntityReverse.php @@ -7,7 +7,7 @@ namespace Drupal\group\Plugin\views\relationship; * * @ingroup views_relationship_handlers * - * @ViewsRelationship("group_content_to_entity_reverse") + * @ViewsRelationship("group_relationship_to_entity_reverse") */ class GroupRelationshipToEntityReverse extends GroupRelationshipToEntityBase { diff --git a/src/Plugin/views/relationship/GroupToGroupRelationship.php b/src/Plugin/views/relationship/GroupToGroupRelationship.php index a1acb9691bd1f23a2783a48c8ff3882416650e2f..3a3a3a101906e184f7b7672c89303ccd165a0a21 100644 --- a/src/Plugin/views/relationship/GroupToGroupRelationship.php +++ b/src/Plugin/views/relationship/GroupToGroupRelationship.php @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * * @ingroup views_relationship_handlers * - * @ViewsRelationship("group_to_group_content") + * @ViewsRelationship("group_to_group_relationship") */ class GroupToGroupRelationship extends RelationshipPluginBase { @@ -64,7 +64,7 @@ class GroupToGroupRelationship extends RelationshipPluginBase { */ protected function defineOptions() { $options = parent::defineOptions(); - $options['group_content_plugins']['default'] = []; + $options['group_relation_plugins']['default'] = []; return $options; } @@ -74,13 +74,13 @@ class GroupToGroupRelationship extends RelationshipPluginBase { public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); - $form['group_content_plugins'] = [ + $form['group_relation_plugins'] = [ '#type' => 'checkboxes', '#title' => $this->t('Filter by plugin'), '#description' => $this->t('Refine the result by plugin. Leave empty to select all plugins, including those that could be added after this relationship was configured.'), '#options' => $this->getPluginOptions(), '#weight' => -2, - '#default_value' => $this->options['group_content_plugins'], + '#default_value' => $this->options['group_relation_plugins'], ]; } @@ -124,7 +124,7 @@ class GroupToGroupRelationship extends RelationshipPluginBase { } // Add the plugin IDs to the query if any were selected. - $plugin_ids = array_filter($this->options['group_content_plugins']); + $plugin_ids = array_filter($this->options['group_relation_plugins']); if (!empty($plugin_ids)) { $def['extra'][] = [ 'field' => 'plugin_id', diff --git a/tests/modules/group_test_views/test_views/views.view.test_group_content_to_entity_relationship.yml b/tests/modules/group_test_views/test_views/views.view.test_group_relationship_to_entity_relationship.yml similarity index 96% rename from tests/modules/group_test_views/test_views/views.view.test_group_content_to_entity_relationship.yml rename to tests/modules/group_test_views/test_views/views.view.test_group_relationship_to_entity_relationship.yml index fbfa072cdd68c3eb9d9fdb29b9a203405018c9c7..873cf91335e3384784ad81e676a8bf75fb4b3568 100644 --- a/tests/modules/group_test_views/test_views/views.view.test_group_content_to_entity_relationship.yml +++ b/tests/modules/group_test_views/test_views/views.view.test_group_relationship_to_entity_relationship.yml @@ -4,8 +4,8 @@ dependencies: module: - group - user -id: test_group_content_to_entity_relationship -label: test_group_content_to_entity_relationship +id: test_group_relationship_to_entity_relationship +label: test_group_relationship_to_entity_relationship module: views description: '' tag: '' @@ -208,10 +208,10 @@ display: group_type: group admin_label: 'Group relationship User' required: true - group_content_plugins: + group_relation_plugins: group_membership: group_membership - entity_type: group_content - plugin_id: group_content_to_entity + entity_type: group_relationship + plugin_id: group_relationship_to_entity arguments: { } display_extenders: { } cache_metadata: diff --git a/tests/modules/group_test_views/test_views/views.view.test_group_content_to_entity_reverse_relationship.yml b/tests/modules/group_test_views/test_views/views.view.test_group_relationship_to_entity_reverse_relationship.yml similarity index 94% rename from tests/modules/group_test_views/test_views/views.view.test_group_content_to_entity_reverse_relationship.yml rename to tests/modules/group_test_views/test_views/views.view.test_group_relationship_to_entity_reverse_relationship.yml index c6234acbe39e3651dffaba57604d34ff28ae3d21..d6d98a2735aa333f38ed0c2353cd1bdc25cc3a5e 100644 --- a/tests/modules/group_test_views/test_views/views.view.test_group_content_to_entity_reverse_relationship.yml +++ b/tests/modules/group_test_views/test_views/views.view.test_group_relationship_to_entity_reverse_relationship.yml @@ -4,8 +4,8 @@ dependencies: module: - group - user -id: test_group_content_to_entity_reverse_relationship -label: test_group_content_to_entity_reverse_relationship +id: test_group_relationship_to_entity_reverse_relationship +label: test_group_relationship_to_entity_reverse_relationship module: views description: '' tag: '' @@ -81,7 +81,7 @@ display: id: id table: group_relationship_field_data field: id - relationship: group_content + relationship: group_relationship group_type: group admin_label: '' label: 'Group relationship ID' @@ -215,18 +215,18 @@ display: footer: { } empty: { } relationships: - group_content: - id: group_content + group_relationship: + id: group_relationship table: users_field_data - field: group_content + field: group_relationship relationship: none group_type: group admin_label: 'User group relationships' required: true - group_content_plugins: + group_relation_plugins: group_membership: group_membership entity_type: user - plugin_id: group_content_to_entity_reverse + plugin_id: group_relationship_to_entity_reverse arguments: { } display_extenders: { } cache_metadata: diff --git a/tests/modules/group_test_views/test_views/views.view.test_group_to_group_content_relationship.yml b/tests/modules/group_test_views/test_views/views.view.test_group_to_group_relationship_relationship.yml similarity index 94% rename from tests/modules/group_test_views/test_views/views.view.test_group_to_group_content_relationship.yml rename to tests/modules/group_test_views/test_views/views.view.test_group_to_group_relationship_relationship.yml index 73dc153ce4a3f390d5b86c25fabe5c12be24f875..7b174009d553eee17a97d4fbbe35c8ab7eb0ab6b 100644 --- a/tests/modules/group_test_views/test_views/views.view.test_group_to_group_content_relationship.yml +++ b/tests/modules/group_test_views/test_views/views.view.test_group_to_group_relationship_relationship.yml @@ -3,8 +3,8 @@ status: true dependencies: module: - group -id: test_group_to_group_content_relationship -label: test_group_to_group_content_relationship +id: test_group_to_group_relationship_relationship +label: test_group_to_group_relationship_relationship module: views description: '' tag: '' @@ -131,7 +131,7 @@ display: id: id_1 table: group_relationship_field_data field: id - relationship: group_content_id + relationship: group_relationship_id group_type: group admin_label: '' label: 'Group relationship ID' @@ -199,18 +199,18 @@ display: footer: { } empty: { } relationships: - group_content_id: - id: group_content_id + group_relationship_id: + id: group_relationship_id table: groups_field_data - field: group_content_id + field: group_relationship_id relationship: none group_type: group admin_label: 'Group relationship' required: true - group_content_plugins: + group_relation_plugins: group_membership: group_membership entity_type: group - plugin_id: group_to_group_content + plugin_id: group_to_group_relationship arguments: { } display_extenders: { } cache_metadata: diff --git a/tests/src/Kernel/Views/GroupRelationshipToEntityRelationshipTest.php b/tests/src/Kernel/Views/GroupRelationshipToEntityRelationshipTest.php index 91e32e3be158242618393fa6941007eb8dcf7681..d25de27f6db4f2f3e278167f791dcb9ead9c70bc 100644 --- a/tests/src/Kernel/Views/GroupRelationshipToEntityRelationshipTest.php +++ b/tests/src/Kernel/Views/GroupRelationshipToEntityRelationshipTest.php @@ -5,7 +5,7 @@ namespace Drupal\Tests\group\Kernel\Views; use Drupal\group\Entity\Storage\GroupRelationshipTypeStorageInterface; /** - * Tests the group_content_to_entity relationship handler. + * Tests the group_relationship_to_entity relationship handler. * * @see \Drupal\group\Plugin\views\relationship\GroupRelationshipToEntity * @@ -23,7 +23,7 @@ class GroupRelationshipToEntityRelationshipTest extends GroupViewsKernelTestBase * * @var array */ - public static $testViews = ['test_group_content_to_entity_relationship']; + public static $testViews = ['test_group_relationship_to_entity_relationship']; /** * {@inheritdoc} diff --git a/tests/src/Kernel/Views/GroupRelationshipToEntityReverseRelationshipTest.php b/tests/src/Kernel/Views/GroupRelationshipToEntityReverseRelationshipTest.php index 877a4e8d559c2afe78a63f75f98a929070e8d9c9..8bf88cfb43b7f9d3dc1689de8e27bfc17f481b45 100644 --- a/tests/src/Kernel/Views/GroupRelationshipToEntityReverseRelationshipTest.php +++ b/tests/src/Kernel/Views/GroupRelationshipToEntityReverseRelationshipTest.php @@ -3,7 +3,7 @@ namespace Drupal\Tests\group\Kernel\Views; /** - * Tests the group_content_to_entity_reverse relationship handler. + * Tests the group_relationship_to_entity_reverse relationship handler. * * @see \Drupal\group\Plugin\views\relationship\GroupRelationshipToEntityReverse * @@ -16,6 +16,6 @@ class GroupRelationshipToEntityReverseRelationshipTest extends GroupRelationship * * @var array */ - public static $testViews = ['test_group_content_to_entity_reverse_relationship']; + public static $testViews = ['test_group_relationship_to_entity_reverse_relationship']; } diff --git a/tests/src/Kernel/Views/GroupToGroupRelationshipRelationshipTest.php b/tests/src/Kernel/Views/GroupToGroupRelationshipRelationshipTest.php index 35b686e2066367ed631c37413ccf362fb2b54899..fb6fbc9942e967a6ecb02ed6a3e092a81ed330c3 100644 --- a/tests/src/Kernel/Views/GroupToGroupRelationshipRelationshipTest.php +++ b/tests/src/Kernel/Views/GroupToGroupRelationshipRelationshipTest.php @@ -5,7 +5,7 @@ namespace Drupal\Tests\group\Kernel\Views; use Drupal\group\Entity\Storage\GroupRelationshipTypeStorageInterface; /** - * Tests the group_to_group_content relationship handler. + * Tests the group_to_group_relationship relationship handler. * * @see \Drupal\group\Plugin\views\relationship\GroupToGroupRelationship * @@ -23,7 +23,7 @@ class GroupToGroupRelationshipRelationshipTest extends GroupViewsKernelTestBase * * @var array */ - public static $testViews = ['test_group_to_group_content_relationship']; + public static $testViews = ['test_group_to_group_relationship_relationship']; /** * {@inheritdoc}