mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-06-29 07:59:37 +02:00
BUG Fix regressions from https://github.com/silverstripe/silverstripe-framework/pull/5653
This commit is contained in:
parent
e5aad336ce
commit
f8b1c27e3c
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
|
use SilverStripe\ORM\FieldType\DBField;
|
||||||
use SilverStripe\ORM\ValidationException;
|
use SilverStripe\ORM\ValidationException;
|
||||||
use SilverStripe\Security\Member;
|
use SilverStripe\Security\Member;
|
||||||
use SilverStripe\Security\Security;
|
use SilverStripe\Security\Security;
|
||||||
|
@ -30,7 +31,7 @@ class CMSPageAddController extends CMSPageEditController {
|
||||||
$type->getField('AddAction'),
|
$type->getField('AddAction'),
|
||||||
$type->getField('Description')
|
$type->getField('Description')
|
||||||
);
|
);
|
||||||
$pageTypes[$type->getField('ClassName')] = $html;
|
$pageTypes[$type->getField('ClassName')] = DBField::create_field('HTMLFragment', $html);
|
||||||
}
|
}
|
||||||
// Ensure generic page type shows on top
|
// Ensure generic page type shows on top
|
||||||
if(isset($pageTypes['Page'])) {
|
if(isset($pageTypes['Page'])) {
|
||||||
|
@ -68,7 +69,10 @@ class CMSPageAddController extends CMSPageEditController {
|
||||||
),
|
),
|
||||||
$typeField = new OptionsetField(
|
$typeField = new OptionsetField(
|
||||||
"PageType",
|
"PageType",
|
||||||
sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')),
|
DBField::create_field(
|
||||||
|
'HTMLFragment',
|
||||||
|
sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type'))
|
||||||
|
),
|
||||||
$pageTypes,
|
$pageTypes,
|
||||||
'Page'
|
'Page'
|
||||||
),
|
),
|
||||||
|
@ -84,14 +88,11 @@ class CMSPageAddController extends CMSPageEditController {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$parentField->setSearchFunction(function ($sourceObject, $labelField, $search) {
|
$parentField->setSearchFunction(function ($sourceObject, $labelField, $search) {
|
||||||
return DataObject::get(
|
return DataObject::get($sourceObject)
|
||||||
$sourceObject,
|
->filterAny([
|
||||||
sprintf(
|
'MenuTitle:PartialMatch' => $search,
|
||||||
"\"MenuTitle\" LIKE '%%%s%%' OR \"Title\" LIKE '%%%s%%'",
|
'Title:PartialMatch' => $search,
|
||||||
Convert::raw2sql($search),
|
]);
|
||||||
Convert::raw2sql($search)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO Re-enable search once it allows for HTML title display,
|
// TODO Re-enable search once it allows for HTML title display,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user