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

Plugin throwing an error when WP GraphQL is disabled #350

Open
colinmurphy opened this issue Feb 18, 2025 · 5 comments
Open

Plugin throwing an error when WP GraphQL is disabled #350

colinmurphy opened this issue Feb 18, 2025 · 5 comments
Assignees
Labels
type: bug Issue that causes incorrect or unexpected behavior

Comments

@colinmurphy
Copy link
Contributor

As reported by @justlevine

Steps to replicate

If you disable WP GraphQL while WP GraphQL Content Blocks is enabled, you will get a fatal error.

Image

@colinmurphy colinmurphy added the type: bug Issue that causes incorrect or unexpected behavior label Feb 18, 2025
@colinmurphy colinmurphy self-assigned this Feb 18, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Headless OSS Feb 18, 2025
@colinmurphy colinmurphy moved this from 🆕 Backlog to 🏗 In progress in Headless OSS Feb 18, 2025
@colinmurphy
Copy link
Contributor Author

@justlevine

I was able to replicate the issue locally.

So updating the library blakewilson/wp-enforce-semver to version 3 fixed the issue.

But also I don't think WP GraphQL Content Blocks should be loaded without WP GraphQL

So we could add something like this into the plugin description

 * Requires Plugins: wp-graphql

What do you think?

Image

@justlevine
Copy link
Contributor

justlevine commented Feb 18, 2025

@justlevine

But also I don't think WP GraphQL Content Blocks should be loaded without WP GraphQL

So we could add something like this into the plugin description

 * Requires Plugins: wp-graphql

What do you think?

I said it was a bad idea before y'all already implemented it in #332 🤷

Either way, requires plugins is a UX solution not a code one, (e.g. renaming the wp-graphql plugin folder, wp plugin deactivate --force, or simply a race condition when bulk activating/deactivating wp-graphql and wp-graphql-content-blocks together ).

If you're looking for a better long term solve I'd investigate replacing that semver library with what we now ship in WPGraphQL core - it probably needs some options exposed in core, but an internal goal is to make it easy for any extension to opt into WPGraphQL's semver for their own checking/updates.

@colinmurphy
Copy link
Contributor Author

Thanks @justlevine

Ah sorry you did point out about issues with requiring the plugin and that's a good point about the UX/code solution.

I definitely think we should look into longer term fix and seeing how we can integrate into core as it would make sense to me as this is a WP GraphQL extension that we would use the same service for SemVer as WP GraphQL. Thanks for sharing this as well 👍

@colinmurphy colinmurphy changed the title Plugin updater throwing an error when WP GraphQL is disabled Plugin throwing an error when WP GraphQL is disabled Feb 18, 2025
@josephfusco josephfusco moved this from 🏗 In progress to 🆕 Backlog in Headless OSS Feb 18, 2025
@theodesp
Copy link
Member

@colinmurphy can we just update

"blakewilson/wp-enforce-semver": "^3.0.1"

to its latest version?
I think that fixes the issue

@colinmurphy
Copy link
Contributor Author

Thanks @justlevine

We will look at getting the short term fix implemented this week and add the WP GraphQL Semver part to the backlog to do in the future.

@colinmurphy colinmurphy moved this from 🆕 Backlog to 🏗 In progress in Headless OSS Feb 26, 2025
colinmurphy added a commit that referenced this issue Feb 26, 2025
Updated semver plugin to version 3

Added wp-graphql as a required plugin to ensure you cannot enable the plguin without WPGraphQL enabled.
@colinmurphy colinmurphy moved this from 🏗 In progress to 👀 In review in Headless OSS Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issue that causes incorrect or unexpected behavior
Projects
Status: 👀 In review
Development

No branches or pull requests

3 participants