From 3d1598052a49673e0a48c85d379a9d802db09e76 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 27 Aug 2022 14:34:08 +0300 Subject: [PATCH] bugfix + notes... Signed-off-by: Alex A. Naanou --- pwiki/store/base.js | 11 +++++++---- pwiki2.js | 14 ++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pwiki/store/base.js b/pwiki/store/base.js index cafa5de..9112a95 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -568,10 +568,13 @@ module.MetaStore = { var store = Object.keys(this.substores ?? {}) // normalize store paths to the given path... .filter(function(p){ - return path.startsWith( - root ? - '/'+p - : p) }) + p = root ? + '/'+p + : p + return path.startsWith(p) + && (path[p.length] == null + || path[p.length] == '/' + || path[p.length] == '\\')}) .sort(function(a, b){ return a.length - b.length }) .pop() diff --git a/pwiki2.js b/pwiki2.js index ceb29b9..c752fe1 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,14 +1,12 @@ /********************************************************************** * * -* XXX BUG: for some reason pwiki.get('/TestPage').raw does nothing when -* the root store is not BaseStore... -* ...the cause is: -* pwiki.store.substore('/TestPage') -> 'Test' -* should be: -* pwiki.store.substore('/TestPage') -> undefined -* XXX BUG service pages (*Error) now print "[ native code ]" instead of -* the path and replacing @quote(..) with @source(..) breaks things... +* XXX BUG with non-BaseStore root, the paths under /Test/.. report +* recursion errors when rendered by /tree... +* /Test/tree -- works fine +* XXX BUG service pages (NotFoundError, RecursionError, ...) now print +* "[ native code ]" instead of the path and replacing @quote(..) +* with @source(..) breaks things... * ...this seems to happen only if the root store is not * MetaStore/BaseStore... * XXX BUG: .get(..) does not seem to resolve to .next...