Summary: DokuWiki Structured Data Plugin
Name: dokuwiki-plugin-%{plugin}
Version: 20090213
-Release: 3
+Release: 4
License: GPL v2
Group: Applications/WWW
Source0: http://dev.splitbrain.org/download/snapshots/data-plugin-latest.tgz
# Source0-md5: 6a3ee212496a60a343b62246e8002957
URL: http://wiki.splitbrain.org/plugin:data
Patch0: interwiki.patch
+Patch1: remove-rootns.patch
BuildRequires: rpmbuild(macros) >= 1.520
Requires: dokuwiki >= 20090214b-5
Requires: php(sqlite)
%prep
%setup -q -n %{plugin}
%patch0 -p1
+%patch1 -p1
# cleanup backups after patching
find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
--- /dev/null
+--- data/action.php 2009-02-06 22:40:42.000000000 +0200
++++ tmp/action.php 2009-08-10 19:17:12.000000000 +0300
+@@ -43,10 +43,19 @@
+ */
+ function _handle(&$event, $param){
+ $data = $event->data;
+- if(strpos($data[0][1],'dataentry') !== false) return; // plugin seems still to be there
++ if (strpos($data[0][1],'dataentry') !== false) {
++ return; // plugin seems still to be there
++ }
+
+- if(!$this->dthlp->_dbconnect()) return;
+- $id = $data[1].":".$data[2];
++ if (!$this->dthlp->_dbconnect()) {
++ return;
++ }
++ // for root the namespace is empty
++ if (!empty($data[1])) {
++ $id = $data[1].":".$data[2];
++ } else {
++ $id = $data[2];
++ }
+
+ // get page id
+ $sql = "SELECT pid FROM pages WHERE page ='".sqlite_escape_string($id)."'";
+@@ -61,4 +70,3 @@
+ sqlite_query($this->dthlp->db, $sql);
+ }
+ }
+-