-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: 10.10-HF25, 11.1, 2021.0
-
Component/s: Layouts & Widgets
Since 10.10, document suggestion widgets don't execute the NXQL query if it is configured.
How to reproduce:
In Studio:
- create a new document type named MyDoc and add a field document of type Document in its schema
- in its creation layout:
- add a single document suggestion widget on property mydoc:document
- set NXQL Query property to SELECT * FROM Document WHERE dc:title LIKE ? AND ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0 AND ecm:primaryType='MyDoc'
- active automation logging in $NUXEO_HOME/lib/log4j2.xml:
<Logger name="org.nuxeo.ecm.automation.core" level="info" />
- deploy and start the Nuxeo instance
- log in the JSF UI
- create a workspace and in it
- create a File document with title MyDoc1
- create a MyDoc document with title MyDoc1
- create another MyDoc document and in its creation layout type MyDoc1 in suggestion widget Document
Expected result: the suggestion widget suggests 1 document, the document of type MyDoc and with title MyDoc1.
Actual result: the suggestion widget suggests the 2 documents with title MyDoc1, including the one of type File, even though the suggestion widget explicitly specifies ecm:primaryType='MyDoc' in its NXQL Query property.
Operation Repository.PageProvider used to be called by the suggestion widget to execute the widget's NXQL query, but was refactored in 10.10 by NXP-26171 (commit https://github.com/nuxeo/nuxeo/commit/562e48f5f7773b633806660fbcf7bbfe12d3013f) and now operation Repository.Query is supposed to be called if the NXQL query is defined in the suggestion widget. The problem operation Repository.PageProvider is still called, and as it has been refactored, it executes page provider default_document_suggestion instead of the configured NXQL query.
The problem also exists with the multiple document suggestion widget.
Also parameters like quote parameters and escape parameters are not supported by operation Repository.Query, which was the case in operation Repository.PageProvider.
The only workaround seems to be the use of a page provider instead of a NXQL query.
I attached a Studio jar containing all the Studio customization mentioned above.