wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
Composer package breaks
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
Plugin Versions
- WooGraphQL Version: 0.10.4
- WPGraphQL Version: 1.6.5
- WordPress Version: 5.8.1
- WooCommerce Version: 5.7.1
Additional context If I use composer to remove wp-graphql-woocommerce and install the exact same version from the zip file, it works fine.
@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.
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
@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.