forked from wallabag/wallabag
Fix empty title and domain_name when exception is thrown during fetch
Add a new helper to set a default title when it's empty: 1/ use basename part of entry's path, if any 2/ or use domain name Fixes #2053 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
@ -502,6 +502,14 @@ class EntryController extends Controller
|
||||
$message = 'flashes.entry.notice.' . $prefixMessage . '_failed';
|
||||
}
|
||||
|
||||
if (empty($entry->getDomainName())) {
|
||||
$this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
|
||||
}
|
||||
|
||||
if (empty($entry->getTitle())) {
|
||||
$this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add('notice', $message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user