Reported by Razem

Problem/Motivation

Having Notices or Warnings by VLB ~10 and its used modules

PHP 7.3.29 was released 01 Jul 2021
https://www.php.net/ChangeLog-7.php#7.3.29

PHP 7.4.21 was released 01 Jul 2021
https://www.php.net/ChangeLog-7.php#7.4.21

PHP 8.0.8 was released 01 Jul 2021
https://www.php.net/ChangeLog-8.php#8.0.8

Steps to reproduce

In the Recent log messages page you can spot number of notices like

Notice: Undefined index: background_edgetoedge in Drupal\varbase_layout_builder\Plugin\BootstrapStyles\Style\BackgroundEdgeToEdge->submitStyleFormElements() (line 49 of /var/www/html/demos/varbase9c900/docroot/modules/contrib/varbase_layout_builder/src/Plugin/BootstrapStyles/Style/BackgroundEdgeToEdge.php)
#0 /var/www/html/demos/varbase9c900/docroot/core/includes/bootstrap.inc(312): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/html/d...', 49)
#1 /var/www/html/demos/varbase9c900/docroot/modules/contrib/varbase_layout_builder/src/Plugin/BootstrapStyles/Style/BackgroundEdgeToEdge.php(49): _drupal_error_handler(8, 'Undefined index...', '/var/www/html/d...', 49, Array)
#2 /var/www/html/demos/varbase9c900/docroot/modules/contrib/bootstrap_styles/src/StylesGroup/StylesGroupManager.php(233): Drupal\varbase_layout_builder\Plugin\BootstrapStyles\Style\BackgroundEdgeToEdge->submitStyleFormElements(Array)
#3 /var/www/html/demos/varbase9c900/docroot/modules/contrib/layout_builder_blocks/layout_builder_blocks.module(148): Drupal\bootstrap_styles\StylesGroup\StylesGroupManager->submitStylesFormElements(Array, Object(Drupal\Core\Form\FormState), Array, Array, 'layout_builder_...')
#4 [internal function]: _layout_builder_blocks_submit_block_form(Array, Object(Drupal\Core\Form\FormState))
#5 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/Form/FormSubmitter.php(113): call_user_func_array('_layout_builder...', Array)
#6 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#7 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(593): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('layout_builder_...', Array, Object(Drupal\Core\Form\FormState))
#9 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\layout_builder\Form\UpdateBlockForm), Object(Drupal\Core\Form\FormState))
#10 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#11 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#12 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/Render/Renderer.php(578): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#14 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#15 /var/www/html/demos/varbase9c900/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/html/demos/varbase9c900/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#17 /var/www/html/demos/varbase9c900/docroot/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(67): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/html/demos/varbase9c900/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/www/html/demos/varbase9c900/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/html/demos/varbase9c900/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/demos/varbase9c900/docroot/core/lib/Drupal/Core/DrupalKernel.php(716): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/demos/varbase9c900/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#27 {main}

Proposed resolution

Have NULL value for #default_value for all Block restricted Bootstrap Styles plugins

Remaining tasks

  • Fix
  • Test adding sections with background edge to edge
  • Test adding inline blocks ( No use of background edge to edge in blocks )
  • Review
  • Automated testing
  • Release

User interface changes

  • None

API changes

  • None

Data model changes

  • Config should ignore saving the background edge to edge
  • Have a null value for inline blocks if this is forced by the Bootstrap Styles module

Comments

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

  • RajabNatshah committed 72bf2a8 on 10.0.x
    Issue #3222375: Fix Notice: Undefined index: background_edgetoedge
    
rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem
Status: Active » Needs review
Issue tags: +php7.3, +php7.4, +PHP8.0, +PHP8.1, +varbase-9.0.1

yarn phpcpf

rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ yarn phpcpf
yarn run v1.22.10
error Command "phpcpf" not found. Did you mean "phpcbf"?
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ yarn phpcbf
yarn run v1.22.10
$ phpcbf --standard=./.phpcs.xml .

No fixable errors were found

Time: 2.69 secs; Memory: 20MB

Done in 2.87s.

yarn phpcs

rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ yarn phpcs
yarn run v1.22.10
$ phpcs --standard=./.phpcs.xml .
Done in 2.85s.

PHP7.3

rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ phpcs -p --standard=PHPCompatibility  /var/www/html/products/varbase_layout_builder --runtime-set testVersion 7.3 --ignore=/var/www/html/products/varbase_layout_builder/node_modules
............................................................ 60 / 87 (69%)
...........................                                  87 / 87 (100%)


Time: 4.24 secs; Memory: 20MB

PHP7.4

rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ phpcs -p --standard=PHPCompatibility  /var/www/html/products/varbase_layout_builder --runtime-set testVersion 7.4 --ignore=/var/www/html/products/varbase_layout_builder/node_modules
............................................................ 60 / 87 (69%)
...........................                                  87 / 87 (100%)


Time: 3.13 secs; Memory: 20MB

PHP8.0

rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ phpcs -p --standard=PHPCompatibility  /var/www/html/products/varbase_layout_builder --runtime-set testVersion 8.0 --ignore=/var/www/html/products/varbase_layout_builder/node_modules
............................................................ 60 / 87 (69%)
...........................                                  87 / 87 (100%)


Time: 3.13 secs; Memory: 20MB

PHP8.1

rajab@vardot-dev:/var/www/html/products/varbase_layout_builder$ phpcs -p --standard=PHPCompatibility  /var/www/html/products/varbase_layout_builder --runtime-set testVersion 8.1 --ignore=/var/www/html/products/varbase_layout_builder/node_modules
............................................................ 60 / 87 (69%)
...........................                                  87 / 87 (100%)


Time: 3.13 secs; Memory: 20MB
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

liam morland’s picture

Issue tags: -, -PHP8.1 +PHP 8.1
liam morland’s picture

Issue tags: -, -PHP 7.4 (duplicate) +PHP 7.4