Just installed Commerce 8.x-2.13 and created 1 product. When I go to view the product, or when editing the product and clicking on the "Variations" tab:
InvalidArgumentException: Field variations is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).
The website encountered an unexpected error. Please try again later.
InvalidArgumentException: Field variations is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->get('variations') (Line: 17)
Drupal\commerce\Entity\CommerceContentEntityBase->getTranslatedReferencedEntities('variations') (Line: 194)
Drupal\commerce_product\Entity\Product->getVariations() (Line: 97)
Drupal\commerce_product\ProductVariationListBuilder->load() (Line: 171)
Drupal\commerce_product\ProductVariationListBuilder->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 519)
Drupal\Core\Form\FormBuilder->retrieveForm('commerce_product_variations', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm('commerce_product_variations', Object) (Line: 217)
Drupal\Core\Form\FormBuilder->getForm(Object) (Line: 156)
Drupal\commerce_product\ProductVariationListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('commerce_product_variation')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Core version is 8.7.5
Is this a known issue?
Comments
Comment #2
mrupsidownJust upgraded core to 8.7.6 and the problem persists.
Comment #3
bojanz commentedThe variations field is always created by default when you install Commerce. Since it is missing, it means that your installation is broken, and other important configuration might also be missing.
You can search around the issue queue to see if anyone else had this problem and found a workaround, but I'd recommend reinstalling the site and Commerce.
This is not the first time I have seen such a complaint, but we have been completely unable to reproduce this, it seems to be either a random bug in Drupal core, or a result of some operation you take along the way (a config deploy, etc)
Comment #4
mrupsidown@bojanz indeed, I have uninstalled all commerce related modules, reinstalled everything and it worked flawlessly. Sorry for registering it as an issue.
Comment #5
ben.hamelinI just ran into this after having uninstalled shipping and physical modules. I was able to get around it by deleting the product type and recreating it - luckily we are early in dev so this wasn't much effort