Fatal error when attempting to add a license

Created on 7 January 2018, almost 7 years ago
Updated 20 February 2023, almost 2 years ago

From the README:

- The admin forms to create/edit licenses are not yet complete. They should only
be used by developers who know what they are doing. Changing values here can
break things!

Original issue summary:

I have followed the instructions in the README, specifically:

2 Configure or create a checkout flow which does not allow anonymous checkout.
3 Configure or create an Order Type to use the checkout flow.
4 Configure or create an Order Item Type to use the Order Type, and work with
Licenses.
5 Configure or create a Product Variation Type to use the Order Item Type, and
provide Licenses.

When I go to create a license it redirects to this url:
http://sohtech.devel/admin/commerce/licenses/add/role
And fatal error occurs:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\commerce_license\Form\LicenseCreateForm::setModuleHandler() in Drupal\Core\Entity\EntityTypeManager->getFormObject() (line 191 of core\lib\Drupal\Core\Entity\EntityTypeManager.php).
Drupal\Core\Entity\EntityTypeManager->getFormObject('commerce_license', 'add') (Line: 105)
Drupal\Core\Entity\EntityManager->getFormObject('commerce_license', 'add') (Line: 69)
Drupal\Core\Entity\HtmlEntityFormController->getFormObject(Object, 'commerce_license.add.default') (Line: 59)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
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}()
call_user_func_array(Object, Array) (Line: 153)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I know that the README also says that "The admin forms to create/edit licenses are not yet complete" but based on the issue queue, plenty of people seem to be using this module without encountering this error.

Using core 8.4.4
Commerce 8.x-2.2

There appears to be no router item for the url admin/commerce/licenses/add/role

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand kent@passingphase.nz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States TomTech

    Not ready to say that admin UX is complete, but it is not throwing this exception anymore, and a good majority of the add/edit functionality is currently working.

    That said, you can specify a product variation that does not have a license type associated with it.

    This patch adds an enhanced product variation entity reference selection plugin that restricts the variations to just those with a license type defined.

    • TomTech β†’ authored 9cb75e2b on 8.x-2.x
      Issue #2934928 by TomTech: Fatal error when attempting to add a license
      
  • Status changed to Fixed almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States TomTech
Production build 0.71.5 2024