fix: [tag collections] Fixed an issue where if a collection was added that already had all tags attached from before, the process would get stuck with no feedback to the user

pull/3989/head
iglocska 2019-01-01 19:09:46 +01:00
parent b608ce841b
commit 783214f840
1 changed files with 2 additions and 0 deletions

View File

@ -3390,6 +3390,8 @@ class EventsController extends AppController
}
if ($success) {
return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => __('Tag(s) added.'), 'check_publish' => true)), 'status'=>200, 'type' => 'json'));
} elseif (empty($fail)) {
return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => __('All tags are already present, nothing to add.'), 'check_publish' => true)), 'status'=>200, 'type' => 'json'));
} else {
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => $fail)), 'status'=>200, 'type' => 'json'));
}