From c55c59e3d67b1481e86b41e4b49083c99d3659c5 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Thu, 15 Mar 2012 14:56:48 +0100 Subject: 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). --- inc/indexer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3