diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-02-15 07:59:02 +0100 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-02-15 07:59:02 +0100 |
commit | 2407385965a0af18ddece95c8e118294834723d0 (patch) | |
tree | bd5c781329ed5ecec8660cfbbb03d4828a987f9e | |
parent | 17e097d4f828a71b2278167b20a5f05bb51da2f0 (diff) | |
download | semanticscuttle-2407385965a0af18ddece95c8e118294834723d0.tar.gz semanticscuttle-2407385965a0af18ddece95c8e118294834723d0.tar.bz2 |
Fix bug #3073215: Updating bookmark time does not work
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
-rw-r--r-- | doc/ChangeLog | 1 | ||||
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark.php | 2 | ||||
-rw-r--r-- | tests/BookmarkTest.php | 32 |
3 files changed, 34 insertions, 1 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 68b2084..ce3d36b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -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 diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php index 97e0d8f..bfba21b 100644 --- a/src/SemanticScuttle/Service/Bookmark.php +++ b/src/SemanticScuttle/Service/Bookmark.php @@ -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); diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index 40869b2..7e6348e 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -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']); + } + /** |