I got this error in local

PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /modules/contrib/commerce/modules/order/src/Form/OrderTypeForm.php on line 19

[warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

and when i have put my code on live

PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /modules/contrib/commerce/modules/product/src/Form/ProductVariationForm.php on line 15

Comments

heni_deepak created an issue. See original summary.

heni_deepak’s picture

Title: PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /var/www/html/project/Test01/modules/contrib/commerce/modules/order/src/Form/OrderTypeForm.php on line 19 » PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in modules/contrib/commerce/modules/order/src/Form/OrderTypeForm.php on line 19
Issue summary: View changes
bojanz’s picture

Priority: Critical » Normal
Status: Active » Fixed

Your site is broken because you didn't update it properly (didn't use Composer?) and now your module versions are out of sync. This particular error is caused by Commerce being on a recent version, but Entity API being on an older version.

Also, keep in mind that "priority" is not used for support requests.

heni_deepak’s picture

I have used composer and code is working on local but when I zipped and move code live something was missing. maybe it's dependency file issue.

jimwcoleman’s picture

I am getting the same error and my site is broken. And yes, I did install everything via Composer as I always do ...

jimwcoleman’s picture

@heni_deepak - did you ever find a resolution? I have the exact same issue. My site is updated via composer. It works fine local but is totally crashed on remote. My site has been down for days and I still haven't found out why ... here's a clip from the log file...

[11-May-2019 19:40:14 America/Los_Angeles] PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /public_html/www.jimwcoleman.com/modules/contrib/commerce/modules/order/src/Form/Orde... on line 14
[11-May-2019 19:45:27 America/Los_Angeles] PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /public_html/www.jimwcoleman.com/modules/contrib/commerce/modules/order/src/Form/Orde... on line 14
[11-May-2019 19:50:57 America/Los_Angeles] PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /public_html/www.jimwcoleman.com/modules/contrib/commerce/modules/order/src/Form/Orde... on line 14
[11-May-2019 19:54:41 America/Los_Angeles] PHP Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /public_html/www.jimwcoleman.com/modules/contrib/commerce/modules/order/src/Form/Orde... on line 14

cristianalcaraz’s picture

I can confirm the same problem is happening to me after upgrading Commerce via composer to 2.13.0, had to downgrade to 2.12.0.

[public_html]# vendor/bin/drupal cr all
Fatal error: Trait 'Drupal\entity\Form\EntityDuplicateFormTrait' not found in /home/optikbcn/public_html/modules/contrib/commerce/modules/order/src/Form/OrderItemTypeForm.php on line 14
[public_html]# composer require drupal/commerce:2.12
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downgrading drupal/commerce (2.13.0 => 2.12.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
[public_html]# vendor/bin/drupal cr all
 Rebuilding cache(s), wait a moment please.

Please, reopen the issue.

bojanz’s picture

I already wrote what the problem is in #3. You need Entity API 1.0-rc2. You are running an older version. Update your Entity API module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

heni_deepak’s picture

I have solved this issue.
I have an updated All modules with dependency and also core dependency.

#3 also working for me.