Make WordPress Core

Opened 15 months ago

#60162 new defect (bug)

Navigation block rending content from post with shared ID

Reported by: dsteersf1's profile dsteersf1 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.4.2
Component: Menus Keywords:
Focuses: template Cc:

Description

Hello,

I believe I've found a somewhat niche issue. I have a wordpress multisite with four sites housed within it. I recently came across an issue where on one of my archive pages for an event content type, on one of the sites only, the header (leveraging a template part with a navigation block inside) is rendering content from one of the pages within the result list. This archive is leveraging cross site indexing powered by elasticpress to search and return content from this content type from all four sites in one archive page.

After some investigation, I found that the ID of the navigation matched that of one of the events published on a separate site and that the post_content for that event is being rendered in place of the post_content of the wp_navigation object which has the matching ID. This seems to be a very rare condition however it might be beneficial to have some kind of post_type check before render since this is a possible issue.

Attachments (2)

Screenshot 2023-12-28 at 9.05.53 AM.png (371.3 KB) - added by dsteersf1 15 months ago.
Screenshot of the header with the navigation being replaced by page content from one of the events
Screenshot 2023-12-28 at 9.06.44 AM.png (147.1 KB) - added by dsteersf1 15 months ago.
Screenshot of the same header with non-matching navigation and event ids in the system

Download all attachments as: .zip

Change History (2)

@dsteersf1
15 months ago

Screenshot of the header with the navigation being replaced by page content from one of the events

@dsteersf1
15 months ago

Screenshot of the same header with non-matching navigation and event ids in the system

Note: See TracTickets for help on using tickets.