retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

/admin/content causes fatal error with Retrofit

Open mglaman opened this issue 1 year ago • 9 comments

This was reported via Slack.

Error: Call to a member function setArguments) on null in DrupaNviews Form\ViewsExposedForm-> buildForm() (line 82 of core/modules/views/src/Form/ViewsExposedForm.php).

Screenshot 2024-05-23 at 2 52 34 PM

mglaman avatar May 23 '24 13:05 mglaman

I was getting a similar error in the Appearance tab. Fixed this by adding another case to ArrayAccessFormState.

public function offsetSet(mixed $offset, mixed $value): void
    {
        switch ($offset) {
        ...
            case 'build_info':
                $this->setBuildInfo($value);
                break;

mariosm1 avatar Jul 22 '24 15:07 mariosm1

Thanks for reporting this @mariosm1 !! we can get that added

mglaman avatar Jul 23 '24 13:07 mglaman

I'm surprised the existing methods didn't work, since the property name is the same internally still https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Core/Form/FormState.php?ref_type=heads#L987

mglaman avatar Jul 23 '24 13:07 mglaman

It looks like FormState::set() adds the build_info to the $form_state->storage array, but FormBuilder::retrieveForm() grabs the build_info directly from $form_state->build_info and it was coming up as an empty array

mariosm1 avatar Jul 23 '24 13:07 mariosm1

Thanks @mariosm1, now that I'm back at a computer I will add that.

mglaman avatar Aug 08 '24 12:08 mglaman

Merged and cut a release, thanks for digging in @mariosm1

mglaman avatar Aug 08 '24 16:08 mglaman

@mglaman No problem!

mariosm1 avatar Aug 08 '24 17:08 mariosm1

Running Drupal 10.3.10 with retrofit 0.1.14 and seeing pretty much the same error at /admin/content

The website encountered an unexpected error. Try again later.
Error: Call to a member function getExposedInput() on null in Drupal\views\Form\ViewsExposedForm->buildForm() (line 78 of core/modules/views/src/Form/ViewsExposedForm.php).
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 65)
Retrofit\Drupal\Form\FormBuilder->buildForm() (Line: 134)
Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm() (Line: 1298)
Drupal\views\ViewExecutable->build() (Line: 393)
Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 198)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1690)
Drupal\views\ViewExecutable->executeDisplay() (Line: 81)
Drupal\views\Element\View::preRenderViewElement()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
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: 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: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Previously I had retrofit 0.1.10 working well with Drupal 10.2.5. I tried downgrading from 0.1.14 to 0.1.10 on Drupal 10.3.10 and that at least cleared the above error

emasters avatar Nov 26 '24 22:11 emasters

Came here from your video, and after implementation i get the same error on /admin/content/ and /admin/reports/dblog. I guess 0.1.14's build_info switch case is insuffictient. I will try and see if i can fix this and create a PR.

case 'build_info':
                $this->setBuildInfo($value);
                break;

As @emasters suggested, downgrading to 0.1.10 got it up and running again

amjo avatar Jan 21 '25 14:01 amjo