mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
FIX the autocomplete for adding a document to a page that already exists in the DMS.
This commit is contained in:
parent
3276320234
commit
5bf804c1af
@ -161,10 +161,9 @@ class DMSDocumentAddController extends LeftAndMain {
|
||||
public function documentautocomplete() {
|
||||
$term = $_GET['term'];
|
||||
$term_sql = Convert::raw2sql($term);
|
||||
$data = DataList::create('DMSDocument');
|
||||
$data->where("(\"ID\" LIKE '%$term_sql%' OR \"Filename\" LIKE '%$term_sql%' OR \"Title\" LIKE '%$term_sql%')");
|
||||
$data->limit(20);
|
||||
|
||||
$data = DMSDocument::get()
|
||||
->where("(\"ID\" LIKE '%".$term_sql."%' OR \"Filename\" LIKE '%".$term_sql."%' OR \"Title\" LIKE '%".$term_sql."%')")
|
||||
->limit(20);
|
||||
$return = array();
|
||||
foreach($data as $doc) {
|
||||
$return[] = array(
|
||||
|
Loading…
Reference in New Issue
Block a user