From: Christian Weiske Date: Fri, 26 Sep 2014 10:30:55 +0000 (+0200) Subject: Fix length of date fields in database. X-Git-Tag: v0.2.0~10 X-Git-Url: https://git.cweiske.de/grauphel.git/commitdiff_plain/10e03b9bac083b8844285ab137f114979874e6e5?ds=sidebyside Fix length of date fields in database. The last digit of the time zone was missing because the database date fields were only 32 instead of 33 characters. Tomdroid sync failed because of this. Tomdroid sync works now! --- diff --git a/appinfo/database.xml b/appinfo/database.xml index 5bf6172..176f89f 100755 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -90,19 +90,19 @@ note_create_date text true - 32 + 33 note_last_change_date text true - 32 + 33 note_last_metadata_change_date text true - 32 + 33 diff --git a/appinfo/info.xml b/appinfo/info.xml index 1008496..2074d61 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -3,7 +3,7 @@ grauphel Grauphel: Tomboy note server Tomboy REST API server to sync notes between devices - 0.1.1 + 0.2.0 AGPL3 or later Christian Weiske 7 diff --git a/appinfo/version b/appinfo/version index 17e51c3..0ea3a94 100755 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -0.1.1 +0.2.0 diff --git a/lib/notestorage.php b/lib/notestorage.php index bca7dfd..d802669 100644 --- a/lib/notestorage.php +++ b/lib/notestorage.php @@ -363,14 +363,24 @@ class NoteStorage return $notes; } + protected function fixDate($date) + { + if (strlen($date) == 32) { + //Bug in grauphel 0.1.1; date fields in DB had only 32 instead of 33 + // characters. The last digit of the time zone was missing + $date .= '0'; + } + return $date; + } + protected function noteFromRow($row) { return (object) array( 'guid' => $row['note_guid'], - 'create-date' => $row['note_create_date'], - 'last-change-date' => $row['note_last_change_date'], - 'last-metadata-change-date' => $row['note_last_metadata_change_date'], + 'create-date' => $this->fixDate($row['note_create_date']), + 'last-change-date' => $this->fixDate($row['note_last_change_date']), + 'last-metadata-change-date' => $this->fixDate($row['note_last_metadata_change_date']), 'title' => $row['note_title'], 'note-content' => $row['note_content'],