Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] website: link a new page to existing menus having same page url #165326

Draft
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

paru-odoo
Copy link

This PR resolves an issue where menus created before a corresponding page existed wouldn't automatically delete when the page was removed. Previously, these menus were linked to the page's URL as a string instead of its pageID, preventing the automatic deletion through the ondelete cascade feature.

Steps to reproduce:

  1. Create a menu from the menu editor. E.g:
             Menu: test_menu ​
             URL: /test (right now we don't have any page for this URL).
  2. Create page with the same URL using the New Page option:
             Page title: test (let 'ADD to menu' button check)
  3. Delete this page:
             You will find test_menu is not deleted while its page gets deleted.

Expected Behavior: The test_menu should also be deleted automatically, along with the associated page.

To address this issue, this PR ensures that pageID are linked to menus that share the same URL at the time of the creation of a new page.

Task-3757369

Step to reproduce:
1. Create a menu from menu editor. E.g.
     ​  Menu: test_menu
     ​  URL: /test (right now we don't have any page exist for this URL)
2. Create page with the same URL using New Page option.
Page title : test (let 'ADD to menu' button check)
3. Delete this page
- You will find test_menu is not delete while it's page gets
  deleted

Currently, if menus were created before a page existed, they directly
link to the 'URL' as a string instead of a page ID. So when the page is
deleted later on, ondelete cascade won't be able to delete menus
automatically as they're not connected to the page ID.

To address this issue, this commit ensures that page ID are linked to
menus that share the same URL at the time of the creation of a new page.

Task-3757369
@robodoo
Copy link
Contributor

robodoo commented May 14, 2024

@C3POdoo C3POdoo added the RD research & development, internal work label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants