Using Role paywall with Webform generates error

Created on 5 February 2023, almost 2 years ago
Updated 19 March 2024, 9 months ago

Location https://domainname.com/admin/config/content/role_paywall/webform_submission

Referrer https://domainname.com/admin/config/content/role_paywall

Message Error: Call to a member function get() on null in Drupal\role_paywall\Form\RolePaywallSettingsForm->buildForm() (line 256 of /home/domainuser/public_html/modules/contrib/role_paywall/src/Form/RolePaywallSettingsForm.php)

#0 [internal function]: Drupal\role_paywall\Form\RolePaywallSettingsForm->buildForm(Array, Object(Drupal\Core\Form\FormState), 'webform_submiss...')
#1 /home/domainuser/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(534): call_user_func_array(Array, Array)
#2 /home/domainuser/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(281): Drupal\Core\Form\FormBuilder->retrieveForm('role_paywall_se...', Object(Drupal\Core\Form\FormState))
#3 /home/domainuser/public_html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\role_paywall\Form\RolePaywallSettingsForm), Object(Drupal\Core\Form\FormState))
#4 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#5 /home/domainuser/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#6 /home/domainuser/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#7 /home/domainuser/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#8 /home/domainuser/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#9 /home/domainuser/public_html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /home/domainuser/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#11 /home/domainuser/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /home/domainuser/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /home/domainuser/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /home/domainuser/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /home/domainuser/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /home/domainuser/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /home/domainuser/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /home/domainuser/public_html/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /home/domainuser/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#20 {main}

🐛 Bug report
Status

Closed: works as designed

Version

2.1

Component

Code

Created by

🇰🇪Kenya dwainash

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

Comments & Activities

  • Issue created by @dwainash
  • 🇦🇺Australia interlated

    Confirmed

    2938 30/Dec 14:22 php Error Error: Call to a member function get() on null in Drupal\role_paywall\Form\RolePaywallSettingsForm->buildForm() (line 256 of
    /web/modules/contrib/role_paywall/src/Form/RolePaywallSettingsForm.php).

  • Status changed to Closed: works as designed 9 months ago
  • 🇦🇺Australia akoepke

    This is a use-case I had not considered or tested for. Webforms are a very different entity to standard content.

    This module is designed to work on Content entities and expects them to have Entity View Displays. Supporting something like Webform would require a lot of changes specific for webform and may be better off implemented as a specific module.

Production build 0.71.5 2024