Hi,

I've located an issue and found a way to fix it.

Context
I use Barrio + Sass-based child theme. The user can add content but not allowed to see the admin template.

Error
A user tries to add content (/node/add/##content-type##) and get this error:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 2 passed to bootstrap_barrio_form_node_form_alter() must be an instance of FormStateInterface, instance of Drupal\Core\Form\FormState given, called in **/web/core/lib/Drupal/Core/Theme/ThemeManager.php on line 453 in bootstrap_barrio_form_node_form_alter() (line 365 of themes/contrib/bootstrap_barrio/bootstrap_barrio.theme).

bootstrap_barrio_form_node_form_alter(Array, Object, 'node_advertorial_form') (Line: 453)
Drupal\Core\Theme\ThemeManager->alterForTheme(Object, 'form', Array, Object, 'node_advertorial_form') (Line: 462)
Drupal\Core\Theme\ThemeManager->alter(Array, Array, Object, 'node_advertorial_form') (Line: 835)
Drupal\Core\Form\FormBuilder->prepareForm('node_advertorial_form', Array, Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm('node_advertorial_form', Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 113)
Drupal\node\Controller\NodeController->add(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 666)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Fix
Just add to bootstrap._barrio.theme:
use Drupal\Core\Form\FormStateInterface;

Please review and commit this.

Keep up with the good work.

Comments

onemorepixel created an issue. See original summary.

  • hatuhay committed a894a36 on 8.x-4.x
    Issue #2978668: FormStateInterface missing
    
hatuhay’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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