Hello,
When I try to consult the activities related to a folder, the message “Retrieving activities” turns without returning me the results.
Here is the SQL query in error on the database side:g
2022-07-15 12:43:44.327 UTC [10198] ERROR: missing FROM-clause entry FOR TABLE "folderactionlogs" at CHARACTER 1323
2022-07-15 12:43:44.327 UTC [10198] STATEMENT:
SELECT
"ActionLogs"."id" AS "ActionLogs__id",
"ActionLogs"."user_id" AS "ActionLogs__user_id",
"ActionLogs"."action_id" AS "ActionLogs__action_id",
"ActionLogs"."context" AS "ActionLogs__context",
"ActionLogs"."status" AS "ActionLogs__status",
"ActionLogs"."created" AS "ActionLogs__created",
"Actions"."name" AS "Actions__name"
FROM
"action_logs" "ActionLogs"
INNER JOIN
(
(
SELECT
"ActionLogs"."id" AS "ActionLogs__id"
FROM
"action_logs" "ActionLogs"
INNER JOIN
"entities_history" "EntitiesHistory"
ON
"ActionLogs"."id" = "EntitiesHistory"."action_log_id"
INNER JOIN
"folders_history" "FoldersHistory"
ON
"FoldersHistory"."id" = "EntitiesHistory"."foreign_key"
WHERE
(
"FoldersHistory"."folder_id" = $1
AND "ActionLogs"."status" = $2)
GROUP BY
"ActionLogs"."id")
UNION
(
SELECT
"ActionLogs"."id" AS "ActionLogs__id"
FROM
"action_logs" "ActionLogs"
INNER JOIN
"entities_history" "EntitiesHistory"
ON
"ActionLogs"."id" = "EntitiesHistory"."action_log_id"
INNER JOIN
"permissions_history" "PermissionsHistory"
ON
"PermissionsHistory"."id" = "EntitiesHistory"."foreign_key"
INNER JOIN
"folders" "PermissionsHistoryFolders"
ON
"PermissionsHistoryFolders"."id" = "PermissionsHistory"."aco_foreign_key"
WHERE
(
"PermissionsHistoryFolders"."id" = $3
AND "ActionLogs"."status" = $4)
GROUP BY
"ActionLogs"."id")) "folderActionLogs"
ON
folderActionLogs.ActionLogs__id = ActionLogs.id
INNER JOIN
"users" "Users"
ON
"Users"."id" = "ActionLogs"."user_id"
INNER JOIN
"profiles" "Profiles"
ON
"Users"."id" = "Profiles"."user_id"
LEFT JOIN
"entities_history" "EntitiesHistory"
ON
"ActionLogs"."id" = "EntitiesHistory"."action_log_id"
LEFT JOIN
"permissions_history" "PermissionsHistory"
ON
"PermissionsHistory"."id" = "EntitiesHistory"."foreign_key"
LEFT JOIN
"users" "PermissionsHistoryUsers"
ON
"PermissionsHistoryUsers"."id" = "PermissionsHistory"."aro_foreign_key"
LEFT JOIN
"resources" "PermissionsHistoryResources"
ON
"PermissionsHistoryResources"."id" = "PermissionsHistory"."aco_foreign_key"
LEFT JOIN
"groups" "PermissionsHistoryGroups"
ON
"PermissionsHistoryGroups"."id" = "PermissionsHistory"."aro_foreign_key"
LEFT JOIN
"folders" "PermissionsHistoryFolders"
ON
"PermissionsHistoryFolders"."id" = "PermissionsHistory"."aco_foreign_key"
LEFT JOIN
"resources" "Resources"
ON
"Resources"."id" = "EntitiesHistory"."foreign_key"
LEFT JOIN
"secret_accesses" "SecretAccesses"
ON
"SecretAccesses"."id" = "EntitiesHistory"."foreign_key"
LEFT JOIN
"resources" "SecretAccessResources"
ON
"SecretAccessResources"."id" = "SecretAccesses"."resource_id"
LEFT JOIN
"secrets_history" "SecretsHistory"
ON
"SecretsHistory"."id" = "EntitiesHistory"."foreign_key"
LEFT JOIN
"users" "SecretsHistoryUsers"
ON
"SecretsHistoryUsers"."id" = "SecretsHistory"."user_id"
LEFT JOIN
"resources" "SecretsHistoryResources"
ON
"SecretsHistoryResources"."id" = "SecretsHistory"."resource_id"
LEFT JOIN
"folders_history" "FoldersHistory"
ON
"FoldersHistory"."id" = "EntitiesHistory"."foreign_key"
LEFT JOIN
"actions" "Actions"
ON
"Actions"."id" = "ActionLogs"."action_id"
WHERE
"ActionLogs"."status" = $5
GROUP BY
"ActionLogs"."id",
"Actions"."name"
ORDER BY
"ActionLogs"."created" DESC LIMIT 5 OFFSET 0
Thanks for the correction