[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [BP][FIX] list_pages(): properly handle 'langOrphan' filter using 'NOT IN'
"Olivier Kango \(@olivierkango\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69b9414022f9_3b193da41016a9@gitlab-sidekiq-low-urgency-cpu-bound-v2-7fb98cc9d4-lsrzf.mail> |
Olivier Kango pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki
Commits:
7f07b1af by Olivier Kango at 2026-03-17T13:48:49+02:00
[BP][FIX] list_pages(): properly handle 'langOrphan' filter using 'NOT IN'
---
* [BP][FIX] list_pages(): properly handle 'langOrphan' filter using 'NOT IN'
---
* [FIX] list_pages(): properly handle 'langOrphan' filter using 'NOT IN'
---
* [FIX] Correctly filter langOrphan pages by checking untranslated traId groups
* [FIX] list_pages(): properly handle 'langOrphan' filter using 'NOT IN'
See merge request tikiwiki/tiki!7992
(cherry picked from commit 7d0c91e1a694e765ddbbe26ce0665681e385d853)
See merge request tikiwiki/tiki!9770
(cherry picked from commit 23723db3b90fb9f6aaf4701990d1bdc7a36c99e4)
See merge request tikiwiki/tiki!9772
- - - - -
1 changed file:
- lib/tikilib.php
Changes:
=====================================
lib/tikilib.php
=====================================
@@ -3822,10 +3822,13 @@ class TikiLib extends TikiDb_Bridge
$join_tables .= " inner join `tiki_structures` as ts on (ts.`page_id` = tp.`page_id` and ts.`parent_id` = 0) ";
$select .= ',ts.`page_alias`';
} elseif ($type == 'langOrphan') {
- $join_tables .= " left join `tiki_translated_objects` tro on (tro.`type` = 'wiki page' AND tro.`objId` = tp.`page_id`) ";
- $tmp_mid[] = "( (tro.`traId` IS NULL AND tp.`lang` != ?) OR tro.`traId` NOT IN(SELECT `traId` FROM `tiki_translated_objects` WHERE `lang` = ?))";
- $bindvars[] = $val;
- $bindvars[] = $val;
+ $langs = is_array($val) ? $val : [$val];
+ $placeholders = implode(',', array_fill(0, count($langs), '?'));
+
+ $join_tables .= " left join `tiki_translated_objects` tro on (tro.`type` = 'wiki page' and tro.`objId` = tp.`page_id`) ";
+ $tmp_mid[] = "((tro.`traId` IS NULL AND tp.`lang` NOT IN ($placeholders)) OR tro.`traId` NOT IN (SELECT `traId` FROM `tiki_translated_objects` WHERE `lang` IN ($placeholders)))";
+
+ $bindvars = array_merge($bindvars, $langs, $langs);
} elseif ($type == 'structure_orphans') {
$join_tables .= " left join `tiki_structures` as tss on (tss.`page_id` = tp.`page_id`) ";
$tmp_mid[] = "(tss.`page_ref_id` is null)";
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7f07b1af920abe5664c406fe857935e3cd63ec81
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7f07b1af920abe5664c406fe857935e3cd63ec81
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs