Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect against 404s when wpBasePage is mixed case but page slug isn't #19063

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

christianwach
Copy link
Member

Overview

Partial fix for this issue on Lab.

Before

WordPress shows a 404 when wpBasePage is saved in mixed-case (e.g. "CiviCRM") and no CiviCRM content is rendered.

After

WordPress does not show a 404 when wpBasePage is saved in mixed-case (e.g. "CiviCRM") and renders CiviCRM content as expected.

Technical Details

WordPress requires wpBasePage to be lowercase or else it won't find the Base Page. If I understand how $config->wpBasePage is read, then this PR should always force it to lowercase regardless of what is saved.

This is only a partial fix because it papers over a deeper issue, which is that ideally the $post->post_name value that is stored in wpBasePage should be replaced with a wpBasePageID setting that saves the $post->ID.

@civibot
Copy link

civibot bot commented Nov 27, 2020

(Standard links)

@civibot civibot bot added the master label Nov 27, 2020
@eileenmcnaughton
Copy link
Contributor

Makes sense - I'll leave it to @kcristiano to merge

@agileware-justin
Copy link
Contributor

Related bug report, https://lab.civicrm.org/dev/core/-/issues/2213

@agileware-justin
Copy link
Contributor

Good to merge. Thanks @christianwach and @kcristiano

@eileenmcnaughton eileenmcnaughton merged commit f6c3885 into civicrm:master Nov 30, 2020
@christianwach christianwach changed the title Protect against 404s when wpBasePage is mixed case Protect against permalink 404s when wpBasePage is mixed case Dec 3, 2020
@christianwach christianwach changed the title Protect against permalink 404s when wpBasePage is mixed case Protect against 404s when wpBasePage is mixed case but page slug isn't Dec 3, 2020
@christianwach christianwach deleted the lab-core-2213 branch March 22, 2022 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants