Project

General

Profile

Actions

Bug #25161

closed

Docs Showing

Added by Luke Waltzer 3 days ago. Updated 2 days ago.

Status:
Resolved
Priority name:
Normal
Assignee:
-
Category name:
-
Target version:
Start date:
2026-06-23
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Manually misnavigated to commons.gc.cuny.edu/news, and it redirected me to https://commons.gc.cuny.edu/docs/news/... was like a blast from the past, but I wasn't sure if we wanted that to be showing?

Actions #1

Updated by Boone Gorges 2 days ago

  • Status changed from New to Resolved
  • Target version set to 2.7.7

What's happening here is WP's "canonical redirect" system. When a query 404s, like commons.gc.cuny.edu/news, WP tries to be helpful by looking for the post you probably meant. In this case, it's finding an old Doc with the slug 'news'.

There's existing logic on the Commons to prevent Docs from being visible at their bare "CPT" URLs. So URLs like /docs/news would redirect to the URL of the Doc embedded in its associated group. It just so happens that this particular Doc is orphaned - it doesn't have an associated group. I'm not sure why this is the case. So you end up with the doubly-undesirable behavior of (a) being redirected to this doc in the first place, and (b) seeing the doc out of the group context.

In https://github.com/cuny-academic-commons/cac/commit/2168c11155c36d275042fdda4ff9fecd8567efc4 I added a blanket restriction such that the canonical redirect lookup shouldn't match a Doc. I've pushed this to production. https://commons.gc.cuny.edu/news now 404s, which is expected behavior as the page does not exist.

Actions

Also available in: Atom PDF