mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Search callback for "add page" selector
Necessary since we now default $showSearch=true in TreeDropdownField. See https://github.com/silverstripe/silverstripe-framework/pull/2364
This commit is contained in:
parent
cdb4ab4fbc
commit
4e031076be
@ -81,6 +81,16 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
)
|
||||
)
|
||||
);
|
||||
$parentField->setSearchFunction(function ($sourceObject, $labelField, $search) {
|
||||
return DataObject::get(
|
||||
$sourceObject,
|
||||
sprintf(
|
||||
"\"MenuTitle\" LIKE '%%%s%%' OR \"Title\" LIKE '%%%s%%'",
|
||||
Convert::raw2sql($search),
|
||||
Convert::raw2sql($search)
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
// TODO Re-enable search once it allows for HTML title display,
|
||||
// see http://open.silverstripe.org/ticket/7455
|
||||
|
Loading…
Reference in New Issue
Block a user