[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:
Romain Derie
2018-03-08 16:25:50 +01:00
parent 0bde7aa106
commit 247f7db088
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -715,7 +715,7 @@ class Page(models.Model):
'website_id': website.id,
})
return True
return url
@api.multi
def copy(self, default=None):
+1 -1
View File
@@ -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();