Warning: Undefined array key "visual_default_view_mode" when upgrading from D9 to D10

Created on 4 June 2024, 24 days ago

Steps

  • Drupal 9 to Drupal 10
  • Module from 1.1 to 1.4
  • Head to /admin/config/content/diff/general
Error message
Warning: Undefined array key "visual_default_view_mode" in Drupal\diff\Form\GeneralSettingsForm->buildForm() (line 195 of modules/contrib/diff/src/Form/GeneralSettingsForm.php).
Drupal\diff\Form\GeneralSettingsForm->buildForm(Array, Object, NULL)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('diff_general_settings', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed solution

Add hook_update() with visual_default_view_mode value

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇦🇺Australia VladimirAus Brisbane, Australia

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

Comments & Activities

  • Issue created by @VladimirAus
  • Status changed to Closed: cannot reproduce 24 days ago
  • 🇮🇳India Vishal Prasad

    hello @VladimirAus I Tried to reproduce the error following the process you have mentioned, but i didn't get this error also the form is working fine to me, either we need more info about how to reproduce this error or there may be some issue with any other module in your peoject, causing this issue,

    Closing it for now.

Production build 0.69.0 2024