Skip to content

Commit

Permalink
Ignore duplicate quick filter options from linked sources
Browse files Browse the repository at this point in the history
  • Loading branch information
jegelstaff committed Feb 9, 2024
1 parent adb6ce4 commit be268f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/formulize/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4628,13 +4628,18 @@ function buildFilter($id, $element_identifier, $defaultText="", $formDOMId="", $
}
if(count((array) $linked_column_values)>0) {
// set option to entry id, with the linked columns as the label
$options[$dataRow[$linked_column_count]] = implode(" | ", $linked_column_values);
$concatenatedValues = implode(" | ", $linked_column_values);
if(!in_array($concatenatedValues, $options)) {
$options[$dataRow[$linked_column_count]] = $concatenatedValues;
}
}
}
} else {
while($dataRow = $xoopsDB->fetchRow($dataResult)) {
$linked_value = prepvalues($dataRow[0], $linked_columns[0], $dataRow[1]);
$options[$dataRow[1]] = $linked_value[0];
if(!in_array($linked_value[0], $options)) {
$options[$dataRow[1]] = $linked_value[0];
}
}
}
}
Expand Down

0 comments on commit be268f0

Please sign in to comment.