mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Database quoting in TreeDropdownField (fixes #5484)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103515 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ad6f1adcd8
commit
7ae748a40f
@ -243,7 +243,7 @@ class TreeDropdownField extends FormField {
|
||||
if ( $this->searchCallback )
|
||||
$res = call_user_func($this->searchCallback, $this->sourceObject, $this->labelField, $this->search);
|
||||
else
|
||||
$res = DataObject::get($this->sourceObject, "$this->labelField LIKE '%$this->search%'");
|
||||
$res = DataObject::get($this->sourceObject, "\"$this->labelField\" LIKE '%$this->search%'");
|
||||
|
||||
if( $res ) {
|
||||
// iteratively fetch the parents in bulk, until all the leaves can be accessed using the tree control
|
||||
@ -252,7 +252,7 @@ class TreeDropdownField extends FormField {
|
||||
$this->searchIds[$row->ID] = true;
|
||||
}
|
||||
while (!empty($parents)) {
|
||||
$res = DB::query('SELECT "ParentID", "ID" FROM '.$this->sourceObject.' WHERE "ID" in ('.implode(',',array_keys($parents)).')');
|
||||
$res = DB::query('SELECT "ParentID", "ID" FROM \"' . $this->sourceObject . '\" WHERE "ID" in ('.implode(',',array_keys($parents)).')');
|
||||
$parents = array();
|
||||
|
||||
foreach($res as $row) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user