Skip to content
Snippets Groups Projects
Commit be1a8782 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

ISAICP-9536: QA remarks

parent 40e354dd
No related branches found
Tags 2.2.2
1 merge request!211Release 2.2.2
@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 |
......@@ -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)) {
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment