Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/admin/content causes fatal error with Retrofit #176

Open
mglaman opened this issue May 23, 2024 · 9 comments
Open

/admin/content causes fatal error with Retrofit #176

mglaman opened this issue May 23, 2024 · 9 comments

Comments

@mglaman
Copy link
Collaborator

mglaman commented May 23, 2024

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

@mariosm1
Copy link

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;

@mglaman
Copy link
Collaborator Author

mglaman commented Jul 23, 2024

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

@mglaman
Copy link
Collaborator Author

mglaman commented Jul 23, 2024

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

@mariosm1
Copy link

mariosm1 commented Jul 23, 2024

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

@mglaman
Copy link
Collaborator Author

mglaman commented Aug 8, 2024

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

@mglaman
Copy link
Collaborator Author

mglaman commented Aug 8, 2024

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

@mariosm1
Copy link

mariosm1 commented Aug 8, 2024

@mglaman No problem!

@emasters
Copy link

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

@amjo
Copy link

amjo commented Jan 21, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants