mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Fixed url_segment undefined error in CMSMain.EditForm, assuming
*all* title fields have a URLSegment field associated with them, which they don't.
This commit is contained in:
parent
4286bf0844
commit
b0a026b4c6
@ -30,19 +30,21 @@
|
||||
var live_url_segment = $('input[name=LiveURLSegment]', form);
|
||||
|
||||
self._addActions();
|
||||
|
||||
this.bind('change', function(e) {
|
||||
var title = self.val();
|
||||
// Criteria for defining a "new" page
|
||||
if ( (url_segment.val().indexOf("new") == 0) && live_url_segment.val() == "" ) {
|
||||
self.updateRelatedFields(title);
|
||||
self.updateURLSegment(title);
|
||||
} else {
|
||||
$('.update', self.parent()).show();
|
||||
}
|
||||
self.updatePanelLabels(title);
|
||||
});
|
||||
|
||||
|
||||
if(url_segment.length > 0) {
|
||||
this.bind('change', function(e) {
|
||||
var title = self.val();
|
||||
// Criteria for defining a "new" page
|
||||
if ((url_segment.val().indexOf('new') == 0) && live_url_segment.val() == '') {
|
||||
self.updateRelatedFields(title);
|
||||
self.updateURLSegment(title);
|
||||
} else {
|
||||
$('.update', self.parent()).show();
|
||||
}
|
||||
self.updatePanelLabels(title);
|
||||
});
|
||||
}
|
||||
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user