Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Sorting change #2

Merged
merged 1 commit into from

2 participants

@nickdunn

Really small update. Sorting on yes/no didn't make too much sense in this context, so I changed the field to sort on the order column instead. This allows you to get a list of entries back where the box is ticked (e.g. a "Feature on the homepage" checkbox) but also sorted by the order in which they were featured. No need to cobble together a checkbox and order entries to achieve the same spunktionality.

@psychoticmeow psychoticmeow merged commit 47138c9 into symphonists:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 11, 2012
  1. @nickdunn
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  fields/field.uniquecheckbox.php
View
2  fields/field.uniquecheckbox.php
@@ -179,7 +179,7 @@ public function buildSortingSQL(&$joins, &$where, &$sort, $order = 'ASC') {
`tbl_entries_data_{$field_id}` AS ed
ON (e.id = ed.entry_id)
";
- $sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "ed.value {$order}");
+ $sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "ed.order {$order}");
}
public function buildDSRetrivalSQL($data, &$joins, &$where, $andOperation = false) {
Something went wrong with that request. Please try again.