mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Sort assets by ID so matching '2' doesn't first match newer records
This commit is contained in:
parent
caf1971c84
commit
bd8e88e2ab
@ -166,11 +166,13 @@ class DMSDocumentAddController extends LeftAndMain {
|
||||
}
|
||||
|
||||
public function documentautocomplete() {
|
||||
$term = $_GET['term'];
|
||||
$term = (isset($_GET['term'])) ? $_GET['term'] : '';
|
||||
$term_sql = Convert::raw2sql($term);
|
||||
$data = DMSDocument::get()
|
||||
->where("(\"ID\" LIKE '%".$term_sql."%' OR \"Filename\" LIKE '%".$term_sql."%' OR \"Title\" LIKE '%".$term_sql."%')")
|
||||
->sort('ID ASC')
|
||||
->limit(20);
|
||||
|
||||
$return = array();
|
||||
foreach($data as $doc) {
|
||||
$return[] = array(
|
||||
|
Loading…
Reference in New Issue
Block a user