Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
5.0.4, 5.1.1, 5.2.0
-
None
-
None
-
Turing Sprint 178
Description
If you add a /preview/api mount with @hst:type="preview" with the specific named pipeline (e.g, http://localhost:8080/site/preview/api/documents), it doesn't work correctly (doesn't show all documents that it should) because of a very simple problem.
I found the query it is using in preview mode through HST diagnostics:
//element(*,hippo:document)[(@hippo:paths='6b3783ce-2ca6-4dc2-b592-e540f5a6e74e') and ((@hippo:availability = 'preview') and (@hippostdpubwf:publicationDate))] order by @hippostdpubwf:publicationDate descending
The problem is that there is no "hippostdpubwf:publicationDate" in the unpublished (preview) variant node, but the query generated/used in the product has the constraint like "and (@hippostdpubwf:publicationDate)", and it cannot query anything as a result.
"hippostdpubwf:publicationDate" property exists only in the "published" variant if you take look into those through console.
In preview mode, the query should not add "hippostdpubwf:publicationDate" constraint at all.
By the way, please be warned when testing this problem with a simple archetype generated project because the simple project has only published variant which has hippo:availability=['live', 'preview'] together. You must test this problem only on republished content documents only (e.g, by editing and republishing the documents and so having preview and live variants separately).
And strange enough, if I append a query string like this, the preview API call returns data.
http://localhost:8080/site/preview/api/documents?_orderBy=hippostdpubwf:lastModificationDate
Attachments
Issue Links
- is a result of
-
HSTTWO-3922 Add sort options to Content Rest API
- Closed
- relates to
-
HSTTWO-4272 Default sort order for preview of REST API is on a property that most of the time is missing on preview variant
- Closed