diff --git a/tests/features/joinup_group/group.delete_with_content.feature b/tests/features/joinup_group/group.delete_with_content.feature deleted file mode 100644 index 063429b11e86d7291125d0b98554046037b18529..0000000000000000000000000000000000000000 --- a/tests/features/joinup_group/group.delete_with_content.feature +++ /dev/null @@ -1,34 +0,0 @@ -@api @group-e -Feature: - In order to not leave orphaned entities - As a collection owner - I need to be unable to delete groups that have group content. - - Scenario Outline: Delete a group with group content - Given <group type> content: - | title | state | - | <group label> with children | <state> | - And news content: - | title | state | - | News | published | - And event content: - | title | state | - | Event | published | - And document content: - | title | state | - | Document | published | - And discussion content: - | title | state | - | Discussion | published | - - When I am logged in as a moderator - And I go to the delete form of the "<group label> with children" <group type> - And I press "Delete" - Then I should see the text "The <group label> <group label> with children has been deleted." - When I go to the "Discussion" discussion - Then I should not see the heading "Discussion" - - Examples: - | group label | group type | - | Collection | collection | - | Solution | solution | diff --git a/tests/src/Context/DebugContext.php b/tests/src/Context/DebugContext.php index cc1c071a942ac9306244082bad0e44742173d90e..1e0c6289913939bcd2e9ed950eeba16c0cd1a927 100644 --- a/tests/src/Context/DebugContext.php +++ b/tests/src/Context/DebugContext.php @@ -31,13 +31,13 @@ public function printMessages(): void { */ public function noOprhanedContentShouldExistInTheWebsite(): void { $query = <<<SQL -SELECT n1.nid, n1.type, n1.title, n2.type, n2.title -FROM node_field_data n1 - LEFT JOIN node__og_audience oa ON n1.nid = oa.entity_id - LEFT JOIN node_field_data n2 ON oa.og_audience_target_id = n2.nid -WHERE n1.type IN('news', 'discussion', 'document', 'event', 'solution', 'distribution', 'release') - AND n2.nid IS NULL -SQL; + SELECT n1.nid, n1.type, n1.title, n2.type, n2.title + FROM node_field_data n1 + LEFT JOIN node__og_audience oa ON n1.nid = oa.entity_id + LEFT JOIN node_field_data n2 ON oa.og_audience_target_id = n2.nid + WHERE n1.type IN('news', 'discussion', 'document', 'event', 'solution', 'distribution', 'release') + AND n2.nid IS NULL + SQL; $nids = \Drupal::database()->query($query)->fetchCol(); if (!empty($nids)) { diff --git a/web/modules/custom/joinup_core/joinup_core.deploy.php b/web/modules/custom/joinup_core/joinup_core.deploy.php index f7429ad7f866ca3b5ea76f39dbab31c1585ac43a..19b32e7fb33292f3d6df48708652133d9fe62d2c 100644 --- a/web/modules/custom/joinup_core/joinup_core.deploy.php +++ b/web/modules/custom/joinup_core/joinup_core.deploy.php @@ -190,18 +190,15 @@ function joinup_core_deploy_200304(): string { function joinup_core_deploy_200305(array &$sandbox): string { if (empty($sandbox['nids'])) { $query = <<<SQL -SELECT n1.nid, n1.type, n1.title, n2.type, n2.title -FROM node_field_data n1 - LEFT JOIN node__og_audience oa ON n1.nid = oa.entity_id - LEFT JOIN node_field_data n2 ON oa.og_audience_target_id = n2.nid -WHERE n1.type IN('news', 'discussion', 'document', 'event', 'solution', 'distribution', 'release') - AND n2.nid IS NULL -SQL; + SELECT n1.nid, n1.type, n1.title, n2.type, n2.title + FROM node_field_data n1 + LEFT JOIN node__og_audience oa ON n1.nid = oa.entity_id + LEFT JOIN node_field_data n2 ON oa.og_audience_target_id = n2.nid + WHERE n1.type IN('news', 'discussion', 'document', 'event', 'solution', 'distribution', 'release') + AND n2.nid IS NULL + SQL; $sandbox['nids'] = \Drupal::database()->query($query)->fetchCol(); - if (empty($sandbox['nids'])) { - return 'No orphaned content found.'; - } $sandbox['total'] = count($sandbox['nids']); $sandbox['progress'] = 0;