ComponentEditForm: TypeError when editing the XB provided image component + adding components lists many Vertical Tabs

Created on 10 July 2024, 3 months ago
Updated 24 July 2024, 3 months ago

Overview

I installed a fresh Drupal with Drupal Core 11.x and XB 0.x. When I try to edit the built-in image component, I get following TypeError:

TypeError: Unsupported operand types: null + array in Drupal\file\Plugin\Field\FieldWidget\FileWidget->formElement() (line 257 of core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php).
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formElement() (Line: 459)
Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 130)
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements() (Line: 115)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements() (Line: 120)
Drupal\Core\Field\WidgetBase->form() (Line: 213)
Drupal\experience_builder\PropSource\StaticPropSource->formTemporaryRemoveThisExclamationExclamationExclamation() (Line: 194)
Drupal\experience_builder\Form\ComponentEditForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 528)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 279)
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: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
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: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)
🐛 Bug report
Status

Fixed

Component

Page builder

Created by

🇫🇮Finland lauriii Finland

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

Merge Requests

Comments & Activities

  • Issue created by @lauriii
  • 🇫🇮Finland lauriii Finland
  • Assigned to wim leers
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    🤔 This is exactly what EndToEndDemoIntegrationTest is intended to prevent.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    I cannot reproduce this using the exact same steps to reproduce, but using Drupal 10.3 instead.

    You wrote:

    When I try to edit the built-in image component, I get following TypeError:

    Where are you trying to do that? At /xb (the PoC UI) or at /node/1/edit?

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Ahhh, it's at /admin/structure/component/edit/experience_builder%2Bimage?destination=/admin/structure/component — deduced that thanks to the stack trace:

    …
    Drupal\experience_builder\Form\ComponentEditForm->form() (Line: 107)
    …
    

    Reproduced.

    This is a bug in Allow specifying default props values when opting an SDC in for XB Fixed , which landed yesterday. I intentionally did not add test coverage and only tested manually, because we know it's all subject to heavy change. I must have accidentally broken it shortly prior to merging, because it definitely did work.

  • 🇫🇮Finland lauriii Finland

    Reporting another potentially related issue here. Feel free to move to its own issue if it turns out it isn't related.

    I have a clean installation of XB with Standard. When I go to /admin/structure/component/add, there's a lot of options presented even before selecting a component. It also looks like that these form options are displayed several times on the same page.

  • Merge request !86Resolve #3460440 "Component edit form fixes" → (Merged) created by wim leers
  • Status changed to Needs work 3 months ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    #6 was easy: I didn’t think to test adding new components. Fix available on that issue for this new bug you reported.

    Still working to fix the first bug you reported.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    The original reported bug is related to 📌 [PP-1] Default props values should support files/images Postponed .

  • Issue was unassigned.
  • Status changed to RTBC 3 months ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Found the solution to @lauriii's original bug report. 👍

  • Pipeline finished with Skipped
    3 months ago
    #221137
    • Wim Leers committed db5e5752 on 0.x
      Issue #3460440 by Wim Leers, lauriii: ComponentEditForm: TypeError when...
  • Status changed to Fixed 3 months ago
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Had to bypass CODEOWNERS because we're understaffed: @tedbow is out and @f.mazeikis is assigned to a different project this week. Went ahead and merged this — no shocking changes in here. Progress matters more than thorough reviews at this stage.

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

Production build 0.71.5 2024