mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge branch '3.0'
This commit is contained in:
commit
b69813af9f
@ -172,14 +172,8 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
||||
* @param SS_HTTPRequest $request
|
||||
*/
|
||||
public function doSearch($gridField, $request) {
|
||||
if($this->searchList) {
|
||||
$allList = $this->searchList;
|
||||
} else {
|
||||
$allList = DataList::create($gridField->getList()->dataClass());
|
||||
}
|
||||
|
||||
$filters = array();
|
||||
$stmts = array();
|
||||
$dataClass = $gridField->getList()->dataClass();
|
||||
$allList = $this->searchList ? $this->searchList : DataList::create($dataClass);
|
||||
|
||||
$searchFields = ($this->getSearchFields()) ? $this->getSearchFields() : $this->scaffoldSearchFields($dataClass);
|
||||
if(!$searchFields) {
|
||||
@ -189,6 +183,7 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
||||
}
|
||||
|
||||
// TODO Replace with DataList->filterAny() once it correctly supports OR connectives
|
||||
$stmts = array();
|
||||
foreach($searchFields as $searchField) {
|
||||
$stmts[] .= sprintf('"%s" LIKE \'%s%%\'', $searchField, Convert::raw2sql($request->getVar('gridfield_relationsearch')));
|
||||
}
|
||||
|
@ -328,6 +328,14 @@ class i18nTextCollector extends Object {
|
||||
*/
|
||||
function collectFromEntityProviders($filePath, $module = null) {
|
||||
$entities = array();
|
||||
|
||||
// HACK Ugly workaround to avoid "Cannot redeclare class PHPUnit_Framework_TestResult" error
|
||||
// when running text collector with PHPUnit 3.4. There really shouldn't be any dependencies
|
||||
// here, but the class reflection enforces autloading of seemingly unrelated classes.
|
||||
// The main problem here is the CMSMenu class, which iterates through test classes,
|
||||
// which in turn trigger autoloading of PHPUnit.
|
||||
$phpunitwrapper = PhpUnitWrapper::inst();
|
||||
$phpunitwrapper->init();
|
||||
|
||||
$classes = ClassInfo::classes_for_file($filePath);
|
||||
if($classes) foreach($classes as $class) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user