eXist-db / AtomicWiki

A wiki based on eXist-db which stores data as Atom feeds
GNU Lesser General Public License v2.1
15 stars 8 forks source link

[BUG] Cardinality error when searching for certain string in blog #78

Open lguariento opened 2 years ago

lguariento commented 2 years ago

From a blog page (https://exist-db.org/exist/apps/wiki/blogs/) searching for the string install (see here) in the upper-right box leads to a cardinality error:

<exception>
<path>/db/apps/wiki/modules/view.xql</path>
<message>
exerr:ERROR XPTY0004: The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: config:entry-url-from-entry($entry as element()) item()*. Expected cardinality: exactly one, got 0. [at line 80, column 44, source: /db/apps/wiki/modules/search.xql] In function: config:entry-url-from-entry(element()) [80:15:/db/apps/wiki/modules/config.xqm] search:title(node(), map(*)) [-1:-1:/db/apps/wiki/modules/search.xql] templates:process-output(element(), map(*), item()*, element()) [211:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call-by-introspection(element(), map(*), map(*), function(*)) [189:28:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call(item(), element(), map(*)) [137:36:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [237:13:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process-output(element(), map(*), item()*, element()) [211:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call-by-introspection(element(), map(*), map(*), function(*)) [189:28:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call(item(), element(), map(*)) [137:36:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [48:25:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] search:results(node(), map(*)) [-1:-1:/db/apps/wiki/modules/search.xql] templates:process-output(element(), map(*), item()*, element()) [211:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call-by-introspection(element(), map(*), map(*), function(*)) [189:28:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call(item(), element(), map(*)) [137:36:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [237:13:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process-output(element(), map(*), item()*, element()) [211:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call-by-introspection(element(), map(*), map(*), function(*)) [189:28:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call(item(), element(), map(*)) [137:36:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [148:81:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [428:17:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process-output(element(), map(*), item()*) [230:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process-output(element(), map(*), item()*, element()) [211:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call-by-introspection(element(), map(*), map(*), function(*)) [189:28:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:call(item(), element(), map(*)) [137:36:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [133:51:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:process(node()*, map(*)) [90:9:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql] templates:apply(node()+, function(*), map(*)?, map(*)?) [31:5:/home/existdb/exist-db.org/exist-distribution-5.1.1/etc/../data/expathrepo/shared-0.9.1/content/templates.xql]
</message>
</exception>
lguariento commented 2 years ago

PS: it must be interpreting 'install' as a special instruction/string, because even with one 'l' (instal) it goes through without errors.

joewiz commented 2 years ago

I think the difference is that there were hits for install but not for instal, so with the latter there was no hit processing, but in the former, there was a bug in the processing of the hits.

lguariento commented 2 years ago

Yes, you may be right. Why just install though? Setup is fine.

lguariento commented 2 years ago

Ah, I've found another one: no less than exist! https://exist-db.org/exist/apps/wiki/blogs/search.html?q=exist

joewiz commented 2 years ago

The error involves a templating function config:entry-url-from-entry, so whether there's an error or not probably depends on the hits themselves and whether they conform to what this function expects.

lguariento commented 2 years ago

I've found another one:

https://exist-db.org/exist/apps/wiki/blogs/eXist//search.html?field=tags&q=release