mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: tree selector base URL calculation wrong when field is nested (from r99739)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105523 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
54ecf20f68
commit
7f2d888a40
@ -60,7 +60,14 @@ TreeDropdownField.prototype = {
|
|||||||
// Build a URL from the field's base URL and the given sub URL
|
// Build a URL from the field's base URL and the given sub URL
|
||||||
buildURL: function(subURL) {
|
buildURL: function(subURL) {
|
||||||
var baseURL = jQuery(this).attr('href');
|
var baseURL = jQuery(this).attr('href');
|
||||||
if (!baseURL) baseURL = this.ownerForm().action + '/field/' + this.getName() + '/';
|
if (!baseURL) {
|
||||||
|
// Occurs if treedropdown has no form e.g. treefields in widget areas.
|
||||||
|
baseURL = this.ownerForm().action + '/field/' + this.getName() + '/';
|
||||||
|
var baseTags = document.getElementsByTagName('base');
|
||||||
|
var base = (baseTags) ? baseTags[0].href : '';
|
||||||
|
if (base == baseURL.substring(0, base.length))
|
||||||
|
baseURL = baseURL.substring(base.length);
|
||||||
|
}
|
||||||
var subHasQuerystring = subURL.match(/\?/);
|
var subHasQuerystring = subURL.match(/\?/);
|
||||||
|
|
||||||
if(baseURL.match(/^(.*)\?(.*)$/)) {
|
if(baseURL.match(/^(.*)\?(.*)$/)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user