Skip to content

Commit

Permalink
Merge branch '4.0' into 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Nov 2, 2024
2 parents 5b5879f + c39c4dd commit 1577aab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions phpmyfaq/src/phpMyFAQ/Faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,11 +1151,14 @@ public function getFaqBySolutionId(int $solutionId): void
$queryHelper = new QueryHelper($this->user, $this->groups);
$query = sprintf(
'SELECT
*
fd.*, COALESCE(fdg.group_id, -1) AS group_id, fdu.user_id
FROM
%sfaqdata fd
LEFT JOIN
%sfaqdata_group fdg
LEFT JOIN (
SELECT record_id, group_id FROM %sfaqdata_group fdg WHERE fdg.group_id <> -1
UNION ALL
SELECT fd.id AS record_id, -1 AS group_id FROM %sfaqdata fd WHERE fd.solution_id = %d
) AS fdg
ON
fd.id = fdg.record_id
LEFT JOIN
Expand All @@ -1169,6 +1172,8 @@ public function getFaqBySolutionId(int $solutionId): void
Database::getTablePrefix(),
Database::getTablePrefix(),
$solutionId,
Database::getTablePrefix(),
$solutionId,
$queryHelper->queryPermission($this->groupSupport)
);

Expand Down

0 comments on commit 1577aab

Please sign in to comment.