-
- Downloads
[FIX] website: properly add anchors into website menu
Prior to this commit, adding an anchor using auto-complete would not
properly prefix the url with the URL of the current page.
Steps to reproduce:
- Create a page (e.g. /test), add blocks and create an anchor (e.g.
- Save the page
- Click on "Edit Menu" in "Pages"
- Add a new menu entry
- Type '#' in the URL field and select the anchor
- Save
=> The menu entry is wrongly set as it does not contain the original
page's URL inside the `href` attribute. This means that clicking on the
menu from any other place will not properly redirect to the anchor on
the /test page
On top of that, editing a menu entry that was previously linked to a
page would change the URL of the page with an anchor, making it
impossible to access the page anymore until you change the URL back in
the page manager.
Steps to reproduce:
- Create a new page (e.g. test)
- Add a new menu entry that has this page as its URL
- Save the new menu entry (close the dialogs)
- Re-open the Menu dialog and edit the newly created menu entry
- In the URL field, replace it with the page + an anchor
(e.g. /test#anchor)
- Save
=> The page's URL is now /test#anchor and is no longer accessible
The is due to the `save` method of the `website.menu` model not
containing code to properly manage adding an anchor to the menu.
This commit fixes that.
opw-3067750
closes odoo/odoo#106882
Signed-off-by:
Romain Derie (rde) <rde@odoo.com>
Loading