From b58e261db9f3ea8b9c4c51ef9f0e393942915e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 9 Aug 2013 23:30:20 +0200 Subject: [PATCH] bug in downloading pictures : article content wasn't updated anymore --- inc/poche/Database.class.php | 7 +++++++ inc/poche/Poche.class.php | 2 ++ 2 files changed, 9 insertions(+) diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index cd5a9a3..84916b8 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -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); diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 90bea1f..2af49ac 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -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'));