Problem/Motivation
When releasing an item in the queue using the release button we get the following error
TypeError: Drupal\queue_ui\Form\ConfirmItemReleaseForm::__construct(): Argument #1 ($messenger) must be of type Drupal\Core\Messenger\Messenger, Drupal\admin_toolbar_messages\AdminAwareMessenger given, called in /var/www/html/app/modules/contrib/queue_ui/src/Form/ConfirmItemReleaseForm.php on line 65 in Drupal\queue_ui\Form\ConfirmItemReleaseForm->__construct() (line 49 of modules/contrib/queue_ui/src/Form/ConfirmItemReleaseForm.php).
Drupal\queue_ui\Form\ConfirmItemReleaseForm::create(Object) (Line: 28)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\queue_ui\Form\ConfirmItemReleaseForm') (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\queue_ui\Form\ConfirmItemReleaseForm') (Line: 58)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
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: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
include('/var/www/html/app/index.php') (Line: 3)
Steps to reproduce
- Install the module
admin_toolbar_messages
- Install the Queue_ui module
- Create an item in the queue
- Try to release the item through the interface
Proposed resolution
"program to an interface not an implementation"
See patch
Remaining tasks
Test and merge
User interface changes
API changes
Data model changes
Comments
Comment #2
adebruin commentedComment #3
adebruin commentedComment #6
timohuismanSomehow my colleague @adebruin couldn't create a MR, so I made one with the patch from #2
Comment #7
ptmkenny commentedI reviewed MR46 and I agree with this change. We should always use the core interface rather than a specific implementation if an interface is provided.
Comment #8
ptmkenny commented3.2.x-dev is the current development target.
Comment #9
volegerNeeds rebase for 3.2.x
Comment #11
volegerFixed, thanks