wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
648 stars 130 forks source link

Composer package breaks #560

Open jmotes opened 3 years ago

jmotes commented 3 years ago

Describe the bug

I'm new to composer, but it seems somehow composer is autoloading the wrong namespace when calling the setup_minor_integrations method.

 Fatal error: Uncaught Error: Call to undefined function WPGraphQL\WooCommerce\Functions\setup_minor_integrations() in C:\Users\jonat\Documents\GitHub\gravity\backend\plugins\wp-graphql-woocommerce\includes\class-wp-graphql-woocommerce.php on line 197

To Reproduce

composer require wpackagist-plugin/wp-graphql
composer require wpackagist-plugin/woocommerce
composer require wp-graphql/wp-graphql-woocommerce

Go to WP admin and activate the plugin to see the error.

Expected behavior Plugin to activate successfully.

Screenshots image

Plugin Versions

Additional context If I use composer to remove wp-graphql-woocommerce and install the exact same version from the zip file, it works fine.

jmotes commented 3 years ago

@jasonbahl sorry to tag you, but do you know anyone that would be interested in assisting with this? I saw some participants in previous composer bugs but I cannot tag them:

https://github.com/wp-graphql/wp-graphql-woocommerce/issues/202 https://github.com/wp-graphql/wp-graphql-woocommerce/pull/203 https://github.com/wp-graphql/wp-graphql-woocommerce/issues/246

I would love to help out as well if you can point me in the right direction! My knowledge of composer is rather limited at the moment so I'm not sure where to start.

GPorter43 commented 3 years ago

I had a very similar problem I solved it by using the terminal and going into the folder for wpgraphql and wp-graphql/wp-graphql-woocommerce and running "Composer Install" then activate them in that order. I am quite new to Composer also but the gist i get is that the dependancies they require don't get installed, it may be worth deleting the Composer.lock file before installing

jmotes commented 3 years ago

@GPorter43 running composer install inside the wp-graphql-woocommerce directory before activating the extension did solve the issue for me. Thank you so much!

I guess this is still a bug though so will leave for @kidunot89 to decide whether to leave open.