- $updated = $this->linkDb->renameTag($args['tagName'], $data['name']);
- $this->linkDb->save($this->conf->get('resource.page_cache'));
- foreach ($updated as $link) {
- $this->history->updateLink($link);
+ $searchResult = $this->bookmarkService->search(
+ ['searchtags' => $args['tagName']],
+ BookmarkFilter::$ALL,
+ true
+ );
+ foreach ($searchResult->getBookmarks() as $bookmark) {
+ $bookmark->renameTag($args['tagName'], $data['name']);
+ $this->bookmarkService->set($bookmark, false);
+ $this->history->updateLink($bookmark);