Fix PHP 8.0/8.1 RFC: Deprecate passing null to non-nullable arguments of internal functions when creating new Sections

Created on 21 November 2022, over 1 year ago
Updated 18 September 2023, 9 months ago

In PHP 8 there is an issue when creating new Sections.

Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated in modules/contrib/bootstrap_styles/src/Style/StylePluginBase.php on line 90
πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil pfeiffer

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

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

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States elliotl

    I am seeing the same error using v 1.1 of bootstrap_styles whenever configuring sections in layout builder.
    Patch aos.local_not_loading_3315218_2.patch
    Drupal 9.5.2
    Php 8.1.14
    MacOS; Safari 16.2 and Chrome 109.0.5414.87.

    Type php
    Date Sunday, January 22, 2023 - 12:36
    User admin
    Location /layout_builder/configure/section/defaults/node.mt_service.report_chapter/0?_wrapper_format=drupal_dialog.off_canvas
    Referrer /admin/structure/types/manage/mt_service/display/report_chapter/layout
    Message Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\bootstrap_styles\Style\StylePluginBase->getStyleOptions() (line 90 of /var/www/drupal/site/modules/contrib/bootstrap_styles/src/Style/StylePluginBase.php)
    #0 /var/www/drupal/site/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 [internal function]: _drupal_error_handler()
    #2 /var/www/drupal/site/modules/contrib/bootstrap_styles/src/Style/StylePluginBase.php(90): explode()
    #3 /var/www/drupal/site/modules/contrib/bootstrap_styles/src/Plugin/BootstrapStyles/Style/BoxShadow.php(56): Drupal\bootstrap_styles\Style\StylePluginBase->getStyleOptions()
    #4 /var/www/drupal/site/modules/contrib/bootstrap_styles/src/StylesGroup/StylesGroupManager.php(184): Drupal\bootstrap_styles\Plugin\BootstrapStyles\Style\BoxShadow->buildStyleFormElements()
    #5 /var/www/drupal/site/modules/contrib/bootstrap_layout_builder/src/Plugin/Layout/BootstrapLayout.php(430): Drupal\bootstrap_styles\StylesGroup\StylesGroupManager->buildStylesFormElements()
    #6 /var/www/drupal/site/core/modules/layout_builder/src/Form/ConfigureSectionForm.php(147): Drupal\bootstrap_layout_builder\Plugin\Layout\BootstrapLayout->buildConfigurationForm()
    #7 [internal function]: Drupal\layout_builder\Form\ConfigureSectionForm->buildForm()
    #8 /var/www/drupal/site/core/lib/Drupal/Core/Form/FormBuilder.php(534): call_user_func_array()
    #9 /var/www/drupal/site/core/lib/Drupal/Core/Form/FormBuilder.php(281): Drupal\Core\Form\FormBuilder->retrieveForm()
    #10 /var/www/drupal/site/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
    #11 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
    #12 /var/www/drupal/site/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
    #13 /var/www/drupal/site/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #14 /var/www/drupal/site/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
    #15 /var/www/drupal/site/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    #16 /var/www/drupal/site/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #17 /var/www/drupal/site/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #18 /var/www/drupal/site/modules/contrib/force_password_change/src/Service/ForcePasswordChangeRedirectMiddleware.php(42): Symfony\Component\HttpKernel\HttpKernel->handle()
    #19 /var/www/drupal/site/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\force_password_change\Service\ForcePasswordChangeRedirectMiddleware->handle()
    #20 /var/www/drupal/site/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #21 /var/www/drupal/site/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #22 /var/www/drupal/site/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #23 /var/www/drupal/site/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #24 /var/www/drupal/site/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
    #25 /var/www/drupal/site/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #26 /var/www/drupal/site/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #27 /var/www/drupal/site/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle()
    #28 /var/www/drupal/site/index.php(19): Drupal\Core\DrupalKernel->handle()
    #29 {main}
    .
    Severity Debug
    Hostname 71.45.116.109
    Operations

  • Issue was unassigned.
  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Facing the same issue

    Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\bootstrap_styles\Style\StylePluginBase->getStyleOptions() (line 90 of /var/www/html/dev/drupal10bootstrap_styles/docroot/modules/contrib/bootstrap_styles/src/Style/StylePluginBase.php)
    

    PHP RFC: Deprecate passing null to non-nullable arguments of internal functions

  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Resolution 2: Explicitly specify a default value for null values.

  • @rajab-natshah opened merge request.
  • Status changed to RTBC 9 months ago
  • πŸ‡ΊπŸ‡¦Ukraine podarok Ukraine
  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan
  • Status changed to Fixed 9 months ago
  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024