$entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
if (false === $entry) {
- $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
- new Entry($this->getUser()),
- $url
- );
+ $entry = new Entry($this->getUser());
+ try {
+ $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
+ $entry,
+ $url
+ );
+ } catch (\Exception $e) {
+ $this->get('logger')->error('Error while saving an entry', [
+ 'exception' => $e,
+ 'entry' => $entry,
+ ]);
+ $entry->setUrl($url);
+ }
}
if (!is_null($title)) {
$tags = $request->request->get('tags', '');
if (!empty($tags)) {
- $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
+ $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
}
if (!is_null($isStarred)) {
$tags = $request->request->get('tags', '');
if (!empty($tags)) {
- $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
+ $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
}
$em = $this->getDoctrine()->getManager();
$tags = $request->request->get('tags', '');
if (!empty($tags)) {
- $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
+ $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
}
$em = $this->getDoctrine()->getManager();
$tags = $element->tags;
if (false !== $entry && !(empty($tags))) {
- $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
+ $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
$em = $this->getDoctrine()->getManager();
$em->persist($entry);