From 6b24f99048c4ee5dd581c63ce4f92d7598838edb Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 4 Aug 2011 06:37:32 +0200 Subject: [PATCH 1/7] Fix bug #3385724: Rename tag ends with XML Parsing Error --- data/templates/default/tagrename.tpl.php | 1 - doc/ChangeLog | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/templates/default/tagrename.tpl.php b/data/templates/default/tagrename.tpl.php index 894b964..e3d0467 100644 --- a/data/templates/default/tagrename.tpl.php +++ b/data/templates/default/tagrename.tpl.php @@ -28,7 +28,6 @@ window.onload = function() { -

diff --git a/doc/ChangeLog b/doc/ChangeLog index 8fc6743..b512d3c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -3,6 +3,11 @@ ChangeLog for SemantiScuttle .. contents:: +0.98.2 - 2011-08-XX +------------------- +- Fix bug #3385724: Rename tag ends with XML Parsing Error + + 0.98.1 - 2011-08-01 ------------------- - Fix bug #3375635: XML parsing problem in top.inc.php From 587674b35567caac15984ddf6c204ab32304684a Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 4 Aug 2011 17:08:42 +0200 Subject: [PATCH 2/7] Fix bug #3385724 part 2: cancelling tag edit broken --- www/tagrename.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/tagrename.php b/www/tagrename.php index b07d49d..18e26ab 100644 --- a/www/tagrename.php +++ b/www/tagrename.php @@ -67,7 +67,7 @@ if (POST_CONFIRM) { $template = 'error.500.tpl'; } } elseif (POST_CANCEL) { - header('Location: '. createURL('bookmarks', $currentUser->getUsername() .'/'. $tags)); + header('Location: '. createURL('bookmarks', $currentUser->getUsername() .'/'. $tag)); } else { $tplVars['subtitle'] = T_('Rename Tag') .': '. $tag; $tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag; From c1528d1c5bf82d1a637fa6ac8b245e2a565f5f59 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 5 Aug 2011 06:33:40 +0200 Subject: [PATCH 3/7] we can retrieve system tags now --- src/SemanticScuttle/Service/Bookmark2Tag.php | 11 +++++++---- tests/Bookmark2TagTest.php | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php index 914abc6..3e5c533 100644 --- a/src/SemanticScuttle/Service/Bookmark2Tag.php +++ b/src/SemanticScuttle/Service/Bookmark2Tag.php @@ -271,10 +271,11 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService * Retrieves all tags for a given bookmark except system tags. * * @param integer $bookmarkid ID of the bookmark + * @param boolean $systemTags Return "system:*" tags or not * * @return array Array of tags */ - public function getTagsForBookmark($bookmarkid) + public function getTagsForBookmark($bookmarkid, $systemTags = false) { if (!is_numeric($bookmarkid)) { message_die( @@ -285,9 +286,11 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService } $query = 'SELECT tag FROM ' . $this->getTableName() - . ' WHERE bId = ' . intval($bookmarkid) - . ' AND LEFT(tag, 7) <> "system:"' - . ' ORDER BY id ASC'; + . ' WHERE bId = ' . intval($bookmarkid); + if (!$systemTags) { + $query .= ' AND LEFT(tag, 7) <> "system:"'; + } + $query .= ' ORDER BY id ASC'; if (!($dbresult = $this->db->sql_query($query))) { message_die( diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php index 4d95d69..1367a0e 100644 --- a/tests/Bookmark2TagTest.php +++ b/tests/Bookmark2TagTest.php @@ -71,6 +71,17 @@ class Bookmark2TagTest extends TestBase + public function testAttachTagsWithoutTagsAddsSystemUnfiled() + { + $bid = $this->addBookmark(null, null, 0, array()); + $this->assertEquals( + array('system:unfiled'), + $this->b2ts->getTagsForBookmark($bid, true) + ); + } + + + /** * Test getTagsForBookmark() when the bookmark has no tags * From 9c18fe1cc7e22077763baa545144cc01d5d94eab Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 5 Aug 2011 06:47:37 +0200 Subject: [PATCH 4/7] Fix bug #3386178: "system:unfiled" secret tag does not work --- doc/ChangeLog | 1 + src/SemanticScuttle/Service/Tag.php | 1 + tests/Bookmark2TagTest.php | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index b512d3c..d71a3d0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -6,6 +6,7 @@ ChangeLog for SemantiScuttle 0.98.2 - 2011-08-XX ------------------- - Fix bug #3385724: Rename tag ends with XML Parsing Error +- Fix bug #3386178: "system:unfiled" secret tag does not work 0.98.1 - 2011-08-01 diff --git a/src/SemanticScuttle/Service/Tag.php b/src/SemanticScuttle/Service/Tag.php index 8325285..2476608 100644 --- a/src/SemanticScuttle/Service/Tag.php +++ b/src/SemanticScuttle/Service/Tag.php @@ -143,6 +143,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService if(!is_array($tags)) { $tags = utf8_strtolower(trim($tags)); } else { + $tags = array_filter($tags);//remove empty values for($i=0; $iaddBookmark(null, null, 0, array('')); + $this->assertEquals( + array('system:unfiled'), + $this->b2ts->getTagsForBookmark($bid, true) + ); + } + /** From 5571ec0a4dc9b2297dc6e3f65fc1bbf3dfc5004b Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 5 Aug 2011 19:48:46 +0200 Subject: [PATCH 5/7] script to fix unfiled bugs (for bug #3386178) --- doc/ChangeLog | 3 +++ doc/UPGRADE.txt | 6 ++++++ scripts/fix-unfiled-tags.php | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 scripts/fix-unfiled-tags.php diff --git a/doc/ChangeLog b/doc/ChangeLog index d71a3d0..860a213 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -8,6 +8,9 @@ ChangeLog for SemantiScuttle - Fix bug #3385724: Rename tag ends with XML Parsing Error - Fix bug #3386178: "system:unfiled" secret tag does not work +Run ``scripts/fix-unfiled-tags.php`` to fix old bookmarks that miss the +``system:unfiled`` tags. + 0.98.1 - 2011-08-01 ------------------- diff --git a/doc/UPGRADE.txt b/doc/UPGRADE.txt index b144af2..e405431 100644 --- a/doc/UPGRADE.txt +++ b/doc/UPGRADE.txt @@ -4,6 +4,12 @@ Upgrading SemanticScuttle from a previous version .. contents:: +From version 0.94-0.98.1 to 0.98.2 +================================== +Run ``scripts/fix-unfiled-tags.php`` to fix old bookmarks that miss the +``system:unfiled`` tags. + + From version 0.97 to 0.98 ========================= Database updates diff --git a/scripts/fix-unfiled-tags.php b/scripts/fix-unfiled-tags.php new file mode 100644 index 0000000..8a5238e --- /dev/null +++ b/scripts/fix-unfiled-tags.php @@ -0,0 +1,35 @@ +sql_query($query))) { + die('Strange SQL error'); +} +while ($row = $db->sql_fetchrow($dbresult)) { + $db->sql_query( + 'INSERT INTO ' . $bt->getTableName() . ' ' + . $db->sql_build_array( + 'INSERT', + array('bId' => $row['bId'], 'tag' => 'system:unfiled') + ) + ); +} +$db->sql_freeresult($dbresult); +?> \ No newline at end of file From 2807d040834ea9fcd825d5b1c9b3e1e005d81664 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 6 Aug 2011 10:34:13 +0200 Subject: [PATCH 6/7] Fix bug #3384416: Update documentation to explain HTTP/HTTPS root problem --- data/config.default.php | 4 +++- doc/ChangeLog | 1 + doc/configuration.rst | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/data/config.default.php b/data/config.default.php index c850521..9c2f7f3 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -81,13 +81,15 @@ $theme = 'default'; /** * SemanticScuttle root directory. - * * Set to NULL to autodetect the root url of the website. * * If your installation is in a subdirectory like * "http://www.example.com/semanticscuttle/" then * replace NULL by your address (between "" and with trailing '/') * + * The autodetection works for both HTTP and HTTPS urls. + * If you offer HTTP *only*, then set your root url here. + * * @var string */ $root = null; diff --git a/doc/ChangeLog b/doc/ChangeLog index 860a213..b7bf843 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -7,6 +7,7 @@ ChangeLog for SemantiScuttle ------------------- - Fix bug #3385724: Rename tag ends with XML Parsing Error - Fix bug #3386178: "system:unfiled" secret tag does not work +- Fix bug #3384416: Update documentation to explain HTTP/HTTPS root problem Run ``scripts/fix-unfiled-tags.php`` to fix old bookmarks that miss the ``system:unfiled`` tags. diff --git a/doc/configuration.rst b/doc/configuration.rst index f457ebb..c34318a 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -56,3 +56,24 @@ per-host configuration files: - ``data/config.$hostname.php`` - ``/etc/semanticscuttle/config.$hostname.php`` + + +Configuration options +===================== +``$root`` URL +------------- +Normally, this configuration setting is detected automatically and will +work for both HTTP and HTTPS installations. + +If your installation is available on **HTTP only**, then you need to configure +it. + +The value is the full URL to your installation, including a trailing +slash:: + + $root = "http://homepage.example.org/semanticscuttle/"; + +or:: + + $root = "http://bookmarks.example.org/"; + From 097ecf9c510e1435d02be7843bc7e865570338ac Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 6 Aug 2011 10:35:38 +0200 Subject: [PATCH 7/7] add TOC --- doc/configuration.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/configuration.rst b/doc/configuration.rst index c34318a..c8a8bd9 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -2,6 +2,8 @@ Configuration files =================== +.. contents:: + SemanticScuttle uses at least two configuration files: 1. Default configuration file ``config.default.php``