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

Class "craft\commerce\Plugin" not found #1556

Closed
jamesmacwhite opened this issue Nov 30, 2024 · 2 comments
Closed

Class "craft\commerce\Plugin" not found #1556

jamesmacwhite opened this issue Nov 30, 2024 · 2 comments
Labels

Comments

@jamesmacwhite
Copy link
Contributor

jamesmacwhite commented Nov 30, 2024

Description

This error is being triggered on Feed Me import (got the error when using the debug feed locally). We are not use Craft Commerce and it is not installed.

Potentially introduced by: 4e2f1b4

This may need to be more defensive and guarded against, i.e. ensuring the Craft Commerce plugin/instance exists before calling it.

I believe currently in this scenario, this is always being called on any EVENT_AFTER_PROCESS_FEED event, without checking if the Craft Commerce plugin/class is present.

Steps to reproduce

  1. Run feed with debug option
  2. Error with Class "craft\commerce\Plugin" not found is thrown after feed has finished processing.

Error: Class "craft\commerce\Plugin" not found in /var/www/html/vendor/craftcms/feed-me/src/elements/CommerceProduct.php:149
Stack trace:
#0 [internal function]: craft\feedme\elements\CommerceProduct->craft\feedme\elements{closure}()
#1 /var/www/html/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#2 /var/www/html/vendor/yiisoft/yii2/base/Component.php(650): yii\base\Event::trigger()
#3 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(591): yii\base\Component->trigger()
#4 /var/www/html/vendor/craftcms/feed-me/src/services/Process.php(631): craft\feedme\services\Process->afterProcessFeed()
#5 /var/www/html/vendor/craftcms/feed-me/src/controllers/FeedsController.php(296): craft\feedme\services\Process->debugFeed()
#6 [internal function]: craft\feedme\controllers\FeedsController->actionDebug()
#7 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#8 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#9 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#10 /var/www/html/vendor/craftcms/cms/src/web/Application.php(350): yii\base\Module->runAction()
#11 /var/www/html/vendor/craftcms/cms/src/web/Application.php(649): craft\web\Application->runAction()
#12 /var/www/html/vendor/craftcms/cms/src/web/Application.php(312): craft\web\Application->_processActionRequest()
#13 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()
#14 /var/www/html/public/index.php(12): yii\base\Application->run()
#15 {main}

Additional info

  • Craft version: 5.5.3
  • PHP version: 6.6.0
  • Database driver & version: MySQL 8
  • Plugins & versions:
@angrybrad
Copy link
Member

Oops - just released 6.6.1 with a fix for this.

@jamesmacwhite
Copy link
Contributor Author

Thanks for the quick fix and release!

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

No branches or pull requests

2 participants