[FIX] website: use absolute href location after page url change
Before this commit: When editing a page URL through page properties it would redirect to that new url afterward. If the url was not starting with '/' and had multiple level before and after edition (eg: page/action to page/realaction) it would then redirect to a wrong relative URL. Now, we ensure that we redirect to the correct URL: the one slugified and cleaned in the backend. Step to reproduce: - Create a page '/page/action' - Go to that page and open Page Properties - Edit the URL to 'page/someaction' - You will be redirected to the incorrect relative URL /page/page/someaction
This commit is contained in:
@@ -715,7 +715,7 @@ class Page(models.Model):
|
||||
'website_id': website.id,
|
||||
})
|
||||
|
||||
return True
|
||||
return url
|
||||
|
||||
@api.multi
|
||||
def copy(self, default=None):
|
||||
|
||||
@@ -198,7 +198,7 @@ var PagePropertiesDialog = widget.Dialog.extend({
|
||||
kwargs: {
|
||||
context: context
|
||||
},
|
||||
}).then(function () {
|
||||
}).then(function (url) {
|
||||
// If from page manager: reload url, if from page itself: go to (possibly) new url
|
||||
if (self._getMainObject().model == 'website.page')
|
||||
window.location.href = url.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user