Two mistakes, maybe the same problem

Created on 21 August 2024, 5 months ago

Drupal 10.3.2, PHP 8.3.8 (same on PHP 8.2.x):

1)
Some fields lose their value when saving the form:
For example I would like to make a translation of "seconds" into Danish. I entered "seconds" and hit Filter. The word "seconds" disappeared and the filter showed all translation strings.

2)
I wanted to create a new view.
I selected "add view" and entered the title. When I changed the content field or the type field, I got an error message:
"Oops, something went wrong. Check your browser's developer console for more details."

My browser says:
Failed to load resource: the server responded with a status of 500 ()

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Sti: /admin/structure/views/add?ajax_form=1
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.Drupal\Component\Plugin\Exception\PluginException: Drupal\Component\Plugin\Factory\DefaultFactory can only handle plugin definitions that are arrays or that implement Drupal\Component\Plugin\Definition\PluginDefinitionInterface, but NULL given. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 93 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php). Drupal\Core\Plugin\Factory\ContainerFactory->createInstance(NULL, Array) (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance(NULL) (Line: 177)
Drupal\views_ui\ViewAddForm->validateForm(Array, Object)
call_user_func_array(Array, Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 274)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'view_add_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('view_add_form', Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('view_add_form', Array, Object) (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 68)
Drupal\access_filter\AccessFilterMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
"

If I press the save-button in the view/add, I get this error:

The website encountered an unexpected error. Try again later.

Drupal\Component\Plugin\Exception\PluginException: Drupal\Component\Plugin\Factory\DefaultFactory can only handle plugin definitions that are arrays or that implement Drupal\Component\Plugin\Definition\PluginDefinitionInterface, but NULL given. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 93 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance(NULL, Array) (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance(NULL) (Line: 177)
Drupal\views_ui\ViewAddForm->validateForm(Array, Object)
call_user_func_array(Array, Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 274)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'view_add_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('view_add_form', Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('view_add_form', Array, Object) (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 68)
Drupal\access_filter\AccessFilterMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
πŸ› Bug report
Status

Closed: works as designed

Version

10.3 ✨

Component
AjaxΒ  β†’

Last updated 1 day ago

Created by

πŸ‡©πŸ‡°Denmark uv516 Denmark

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

Comments & Activities

  • Issue created by @uv516
  • Status changed to Postponed: needs info 5 months ago
  • It's more of a plugin problem on that site than it is Ajax or even, perhaps, a bug.

    Did you change anything about the codebase or the configuration before this happened?

    If you are set up for debugging, can you debug getPluginClass to find the value of parameter $plugin_id when $plugin_definition is NULL?

  • Status changed to Fixed 5 months ago
  • πŸ‡©πŸ‡°Denmark uv516 Denmark

    Ok !!!
    I had problems with $form_state in hook_form_alter.
    $form_state in D10.3.2 returns differently, one in most descriptions dealing with D10. One of the descriptions was to set $form['#tree']=TRUE, but that's what gave the error.

    What remains is that $form_state in many cases does not return values ​​as described in the postings I have been able to find (D10).
    But that must be in another thread.

  • Status changed to Closed: works as designed 5 months ago
Production build 0.71.5 2024