Upgrade from 7.8.1 to 7.8.2

The release notes for this release can be found here Fonto 7.8.2.

Affected products

Only customers with Fonto Review are affected by this hotfix.

Required changes

This release of Fonto introduces a breaking change in the way Fonto Review stores annotation target's startContainerQuery and endContainerQuery in the database.

The current structure is, for example: /node()[2]/node()[2]/node()[1]/node()[1]

This structure made a bug in our XPath engine (FontoXPath) visible. FontoXPath included the Document Type Declaration (DTD) in the sibling count to the root element of the document. This is not according to the XPath specification.

The bug means that the targets stored in the database are not specification-compliant. We have fixed this in this release. Changing the way the XPaths are constructed requires you to empty your database or execute an upgrade script on your database.

The new structure of the XPaths is, for example: /*[1]/node()[2]/node()[1]/node()[1]. Note that the first part of the XPath is changed from /node()[<index>] to /*[1]. The /*[1] selector always selects the root element of the document.

Emptying your database

If you choose to empty your database, you can safely do this. Please make sure all Fonto instances are closed.

If you are running the development CMS provided by Fonto, remove the review-annotations-database.json file from your files and uploads folders in the dev-cms folder.

Upgrade your database

Upgrading your database is recommended if you have data that you want to save. The upgrade steps are described below.

Replace the first /node()[<number>] part of the startContainerQuery and endContainerQuery with /*[1]. The current index of the query part does not matter, you can safely ignore that. Do make sure to not edit any other parts of the query, also do not change the offsets.

For example, change /node()[2]/node()[2]/node()[1]/node()[1] to /*[1]/node()[2]/node()[1]/node()[1]