Skip to content

Commit

Permalink
Fixing bug where alt sorting order of entries broke owner_groups (and…
Browse files Browse the repository at this point in the history
… everything)
  • Loading branch information
jegelstaff committed Dec 20, 2024
1 parent a0284c2 commit fe0d801
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/formulize/include/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ function processGetDataResults($resultData) {
// efficient single add in to dataset, since we don't cache this info in each entry, and gathering it as part of every getData query would be unnecessarily expensive
// If the user searches for a group name, then we do an unavoidable expensive subquery at that time, and we include the search term here to limit the groups shown,
// See origin of $ownerGroupSearchClause in the formulize_parseFilter function
// Funky ORDER BY using FIELD function. Wow!
if(count($totalMainFormEntryIdIndex) > 0) {
global $ownerGroupSearchClause;
$groupsTableJoinType = $ownerGroupSearchClause ? "INNER" : "LEFT";
Expand All @@ -1252,7 +1253,7 @@ function processGetDataResults($resultData) {
AND p.gperm_name = 'view_form'
$ownerGroupSearchClause
GROUP BY eog.entry_id
ORDER BY eog.entry_id";
ORDER BY FIELD(eog.entry_id, ".implode(', ', $totalMainFormEntryIdIndex).")";
$masterIndexer = 0;
if($res = $xoopsDB->query($sql)) {
while($row = $xoopsDB->fetchRow($res)) {
Expand Down

0 comments on commit fe0d801

Please sign in to comment.