From 060fa1e30dfcfadabfd56843006b74d0518f9ad9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 12 Feb 2010 02:06:08 +0000 Subject: [PATCH] BUGFIX Fixed URL generation in TreeSelectorField.js, was failing to detect relative URLs - prefixing with URL as a workaround git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98853 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/TreeSelectorField.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/TreeSelectorField.js b/javascript/TreeSelectorField.js index 55b7ce9b7..00956ebeb 100755 --- a/javascript/TreeSelectorField.js +++ b/javascript/TreeSelectorField.js @@ -181,7 +181,9 @@ TreeDropdownField.prototype = { }, ajaxGetTree: function(after) { - var ajaxURL = this.buildURL('tree?forceValues=' + this.inputTag.value); + 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 : ''; if($('Form_EditForm_Locale')) ajaxURL += "&locale=" + $('Form_EditForm_Locale').value; if ( this.inputTag.value ) ajaxURL += '&forceValue=' + this.inputTag.value;