1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-30 12:52:24 -05:00

bug in downloading pictures : article content wasn't updated anymore

This commit is contained in:
Nicolas Lœuillet 2013-08-09 23:30:20 +02:00
parent d8d1542e52
commit b58e261db9
2 changed files with 9 additions and 0 deletions

View File

@ -184,6 +184,13 @@ class Database {
return $entries; 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) { public function add($url, $title, $content, $user_id) {
$sql_action = 'INSERT INTO entries ( url, title, content, user_id ) VALUES (?, ?, ?, ?)'; $sql_action = 'INSERT INTO entries ( url, title, content, user_id ) VALUES (?, ?, ?, ?)';
$params_action = array($url, $title, $content, $user_id); $params_action = array($url, $title, $content, $user_id);

View File

@ -126,6 +126,8 @@ class Poche
$last_id = $this->store->getLastId($sequence); $last_id = $this->store->getLastId($sequence);
if (DOWNLOAD_PICTURES) { if (DOWNLOAD_PICTURES) {
$content = filtre_picture($parametres_url['content'], $url->getUrl(), $last_id); $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) { if (!$import) {
$this->messages->add('s', _('the link has been added successfully')); $this->messages->add('s', _('the link has been added successfully'));