Skip to content
Snippets Groups Projects
Commit aeefb7d8 authored by Vitalii Koval's avatar Vitalii Koval Committed by Taras Kruts
Browse files

Issue #3377397 by Kovalskiy266: Fix duplication of event enrollees and organizers

parent 4cfa7592
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ display:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
distinct: true
replica: false
query_comment: ''
query_tags: { }
......
......@@ -38,7 +38,7 @@ display:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
distinct: true
replica: false
query_comment: ''
query_tags: { }
......
......@@ -32,7 +32,7 @@ display:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
distinct: true
replica: false
query_comment: ''
query_tags: { }
......
......@@ -38,7 +38,7 @@ display:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
distinct: true
replica: false
query_comment: ''
query_tags: { }
......
......@@ -37,7 +37,7 @@ display:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
distinct: true
replica: false
query_comment: ''
query_tags: { }
......
......@@ -34,7 +34,7 @@ display:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
distinct: true
replica: false
query_comment: ''
query_tags: { }
......
......@@ -2295,3 +2295,32 @@ function social_event_update_11903(): void {
\Drupal::logger('social_event')->error($e->getMessage());
}
}
/**
* Update the views that are associated with enrolling in an event.
*
* To prevent duplication of users.
*/
function social_event_update_11904(): void {
$configs = [
'event_enrollments',
'event_manage_enrollments',
'manage_enrollments',
'event_manage_enrollment_invites',
'event_manage_enrollment_requests',
'managers',
];
// Updating views that are responsible for receiving users,
// who have enrolled for an event or are the organisers of this event.
foreach ($configs as $config_name) {
$config_value = \Drupal::configFactory()->getEditable('views.view.' . $config_name);
if ($config_value !== NULL) {
$data = $config_value->getRawData();
if (isset($data['display']['default']['display_options']['query']['options']['distinct'])) {
$data['display']['default']['display_options']['query']['options']['distinct'] = TRUE;
$config_value->setData($data)->save();
}
}
}
}
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