Aggregation in views causes ajax error

Created on 6 September 2023, about 1 year ago
Updated 12 September 2023, about 1 year ago

Problem/Motivation

setting the aggregation method counts is no longer modifiable by ajax error

Si รจ verificato un errore HTTP in AJAX.
Codice HTTP di risposta: 500
Di seguito le informazioni di debug.
Percorso: /admin/structure/views/ajax/handler-group/content/block_1/field/type
StatusText: 500 Service unavailable (with message)
ResponseText: Si รจ verificato un errore inatteso. Riprova piรน tardi, grazie.TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 692 of core/modules/views/src/Plugin/views/field/EntityField.php). Drupal\views\Plugin\views\field\EntityField->submitGroupByForm() (Line: 106)
Drupal\views_ui\Form\Ajax\ConfigHandlerGroup->submitForm()
call_user_func_array() (Line: 264)
Drupal\views_ui\ViewUI->standardSubmit()
call_user_func_array() (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
Drupal\Core\Form\FormBuilder->processForm() (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 215)
Drupal\views_ui\Form\Ajax\ViewsFormBase->Drupal\views_ui\Form\Ajax\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 217)
Drupal\views_ui\Form\Ajax\ViewsFormBase->ajaxFormWrapper() (Line: 127)
Drupal\views_ui\Form\Ajax\ViewsFormBase->getForm() (Line: 38)
Drupal\views_ui\Form\Ajax\ConfigHandlerGroup->getForm()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 182)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

1) Set a views to aggregation
2) Set the aggregation method on a field to count
3) Re-edit the aggregation method
The form will no longer contain the additional options and saving will return an ajax error

Proposed resolution

Verify that the group_columns options are present in EntityField->submitGroupByForm
In the ConfigHandlerGroup->buildForm class of the views_ui module, ensure that in this case EntityField is called as handler instead of NumericField.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Closed: duplicate

Version

10.1 โœจ

Component
Viewsย  โ†’

Last updated about 11 hours ago

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly Turneight

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024