]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #2708 from jcharaoui/import-disablecontentupdate
authorJérémy Benoist <j0k3r@users.noreply.github.com>
Fri, 2 Jun 2017 09:26:37 +0000 (11:26 +0200)
committerGitHub <noreply@github.com>
Fri, 2 Jun 2017 09:26:37 +0000 (11:26 +0200)
Import disableContentUpdate

1  2 
src/Wallabag/CoreBundle/Controller/EntryController.php

index 9fe3e69372c294331d6c26b93f093ad3ac4a20a5,4b2bc7da4e8116d58a13a19e0026978ed216e558..fafa49f1b0bb69a156db8318a6ab3e9a9c2bba02
@@@ -53,22 -53,17 +53,17 @@@ class EntryController extends Controlle
  
      /**
       * Fetch content and update entry.
-      * In case it fails, entry will return to avod loosing the data.
+      * In case it fails, $entry->getContent will return an error message.
       *
       * @param Entry  $entry
       * @param string $prefixMessage Should be the translation key: entry_saved or entry_reloaded
-      *
-      * @return Entry
       */
      private function updateEntry(Entry $entry, $prefixMessage = 'entry_saved')
      {
-         // put default title in case of fetching content failed
-         $entry->setTitle('No title found');
          $message = 'flashes.entry.notice.'.$prefixMessage;
  
          try {
-             $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
+             $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
          } catch (\Exception $e) {
              $this->get('logger')->error('Error while saving an entry', [
                  'exception' => $e,
@@@ -79,8 -74,6 +74,6 @@@
          }
  
          $this->get('session')->getFlashBag()->add('notice', $message);
-         return $entry;
      }
  
      /**
  
          $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
  
 -        $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')
 -            ->prepare($pagerAdapter, $page);
 +        $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
  
          try {
              $entries->setCurrentPage($page);