Project

General

Profile

Actions

Support #21122

open

Q & A Plugin permalink issue

Added by scott voth 24 days ago. Updated 24 days ago.

Status:
New
Priority name:
Normal
Assignee:
Category name:
WordPress Plugins
Target version:
-
Start date:
2024-10-01
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

I know that the Q & A plugin was deprecated awhile back. The Commons Help site is (I think) the only site that is still using it. We use it on four pages (example: https://help.commons.gc.cuny.edu/frequently-asked-questions-when-getting-started-with-the-commons/). We use the short code to pull FAQ by category. However, when a search is performed and the FAQ page is returned in the results, the permalink does not work. Actually none of the permalinks work, but this is only an issue when searching (since we use the short code).

For example, here we search by "existing site" (https://help.commons.gc.cuny.edu/?s=existing+site). The first result is a FAQ - its permalink does not resolve (https://help.commons.gc.cuny.edu/ faqs /attach-existing-site-to-group/) Even if you remove the /faqs/ the permalink doesn't work.

Is there an easy solution to this?

Actions #1

Updated by Boone Gorges 24 days ago

  • Assignee changed from Boone Gorges to Raymond Hoh

I spent a minute looking at this. The way that the plugin registers its post type causes some problems with the way it uses the 'taxonomies' flag when it registers a post type. But this alone didn't fix things on the production site - instead of 404ing, the site would then throw a white screen.

Ray, do you have a minute to have a look?

Actions #2

Updated by Raymond Hoh 24 days ago

The issue is due to Q&A's wonky custom template loading when using a new-school block theme: https://github.com/cuny-academic-commons/cac/blob/9af2cb1c04fbbd784507ac7ef3c172a674118ad6/wp-content/plugins/q-and-a/inc/functions.php#L112-L119

Since twentytwentytwo has a blank index.php, that is what is causing the white screen of death. I commented out the custom template loading line -- https://github.com/cuny-academic-commons/cac/blob/9af2cb1c04fbbd784507ac7ef3c172a674118ad6/wp-content/plugins/q-and-a/inc/functions.php#L127 -- and that fixed things.

Actions #3

Updated by scott voth 24 days ago

Thank you Ray!

Actions

Also available in: Atom PDF