Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sorting change #2

Merged
merged 1 commit into from about 2 years ago

2 participants

Nick Dunn Rowan Lewis
Nick Dunn
Owner

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.

Rowan Lewis rowan-lewis merged commit 47138c9 into from
Rowan Lewis rowan-lewis closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 11, 2012
Nick Dunn Allow field to be sorted by recency of pilfering 8d3f168
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  fields/field.uniquecheckbox.php
2  fields/field.uniquecheckbox.php
@@ -179,7 +179,7 @@ public function buildSortingSQL(&$joins, &$where, &$sort, $order = 'ASC') {
179 179
 					`tbl_entries_data_{$field_id}` AS ed
180 180
 					ON (e.id = ed.entry_id)
181 181
 			";
182  
-			$sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "ed.value {$order}");
  182
+			$sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "ed.order {$order}");
183 183
 		}
184 184
 		
185 185
 		public function buildDSRetrivalSQL($data, &$joins, &$where, $andOperation = false) {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.