]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Fix bug #3073215: Updating bookmark time does not work
authorChristian Weiske <cweiske@cweiske.de>
Tue, 15 Feb 2011 06:59:02 +0000 (07:59 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 15 Feb 2011 06:59:02 +0000 (07:59 +0100)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@745 b3834d28-1941-0410-a4f8-b48e95affb8f
(cherry picked from commit b17e8f940c8008b034e4db477f748a1f7e4eddb6)

Conflicts:

doc/ChangeLog

doc/ChangeLog
src/SemanticScuttle/Service/Bookmark.php
tests/BookmarkTest.php

index 68b2084d0fc2d83ae970be978f1c5c1c00f8a4c8..ce3d36be7b44b8a216b562b381c8d559492d8209 100644 (file)
@@ -7,6 +7,7 @@ ChangeLog for SemantiScuttle
 - Fix bug #3074816: French translation breaks edit javascript
    This also fixes #3094047 and #3178592
 - Fix bug #3111254: Search in my_watchlist results in error
+- Fix bug #3073215: Updating bookmark time does not work
 
 
 0.97.1 - 2010-09-30
index 97e0d8f06c097ff65f14fd9e77dff23ba80d27e0..bfba21b8ef875b8ac61314ef722b0d227fb56f75 100644 (file)
@@ -617,7 +617,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
         if (!is_null($date)) {
             $datetime = gmdate('Y-m-d H:i:s', strtotime($date));
-            $updates[] = array('bDateTime' => $datetime);
+            $updates['bDatetime'] = $datetime;
         }
 
         $sql = 'UPDATE '. $GLOBALS['tableprefix'] .'bookmarks SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE bId = '. intval($bId);
index 40869b2a258480902795f73e69f187411785486d..7e6348e561a56271878898571e2c09dcfb98a230 100644 (file)
@@ -982,6 +982,38 @@ class BookmarkTest extends TestBase
         $this->assertEquals('newShortNambb', $bm['bShort']);
     }
 
+    /**
+     * Tests if updating a bookmark's date works.
+     * This once was a bug, see bug #3073215.
+     *
+     * @return void
+     *
+     * @link https://sourceforge.net/tracker/?func=detail&atid=1017430&aid=3073215&group_id=211356
+     */
+    public function testUpdateBookmarkDate()
+    {
+        $bid = $this->bs->addBookmark(
+            'http://example.org', 'title', 'desc', 'priv',
+            0, array(), 'myShortName'
+        );
+        $bm = $this->bs->getBookmark($bid);
+        $this->assertEquals('myShortName', $bm['bShort']);
+
+        $this->assertTrue(
+            $this->bs->updateBookmark(
+                $bid, 'http://example2.org', 'my title', 'desc',
+                'priv', 0, array(), 'newShortNambb',
+                //we need to use zulu (GMT) time zone here
+                // since the dates/times are stored as that
+                // in the database
+                '2002-03-04T05:06:07Z'
+            )
+        );
+        $bm = $this->bs->getBookmark($bid);
+        $this->assertEquals('newShortNambb', $bm['bShort']);
+        $this->assertEquals('2002-03-04 05:06:07', $bm['bDatetime']);
+    }
+
 
 
     /**