Drupal 10.3 breaks DomainListBuilder

Created on 21 June 2024, 5 months ago
Updated 28 June 2024, 5 months ago

On the recently released Drupal 10.3 version, the core class Drupal\Core\Config\Entity\DraggableListBuilder.php does not include the FormBuilderInterface object anymore. As a consequence of that, in Drupal\domain\DomainListBuilder.php:318, the method $this->formBuilder() is not available any more, creating a fatal php error when visiting "admin/config/domain" path.

I am not sure about what the best way of dealing with this issue would be. I guess a new version should be released and the Drupal version constraints should be set to >= 10.3, but i am not sure if it is possible to restrict compatible Drupal versions to < 10.3 to the current 2.0.0-beta1 existing release.

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇪🇸Spain guiu.rocafort.ferrer Barcelona

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

Merge Requests

Comments & Activities

  • Issue created by @guiu.rocafort.ferrer
  • 🇪🇸Spain guiu.rocafort.ferrer Barcelona

    Changing issue priority to major, since i consider this to be an important enought issue.

  • 🇧🇪Belgium gorkagr

    Indeed that path is broken in 10.3.0

    I have just noticed line 318 (the one that causes the error) is

        $form = $this->formBuilder()->getForm($this);
    

    comparing the DraggableListBuilder class, in 10.2 there is available:

    
      /**
       * Returns the form builder.
       *
       * @return \Drupal\Core\Form\FormBuilderInterface
       *   The form builder.
       */
      protected function formBuilder() {
        if (!$this->formBuilder) {
          $this->formBuilder = \Drupal::formBuilder();
        }
        return $this->formBuilder;
      }
    

    while in 10.3 that function it is not available anymore but it seems using $this->formBuilder is ok
    So maybe having a code such as to maintain BC ??

        if (\version_compare(\Drupal::VERSION, '10.2.9999', '<')) {
          $form = $this->formBuilder()->getForm($this);
        }
        else {
          $form = $this->formBuilder->getForm($this);
        }
    

    but i cannot check this right now in any 10.2.x or lower drupal site

  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 143s
    #204977
  • 🇩🇪Germany spuky

    i created an mr without the version constraint so people can use it as a fix in composer

    testing in my local evironment with a D 10.2 version does also work with the patch so no version check needed...

  • Status changed to Needs review 5 months ago
  • 🇮🇳India amitvin

    Seems It has been already flagged under https://www.drupal.org/project/domain/issues/3450485 🐛 WSOD Undefined method Drupal\domain\DomainListBuilder::formBuilder Needs review

  • Status changed to Closed: duplicate 5 months ago
  • 🇺🇸United States agentrickard Georgia (US)

    Merged in other linked issue.

Production build 0.71.5 2024