Commit 49fb290a authored by IKEDA Soji's avatar IKEDA Soji
Browse files

WWSympa: edit_list: Now inclusion will no longer be updated immediately, even...

WWSympa: edit_list: Now inclusion will no longer be updated immediately, even if parameters on data sources were changed.
Instead, a message telling that inclusion will be updated soon (in an hour or so) is shown.
parent ea3165fb
......@@ -242,10 +242,10 @@
[%~ ELSIF report_entry == 'unable_to_load_create_list_templates' ~%]
[%|loc%]Unable to load create_list templates.[%END%]
[%~ ELSIF report_entry == 'sync_include_failed' ~%]
[%~ ELSIF report_entry == 'sync_include_failed' # No longer used ~%]
[%|loc%]Failed to include members[%END%]
[%~ ELSIF report_entry == 'sync_include_admin_failed' ~%]
[%~ ELSIF report_entry == 'sync_include_admin_failed' # No longer used ~%]
[%|loc%]Failed to include list admins[%END%]
[%~ ELSIF report_entry == 'no_owner_defined' ~%]
......@@ -408,18 +408,27 @@
[%~ ELSIF report_entry == 'no_msg_document' ~%]
[%|loc(report_param.list)%]No message and no document to moderate for list %1[%END%]
[%~ ELSIF report_entry == 'member_updated' ~%]
[%~ ELSIF report_entry == 'member_updated' # No longer used ~%]
[%|loc%]The list of list subscribers have been built/updated.[%END%]
[%~ ELSIF report_entry == 'owner_updated' ~%]
[%~ ELSIF report_entry == 'owner_updated' # No longer used ~%]
[%|loc%]The list of list owners have been built/updated.[%END%]
[%~ ELSIF report_entry == 'editor_updated' ~%]
[%~ ELSIF report_entry == 'editor_updated' # No longer used ~%]
[%|loc%]The list of list moderators have been built/updated.[%END%]
[%~ ELSIF report_entry == 'subscribers_updated_soon' # No longer used ~%]
[%|loc%]The list of list members will be built/updated soon (a few minutes).[%END%]
[%~ ELSIF report_entry == 'member_updated_soon' ~%]
[%|loc%]The list of list subscribers will be built/updated soon (in an hour). If you wish immediate update, click "Synchronize members with data sources".[%END%]
[%~ ELSIF report_entry == 'owner_updated_soon' ~%]
[%|loc%]The list of list owners will be built/updated soon (in an hour). If you wish immediate update, click "Synchronize owners with data sources".[%END%]
[%~ ELSIF report_entry == 'editor_updated_soon' ~%]
[%|loc%]The list of moderators will be built/updated soon (in an hour). If you wish immediate update, click "Synchronize moderators with data sources".[%END%]
[%~ ELSIF report_entry == 'subscribers_noticed_deleted_topics' ~%]
[%|loc%]Concerned subscribers have been notified about deleted topics.[%END%]
......
......@@ -4792,16 +4792,6 @@ sub _review_member {
my @additional_fields = split ',',
$Conf::Conf{'db_additional_subscriber_fields'};
 
# Members list synchronization if list has included data sources.
my $sync_result = $list->on_the_fly_sync_include(use_ttl => 1);
unless (defined $sync_result) {
Sympa::WWW::Report::reject_report_web('intern', 'sync_include_failed',
{}, $param->{'action'}, $list, $param->{'user'}{'email'}, $robot);
} elsif ($sync_result) {
Sympa::WWW::Report::notice_report_web('member_updated', {},
$param->{'action'});
}
# Members list
# Some review pages may be empty while viewed by subscribers.
my @members = $list->get_members(
......@@ -10574,9 +10564,13 @@ sub do_edit_list {
{}, $param->{'action'});
}
 
my $data_source_updated = 1
my $data_source_updated_member = 1
if grep { $config->get_change($_) }
grep { $_ =~ /\Ainclude_/ or $_ eq 'ttl' } $config->keys;
grep { $_ =~ /\Ainclude_/ or $_ eq 'member_include' } $config->keys;
my $data_source_updated_owner = 1
if $config->get_change('owner_include');
my $data_source_updated_editor = 1
if $config->get_change('editor_include');
 
# Update config in memory.
$config->commit;
......@@ -10610,35 +10604,17 @@ sub do_edit_list {
return undef;
}
 
## If list has included data sources, update them and delete sync_include
## task.
if ($data_source_updated) {
my $sync_result = $list->on_the_fly_sync_include(use_ttl => 0);
unless (defined $sync_result) {
Sympa::WWW::Report::reject_report_web('intern',
'sync_include_failed',
{}, $param->{'action'}, $list, $param->{'user'}{'email'},
$robot);
} elsif ($sync_result) {
Sympa::WWW::Report::notice_report_web('member_updated', {},
$param->{'action'});
}
if ($data_source_updated_member) {
Sympa::WWW::Report::notice_report_web('member_updated_soon', {},
$param->{'action'});
}
# Call sync_include() if there are changes about owners or editors.
#FIXME:Update only when owner or editor was updated.
unless (defined $list->sync_include('owner')
and defined $list->sync_include('editor')) {
Sympa::WWW::Report::reject_report_web('intern',
'sync_include_admin_failed', {}, $param->{'action'}, $list,
$param->{'user'}{'email'}, $robot);
wwslog('info', '() Failed');
web_db_log(
{ 'status' => 'error',
'error_type' => 'internal'
}
);
return undef;
if ($data_source_updated_owner) {
Sympa::WWW::Report::notice_report_web('owner_updated_soon', {},
$param->{'action'});
}
if ($data_source_updated_editor) {
Sympa::WWW::Report::notice_report_web('editor_updated_soon', {},
$param->{'action'});
}
 
Sympa::WWW::Report::notice_report_web('list_config_updated', {},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment