From 618d7e60a35d19bc50f997866d88a9469d8ae00c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 10 Mar 2010 00:46:17 +0000 Subject: [PATCH] BUGFIX TreeSelectorField doubles up on concating base_url, doesn't include the security ID (#5164, thanks marcus) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100755 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/TreeSelectorField.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/javascript/TreeSelectorField.js b/javascript/TreeSelectorField.js index 4e2c6933b..34397619f 100755 --- a/javascript/TreeSelectorField.js +++ b/javascript/TreeSelectorField.js @@ -188,13 +188,12 @@ TreeDropdownField.prototype = { }, ajaxGetTree: function(after) { - var baseTags = document.getElementsByTagName('base'); - var base = (baseTags) ? baseTags[0].href : ''; - var ajaxURL = base + this.buildURL('tree?forceValues=' + this.inputTag.value); - ajaxURL += $('SecurityID') ? '&SecurityID=' + $('SecurityID').value : ''; + var ajaxURL = this.buildURL('tree?forceValues=' + this.inputTag.value); + var secId = jQuery('[@name=SecurityID]'); + ajaxURL += secId.length ? '&SecurityID=' + secId.val() : ''; if($('Form_EditForm_Locale')) ajaxURL += "&locale=" + $('Form_EditForm_Locale').value; - if ( this.inputTag.value ) ajaxURL += '&forceValue=' + this.inputTag.value; - if (this.search() != null) ajaxURL += "&search=" + this.search(); + if(this.inputTag.value) ajaxURL += '&forceValue=' + this.inputTag.value; + if(this.search() != null) ajaxURL += "&search=" + this.search(); new Ajax.Request(ajaxURL, { method : 'get', onSuccess : after,