Skip to content

Commit cb6762d

Browse files
authored
Merge pull request majlis-erc#317 from majlis-erc/person-works-limit
fixed Wroks not showing up in a person's page by removing lt 20 for works (+ ms in Attestation in Work's page)
2 parents 40f9867 + c5b7c7f commit cb6762d

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

  • src/main/xar-resources/modules

src/main/xar-resources/modules/app.xql

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,17 @@ declare function app:display-nodes($node as node(), $model as map(*), $paths as
136136
for $p in $paths
137137
return util:eval(concat('$record/',$p))
138138
else $record/descendant::tei:text
139-
let $doc := if(count($works) gt 0 and count($works) lt 20) then
139+
(: The original conditions capped display at lt 20 related records, silently hiding
140+
the Works collapsible for prolific authors (e.g. person 9 has 34 works) and the
141+
Attestations collapsible for well-attested works. The upper bound has been removed
142+
so all related records are shown regardless of count. The DB query already runs
143+
unconditionally before this point, so removing the cap adds no query overhead —
144+
only XSLT processing and response size scale with count, both negligible at current
145+
data scale. If performance becomes a concern with very large counts, the preferred
146+
fix is to pass a lightweight URI+title structure instead of full TEI documents.
147+
See README-works-mss-limit.md for full analysis. :)
148+
(: let $doc := if(count($works) gt 0 and count($works) lt 20) then :)
149+
let $doc := if(count($works) gt 0) then
140150
<result>
141151
<record>{$record}</record>
142152
<works>
@@ -147,7 +157,8 @@ declare function app:display-nodes($node as node(), $model as map(*), $paths as
147157
}
148158
</works>
149159
</result>
150-
else if(count($mss) gt 0 and count($mss) lt 20) then
160+
(: else if(count($mss) gt 0 and count($mss) lt 20) then :)
161+
else if(count($mss) gt 0) then
151162
<result>
152163
<record>{$record}</record>
153164
<mss>

0 commit comments

Comments
 (0)