From 1bcbe8bebf4f469420fc36759e6f5ae5ea551535 Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Sat, 5 Apr 2014 11:22:33 +0300 Subject: postgres sequence error fix, issue #602 --- inc/poche/Database.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche/Database.class.php') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 6244df88..a80eea97 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -374,7 +374,7 @@ class Database { $id = null; } else { - $id = intval($this->getLastId( (STORAGE == 'postgres') ? 'users_id_seq' : '' )); + $id = intval($this->getLastId( (STORAGE == 'postgres') ? 'entries_id_seq' : '') ); } return $id; } -- cgit v1.2.3 From 5ce397847230c70c513ac4fbc3bfbb31498b443f Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Fri, 11 Apr 2014 14:43:17 +0300 Subject: logging by import added; error by creation table if exists in postgresql fixed. --- inc/poche/Database.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/poche/Database.class.php') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index a80eea97..d1044a6e 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -77,7 +77,7 @@ class Database { } else { $sql = ' - CREATE TABLE tags ( + CREATE TABLE IF NOT EXISTS tags ( id bigserial primary key, value varchar(255) NOT NULL ); @@ -110,7 +110,7 @@ class Database { } else { $sql = ' - CREATE TABLE tags_entries ( + CREATE TABLE IF NOT EXISTS tags_entries ( id bigserial primary key, entry_id integer NOT NULL, tag_id integer NOT NULL @@ -407,7 +407,7 @@ class Database { public function getLastId($column = '') { return $this->getHandle()->lastInsertId($column); } - + public function search($term, $user_id, $limit = '') { $search = '%'.$term.'%'; $sql_action = "SELECT * FROM entries WHERE user_id=? AND (content LIKE ? OR title LIKE ? OR url LIKE ?) "; //searches in content, title and URL -- cgit v1.2.3 From 0f859c6f321af6dfaea66e04cde705ba97e6b5be Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Fri, 11 Apr 2014 17:21:54 +0300 Subject: error with empty content by import fixed. Also youtube and vimeo videos are allowd in content now. --- inc/poche/Database.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/poche/Database.class.php') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index d1044a6e..036c9d1b 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -245,7 +245,7 @@ class Database { $sql_limit = "LIMIT ".$limit." OFFSET 0"; } - $sql = "SELECT * FROM entries WHERE (content = '' OR content IS NULL) AND user_id=? ORDER BY id " . $sql_limit; + $sql = "SELECT * FROM entries WHERE (content = '' OR content IS NULL) AND title LIKE 'Untitled - Import%' AND user_id=? ORDER BY id " . $sql_limit; $query = $this->executeQuery($sql, array($user_id)); $entries = $query->fetchAll(); @@ -253,7 +253,7 @@ class Database { } public function retrieveUnfetchedEntriesCount($user_id) { - $sql = "SELECT count(*) FROM entries WHERE (content = '' OR content IS NULL) AND user_id=?"; + $sql = "SELECT count(*) FROM entries WHERE (content = '' OR content IS NULL) AND title LIKE 'Untitled - Import%' AND user_id=?"; $query = $this->executeQuery($sql, array($user_id)); list($count) = $query->fetch(); -- cgit v1.2.3