Fix Return value must be of type bool fatal error

Created on 4 February 2024, 10 months ago

Problem/Motivation

Facing the following Fatal error

The website encountered an unexpected error. Try again later.

TypeError: Drupal\rabbit_hole\Entity\BehaviorSettings::getNoBypass(): Return value must be of type bool, null returned in Drupal\rabbit_hole\Entity\BehaviorSettings->getNoBypass() (line 134 of modules/contrib/rabbit_hole/src/Entity/BehaviorSettings.php).

Steps to reproduce

Given having a fresh install with no custom configs yet
When I got to "/admin/config/content/rabbit-hole"
Then fatal error will show up

The website encountered an unexpected error. Try again later.

TypeError: Drupal\rabbit_hole\Entity\BehaviorSettings::getNoBypass(): Return value must be of type bool, null returned in Drupal\rabbit_hole\Entity\BehaviorSettings->getNoBypass() (line 134 of modules/contrib/rabbit_hole/src/Entity/BehaviorSettings.php).
Drupal\rabbit_hole\FormManglerService->bundleSettingsForm() (Line: 120)
Drupal\rabbit_hole\Form\RabbitHoleEntityTypeSettingsForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 54)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Also when exporting configs for entity types

no_bypass: null
bypass_message: null

Proposed resolution

  • Fix a boolean pass for the getNoBypass, getBypassMessage methods.

Remaining tasks

  • N/A

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A
📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024