summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-03-15 14:56:48 +0100
committerMichael Hamann <michael@content-space.de>2012-03-15 14:59:41 +0100
commitc55c59e3d67b1481e86b41e4b49083c99d3659c5 (patch)
tree1dc06a7e8252ee98e64d0e51d97396ad631b056f /inc/indexer.php
parent8d1fa7573a9c92901a1fef0e77f6543f0b3fcf62 (diff)
downloadrpg-c55c59e3d67b1481e86b41e4b49083c99d3659c5.tar.gz
rpg-c55c59e3d67b1481e86b41e4b49083c99d3659c5.tar.bz2
Fix page deletion in the indexer
This fixes page deletion in the indexer and fixes a but where empty lines were added to the _i.idx file of metadata for which no value was set (harmless, and wasn't executed anyway).
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 3f56e5fe5..6766bec25 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -351,7 +351,7 @@ class Doku_Indexer {
return "locked";
// load known documents
- $pid = $this->getIndexKey('page', '', $page);
+ $pid = $this->addIndexKey('page', '', $page);
if ($pid === false) {
$this->unlock();
return false;
@@ -389,6 +389,7 @@ class Doku_Indexer {
$val_idx = explode(':', $this->getIndexKey($metaname.'_p', '', $pid));
$meta_idx = $this->getIndex($metaname.'_i', '');
foreach ($val_idx as $id) {
+ if ($id === '') continue;
$meta_idx[$id] = $this->updateTuple($meta_idx[$id], $pid, 0);
}
$this->saveIndex($metaname.'_i', '', $meta_idx);