projectEndings / staticSearch

A codebase to support a pure JSON search engine requiring no backend for any XHTML5 document collection
https://endings.uvic.ca/staticSearch/docs/index.html
Mozilla Public License 2.0
46 stars 21 forks source link

Fix a 'mod 0' bug #249

Closed ndw closed 1 year ago

ndw commented 1 year ago

The makeTokenCounterMsg template in xsl/json.xsl attempts to output messages only 10% of the time. Unfortunately, if there are fewer than 10 files, last() idiv 10 is zero and position() mod 0 is an error. This patch just forces the value to be 1 if there are fewer than 10 files.

joeytakeda commented 1 year ago

Thanks, @ndw, for catching this and for the PR! Will merge in now.

martindholmes commented 1 year ago

@joeytakeda I think we should port this fix to main and release a 1.4.2. What do you think?

martindholmes commented 1 year ago

@joeytakeda I've cherry-picked that commit, updated the documentation and done a release. I'll also update the documentation on the Endings site.

joeytakeda commented 1 year ago

Sorry late on the draw for this one, but thanks @martindholmes!

martindholmes commented 1 year ago

@joeytakeda No worries. This did make me wonder about branch issues, though. I think we should consider keeping the current main branch for version 1.x hotfixes, and release version 2 (eventually) on a main2 branch. As the dev branch proceeds, it'll become impractical to cherry-pick fixes from it into the current main branch.