File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -539,13 +539,14 @@ public function list(): JsonResponse
539539 );
540540
541541 $ onlyActive = (bool ) $ this ->configuration ->get ('api.onlyActiveFaqs ' );
542+ $ ignoreOrphanedFaqs = (bool ) $ this ->configuration ->get ('api.ignoreOrphanedFaqs ' );
542543
543544 // Get all FAQs (this populates $faq->faqRecords)
544545 $ faq ->getAllFaqs (
545546 FAQ_SORTING_TYPE_CATID_FAQID ,
546547 [
547548 'lang ' => $ this ->configuration ->getLanguage ()->getLanguage (),
548- 'fcr.category_id ' => 'IS NOT NULL ' ,
549+ 'fcr.category_id ' => $ ignoreOrphanedFaqs ? 'IS NOT NULL ' : null ,
549550 'fd.active ' => $ onlyActive ? 'yes ' : null ,
550551 ],
551552 $ sort ->getOrderSql (),
Original file line number Diff line number Diff line change @@ -1333,6 +1333,9 @@ public function getAllFaqs(
13331333 ): void {
13341334 $ where = '' ;
13351335 if (!is_null ($ condition )) {
1336+ // Filter out null values from conditions
1337+ $ condition = array_filter ($ condition , fn ($ value ) => $ value !== null );
1338+
13361339 $ num = count ($ condition );
13371340 $ where = 'WHERE ' ;
13381341 foreach ($ condition as $ field => $ data ) {
You can’t perform that action at this time.
0 commit comments