mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: the autoselection on linking sidebar for downloads did not work properly: the item would not be selected when the user clicked a link in the editor. Only numeric IDs were permitted, but the TreeDropdownField now supports other columns as IDs too, so enabled that for autoselection.
BUGFIX: asset search would fail - typo in request var and the sql query had unnecessarily escaped quotes (from r108351) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112720 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2262f3f25e
commit
b90e3a680c
@ -220,7 +220,7 @@ class TreeDropdownField extends FormField {
|
|||||||
if( isset($_REQUEST['forceValue']) || $this->value ) {
|
if( isset($_REQUEST['forceValue']) || $this->value ) {
|
||||||
$forceValue = ( isset($_REQUEST['forceValue']) ? $_REQUEST['forceValue'] : $this->value);
|
$forceValue = ( isset($_REQUEST['forceValue']) ? $_REQUEST['forceValue'] : $this->value);
|
||||||
if(($values = preg_split('/,\s*/', $forceValue)) && count($values)) foreach($values as $value) {
|
if(($values = preg_split('/,\s*/', $forceValue)) && count($values)) foreach($values as $value) {
|
||||||
if(!is_numeric($value)) continue;
|
if(!$value) continue;
|
||||||
|
|
||||||
$obj->markToExpose($this->objectForKey($value));
|
$obj->markToExpose($this->objectForKey($value));
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ class TreeDropdownField extends FormField {
|
|||||||
$this->searchIds[$row->ID] = true;
|
$this->searchIds[$row->ID] = true;
|
||||||
}
|
}
|
||||||
while (!empty($parents)) {
|
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();
|
$parents = array();
|
||||||
|
|
||||||
foreach($res as $row) {
|
foreach($res as $row) {
|
||||||
|
@ -188,7 +188,7 @@ TreeDropdownField.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
ajaxGetTree: function(after) {
|
ajaxGetTree: function(after) {
|
||||||
var ajaxURL = this.buildURL('tree?forceValues=' + this.inputTag.value);
|
var ajaxURL = this.buildURL('tree?forceValue=' + this.inputTag.value);
|
||||||
var secId = jQuery('[@name=SecurityID]');
|
var secId = jQuery('[@name=SecurityID]');
|
||||||
ajaxURL += secId.length ? '&SecurityID=' + secId.val() : '';
|
ajaxURL += secId.length ? '&SecurityID=' + secId.val() : '';
|
||||||
var localeField = jQuery(this.ownerForm()).find(':input[name=locale],:input[name=Locale]');
|
var localeField = jQuery(this.ownerForm()).find(':input[name=locale],:input[name=Locale]');
|
||||||
|
Loading…
Reference in New Issue
Block a user