Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#55653 closed defect (bug) (duplicate)

Undefined array key "path" in canonical.php on line 590

Reported by: antont39 Owned by:
Priority: normal Milestone:
Component: Permalinks Version: 5.9.3
Severity: trivial Keywords: has-patch
Cc: Focuses:

Description

I get an warning message on the main page when I'm at /page/1 and permalink(/%category%/%postname%) is set without a trailing slash.
And there is no redirect /page/1 -> /

Change History (5)

This ticket was mentioned in PR #2759 on WordPress/wordpress-develop by enricobattocchi.


4 years ago
#1

  • Keywords has-patch added

Make sure $redirect['path'] is defined after parsing the $redirect_url.

Trac ticket: https://core.trac.wordpress.org/ticket/55653

#2 @lopo
4 years ago

Welcome @antont39 and thanks for reporting this!
I can reproduce the problem on 6.0.
At first I was considering forcing a / when setting a custom permalink, but the issue is there even if you set "Numeric" (i.e. /archives/%post_id%) which is a default choice in the Permalinks page.

Pushed a PR but on second thought is looks like it's a duplicate of #51725 and the solution there seems to be working.

#3 @lopo
4 years ago

  • Resolutionduplicate
  • Status newclosed

Duplicate of #51725.

enricobattocchi commented on PR #2759:


4 years ago
#4

Closing since it's a duplicate of https://core.trac.wordpress.org/ticket/51725 and the solution there looks smarter.

#5 @desrosj
4 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.