I'm trying to add "Any data" contexts to a Page Variant with: entity:node:field_name data and facing this error:
Warning: Missing argument 1 for Drupal\page_manager_ui\Form\PageVariantContextsForm::getContextClass(), called in /home/vagrant/builtinx/docroot/modules/contrib/page_manager/page_manager_ui/src/Form/PageVariantContextsForm.php on line 35 and defined in Drupal\page_manager_ui\Form\PageVariantContextsForm->getContextClass() (line 54 of /home/vagrant/builtinx/docroot/modules/contrib/page_manager/page_manager_ui/src/Form/PageVariantContextsForm.php) #0 /home/vagrant/builtinx/docroot/core/includes/bootstrap.inc(546): _drupal_error_handler_real(2, 'Missing argumen...', '/home/vagrant/b...', 54, Array) #1 /home/vagrant/builtinx/docroot/modules/contrib/page_manager/page_manager_ui/src/Form/PageVariantContextsForm.php(54): _drupal_error_handler(2, 'Missing argumen...', '/home/vagrant/b...', 54, Array) #2 /home/vagrant/builtinx/docroot/modules/contrib/page_manager/page_manager_ui/src/Form/PageVariantContextsForm.php(35): Drupal\page_manager_ui\Form\PageVariantContextsForm->getContextClass() #3 [internal function]: Drupal\page_manager_ui\Form\PageVariantContextsForm->addContext(Array, Object(Drupal\Core\Form\FormState), Object(Symfony\Component\HttpFoundation\Request)) #4 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array(Array, Array) #5 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(98): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array) #6 /home/vagrant/builtinx/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #7 /home/vagrant/builtinx/vendor/symfony/http-kernel/HttpKernel.php(221): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.exceptio...', Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent)) #8 /home/vagrant/builtinx/vendor/symfony/http-kernel/HttpKernel.php(75): Symfony\Component\HttpKernel\HttpKernel->handleException(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1) #9 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /home/vagrant/builtinx/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /home/vagrant/builtinx/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/vagrant/builtinx/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/vagrant/builtinx/docroot/core/lib/Drupal/Core/DrupalKernel.php(649): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /home/vagrant/builtinx/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #18 {main}.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2799885-11.patch | 2.43 KB | andypost |
#11 | 2799885-interdiff-10.txt | 1.21 KB | andypost |
Comments
Comment #2
AntonnaviGot the same issue.
But in my case error text was a bit different:
Attached patch fix this issue.
Comment #3
karolus CreditAttribution: karolus as a volunteer commentedJust tried apply patch in #2, this is what I got:
Notice: Undefined variable: value in Drupal\ctools\Form\ContextConfigure->submitForm() (line 177 of /Users/karolus/Sites/kkonlined8/modules/ctools/src/Form/ContextConfigure.php) #0 /Users/karolus/Sites/kkonlined8/core/includes/bootstrap.inc(552): _drupal_error_handler_real(8, 'Undefined varia...', '/Users/karolus/...', 177, Array) #1 /Users/karolus/Sites/kkonlined8/modules/ctools/src/Form/ContextConfigure.php(177): _drupal_error_handler(8, 'Undefined varia...', '/Users/karolus/...', 177, Array) #2 [internal function]: Drupal\ctools\Form\ContextConfigure->submitForm(Array, Object(Drupal\Core\Form\FormState)) #3 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array) #4 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #5 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/Form/FormBuilder.php(585): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #6 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('ctools_context_...', Array, Object(Drupal\Core\Form\FormState)) #7 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\page_manager_ui\Form\StaticContextConfigure), Object(Drupal\Core\Form\FormState)) #8 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #9 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #10 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #11 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #12 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #13 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #14 /Users/karolus/Sites/kkonlined8/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Object(Closure), Array) #15 /Users/karolus/Sites/kkonlined8/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #16 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /Users/karolus/Sites/kkonlined8/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /Users/karolus/Sites/kkonlined8/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /Users/karolus/Sites/kkonlined8/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /Users/karolus/Sites/kkonlined8/core/lib/Drupal/Core/DrupalKernel.php(656): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /Users/karolus/Sites/kkonlined8/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #25 {main}.
Comment #4
dcam CreditAttribution: dcam commented#2 is RTBC from me. I ran into this problem and fixed it the same way, which isn't saying much because it's an easy issue to solve.
The problem mentioned in #3 is an unrelated issue with CTools that happens to be exposed when using config entities as a context once this problem is solved. See #2696819: Cannot add contexts whose entity ids are not numeric.
Comment #5
dcam CreditAttribution: dcam commentedAdding related issues.
Comment #6
alexmoreno CreditAttribution: alexmoreno commentedsame, #2 fixed the issue for me. This is a critical issue that should be merged asap, IMHO.
Comment #7
alphawebgroupHi guys!
any chance to get this one committed? please...
Comment #8
tim.plunkettThis should include test coverage.
Comment #9
jonathanshawNW for tests. Should be easy to make a new tests based off StaticContextTest.
Comment #10
NickDJM CreditAttribution: NickDJM commentedUpdated patch to apply properly to 8.x-4.x
Comment #11
andypostBoth places should be fixed
I used to replicate
StaticContextTest
in UI and there's no ability to add any context but this test passed somehowComment #12
andypostComment #13
manuel.adan#11 works for me
Comment #14
daggerhart CreditAttribution: daggerhart as a volunteer commentedSimple fix to a big problem. RTBC +1
Comment #15
Denes.Szabo CreditAttribution: Denes.Szabo as a volunteer commented#11 tested and it works.
Comment #16
markdc#11 works for me (D8.6.2)
Comment #17
pebosi CreditAttribution: pebosi commented#11 works for me (D8.6.4)
Comment #18
iyyappan.govind#11 works for me (D8.6.9)
Comment #20
manuel.adanComment #22
Leonardo Le#11 works for me (D8.7.8)