Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Use tree/xxx instead of tree?ID=xxx when fetching subtrees for…

… TreeDropdownField. Fix #7730
  • Loading branch information...
commit fb9e997b5e22ec8518967c69007632b8e5e90071 1 parent c28c024
@patbolo patbolo authored wilr committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 javascript/TreeDropdownField.js
View
8 javascript/TreeDropdownField.js
@@ -192,10 +192,12 @@
// TODO Hack to avoid ajax load on init, see http://code.google.com/p/jstree/issues/detail?id=911
'data': this.getPanel().find('.tree-holder').html(),
'ajax': {
- 'url': this.data('urlTree'),
+ 'url': function(node) {
+ return self.data('urlTree') + '/' + ($(node).data("id") ? $(node).data("id") : 0);
+ },
'data': function(node) {
- var id = $(node).data("id") ? $(node).data("id") : 0, params = self.getRequestParams();
- params = $.extend({}, params, {ID: id, ajax: 1});
+ var params = self.getRequestParams();
+ params = $.extend({}, params, {ajax: 1});
return params;
}
}

4 comments on commit fb9e997

@tractorcow
Owner

I have a small issue where this would break the translatable module. The resulting code would try to request a url similar to the below:

/admin/pages/EditorToolbar/LinkForm/field/internal/tree?locale=en_NZ/21&ajax=1

I'd issue a pull request if I knew how to submit more than one at once on Github. :)

@wilr
Collaborator

@tractorcow use branches for each pull request. E.g I have sapphire/fix-1234, sapphire/fix-foobar then you can submit as many pull requests as you want from different branches. Once the branch has been merged, then simply delete it.

@tractorcow
Owner

Thanks for the advice Will. It has helped me become a better community member. :)

@tractorcow
Owner

I've added my fix in a80daef. Thank you for your help.

Please sign in to comment.
Something went wrong with that request. Please try again.