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() {
|
public function documentautocomplete() {
|
||||||
$term = $_GET['term'];
|
$term = $_GET['term'];
|
||||||
$term_sql = Convert::raw2sql($term);
|
$term_sql = Convert::raw2sql($term);
|
||||||
$data = DataList::create('DMSDocument');
|
$data = DMSDocument::get()
|
||||||
$data->where("(\"ID\" LIKE '%$term_sql%' OR \"Filename\" LIKE '%$term_sql%' OR \"Title\" LIKE '%$term_sql%')");
|
->where("(\"ID\" LIKE '%".$term_sql."%' OR \"Filename\" LIKE '%".$term_sql."%' OR \"Title\" LIKE '%".$term_sql."%')")
|
||||||
$data->limit(20);
|
->limit(20);
|
||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach($data as $doc) {
|
foreach($data as $doc) {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user