Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
veronikaplenta committed Jul 11, 2023
1 parent dbf25b2 commit 617e6ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,14 @@ protected static function buildSearchQuery(array &$columns, array &$arrOptions,
}
}

if (!empty($sortBy) && \in_array($sortBy, ['title', 'tstamp', 'datePosted'], true)) {
$sortingFields = [];
foreach ($GLOBALS['TL_DCA']['tl_plenta_jobs_basic_offer']['fields'] as $name => $field) {
if (!empty($field['sorting'])) {
$sortingFields[] = $name;
}
}

if (!empty($sortBy) && \in_array($sortBy, $sortingFields, true)) {
if (!empty($order) && \in_array($order, ['ASC', 'DESC'], true)) {
$sortDirection = $order;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
],
],
'datePosted' => [
'sorting' => true,
'sql' => [
'type' => 'integer',
'unsigned' => true,
Expand Down

0 comments on commit 617e6ba

Please sign in to comment.