Project

General

Profile

Actions

Support #21122

closed

Q & A Plugin permalink issue

Added by scott voth 9 months ago. Updated 3 days ago.

Status:
Resolved
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 9 months 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 9 months 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 9 months ago

Thank you Ray!

Actions #4

Updated by scott voth 8 months ago

  • Status changed from New to Resolved
Actions #5

Updated by scott voth 3 days ago

  • Status changed from Resolved to Assigned

Hi Ray - This seems to be happening again. Maybe the theme got updated?

Actions #6

Updated by Raymond Hoh 3 days ago

  • Status changed from Assigned to Resolved
  • Target version set to 2.5.11

Thanks for uncovering this bug again, Scott.

I've committed some code that will prevent the Q and A plugin from trying to load their conditional template loading in https://github.com/cuny-academic-commons/cac/commit/d85c326b733e4e5d1e6677e69d27ed3279b1483a. I've pushed the fix to production and have also purged the cache for all the FAQ pages on the Help site so those pages should be viewable again.

Actions

Also available in: Atom PDF