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

Posts Route Detection - crash if not configured #4

Open
robballantyne opened this issue Mar 30, 2022 · 2 comments
Open

Posts Route Detection - crash if not configured #4

robballantyne opened this issue Mar 30, 2022 · 2 comments
Assignees
Labels
unconfirmed bug Cannot replicate bug

Comments

@robballantyne
Copy link
Contributor

Reported via discord (@damsfx)

PostsRouteDetection.php

If the plugin have no settings defined (no matching page to show his components), it crashed the entire wn-pages-plugin.
Adding some page with matching components resolve the issue.
Maybe the plugin should use fall-back settings when these are not given.

// Actual
Settings::instance()->get('postPage')
// Better ??
 Settings::instance()->get('postPage', 'post-page')
@robballantyne robballantyne self-assigned this Mar 30, 2022
@robballantyne robballantyne added the unconfirmed bug Cannot replicate bug label Mar 30, 2022
@robballantyne
Copy link
Contributor Author

I have tried to replicate this using the default Winter theme with no Posts pages and no configuration of the Posts plugin. Static pages were working as expected. Please could you provide concrete steps to reproduce the issue?

PostsRouteDetection event should not interfere with routing unless a page has already been defined to handle the matching slug (in Posts settings). I would like to fix this if it's definitely the plugin causing the problem.

@damsfx
Copy link
Contributor

damsfx commented Mar 31, 2022

I only notice this bug when the theme does not "yet" have the pages required by the plugin.
As soon as these are defined in the settings, there is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug Cannot replicate bug
Projects
None yet
Development

No branches or pull requests

2 participants