core icon indicating copy to clipboard operation
core copied to clipboard

Incorrect menu item URI when on 404 error page

Open hqmatics opened this issue 4 years ago • 2 comments

When navigating to a 404 page the menu item URI's are all pointing to the 404 page path.

Details

Question Answer
Relevant Bolt Version 4.1.18
Install type composer
PHP version 7.4
Web server Apache ]

Reproduction

Bug summary

When navigating to a 404 page the menu item URI's are all pointing to the 404 page path. Problem seems to be in Canonical class where $this->request->attributes is empty, unlike when requesting an existing page. In this case an empty path property is set.

Specifics

404 pages

Steps to reproduce

Create a menu config eg;

main:
  - label: Home
    title: Home
    link: homepage
    class: homepage
  - label: Item 2
    link: '#'
    submenu:
        - link: page/1
        - link: page/2
        - link: page/3
  - link: page/other
  - link: pagina/contact

Navigate to a none existing page (404), for example /404pagepath.

Expected result

Menu item URI's are pointing to correct records; /, /page/1, /page/2, ...

Actual result

Menu item URI's are all, but homepage, pointing to the 404 path of the current page. All items are 'active' in menu

/, /404pagepath, /404pagepath, ...

hqmatics avatar May 06 '21 13:05 hqmatics

@hqmatics @bobdenotter could this still be an issue? I cannot replicate.

abdellahrk avatar Sep 03 '22 13:09 abdellahrk