]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
bug in downloading pictures : article content wasn't updated anymore
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Fri, 9 Aug 2013 21:30:20 +0000 (23:30 +0200)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Fri, 9 Aug 2013 21:30:20 +0000 (23:30 +0200)
inc/poche/Database.class.php
inc/poche/Poche.class.php

index cd5a9a3120b871c0b91f4badf16b9b0a8c9d4860..84916b83efe3cebd2fc6d9f42d03ed327068b71e 100644 (file)
@@ -184,6 +184,13 @@ class Database {
         return $entries;
     }
 
+    public function updateContent($id, $content, $user_id) {
+        $sql_action = 'UPDATE entries SET content = ? WHERE id=? AND user_id=?';
+        $params_action = array($content, $id, $user_id);
+        $query = $this->executeQuery($sql_action, $params_action);
+        return $query;
+    }
+
     public function add($url, $title, $content, $user_id) {
         $sql_action = 'INSERT INTO entries ( url, title, content, user_id ) VALUES (?, ?, ?, ?)';
         $params_action = array($url, $title, $content, $user_id);
index 90bea1fe0b1e7f4c837ca51f748a2812ae98fef7..2af49acd421a4f4b3a3fe757df3c95596f72e234 100644 (file)
@@ -126,6 +126,8 @@ class Poche
                         $last_id = $this->store->getLastId($sequence);
                         if (DOWNLOAD_PICTURES) {
                             $content = filtre_picture($parametres_url['content'], $url->getUrl(), $last_id);
+                            Tools::logm('updating content article');
+                            $this->store->updateContent($last_id, $content, $this->user->getId());
                         }
                         if (!$import) {
                             $this->messages->add('s', _('the link has been added successfully'));