You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* wrongly assumed that only one form_def will have publishedAt,
changed the condition in the query to use currentDefId instead.
* Also added condition to check enketoOnceId to fetch the Form.
Copy file name to clipboardExpand all lines: lib/model/query/forms.js
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -574,7 +574,15 @@ order by coalesce(form_defs.name, forms."xmlFormId") asc`)
574
574
// helper function to gate how form defs are joined to forms in _get
575
575
/* eslint-disable indent */
576
576
constversionJoinCondition=(version,enketoId)=>(
577
-
(enketoId) ? sql`form_defs."formId"=forms.id AND (form_defs."enketoId" = ${enketoId} OR (forms."enketoId" = ${enketoId} AND form_defs."publishedAt" IS NOT NULL))` :
577
+
(enketoId) ? sql`
578
+
form_defs."formId"=forms.id
579
+
AND (
580
+
form_defs."enketoId" = ${enketoId} AND form_defs.id = forms."draftDefId"
581
+
OR (
582
+
( forms."enketoId" = ${enketoId} OR forms."enketoOnceId" = ${enketoId} )
0 commit comments