Skip to content
Snippets Groups Projects
Commit c9c6ea32 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Resolve VUFIND-1291: when editing a list item, do not display success message if no work is done.

parent 83eeb029
Branches
Tags
No related merge requests found
......@@ -619,6 +619,7 @@ class MyResearchController extends AbstractBase
$tagParser = $this->serviceLocator->get('VuFind\Tags');
$favorites = $this->serviceLocator
->get('VuFind\Favorites\FavoritesService');
$didSomething = false;
foreach ($lists as $list) {
$tags = $this->params()->fromPost('tags' . $list);
$favorites->save(
......@@ -629,13 +630,17 @@ class MyResearchController extends AbstractBase
],
$user, $driver
);
$didSomething = true;
}
// add to a new list?
$addToList = $this->params()->fromPost('addToList');
if ($addToList > -1) {
$didSomething = true;
$favorites->save(['list' => $addToList], $user, $driver);
}
$this->flashMessenger()->addMessage('edit_list_success', 'success');
if ($didSomething) {
$this->flashMessenger()->addMessage('edit_list_success', 'success');
}
$newUrl = null === $listID
? $this->url()->fromRoute('myresearch-favorites')
......
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