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