Problem/Motivation
Views Natural Sort causes HTTP errors when uploading files or running AJAX processes on a Drupal 11 site.
Steps to reproduce
Drupal 11 site with Views Natural Sort installed and configured on at least one view.
Navigate to Administration > Structure > Views > Views Settings > View Natural Sort Configuration.
Select In case of Emergency > Rebuild Index.
This can also be reproduced when uploading files or running AJAX operations unrelated to Views Natural Sort. This AJAX HTTP error prevents these operations from completing. When Views Natural Sort is uninstalled, no errors occur.
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=98&op=do_nojs&op=do
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.TypeError: Cannot access offset of type array on array in Drupal\Core\Database\Query\Merge->key() (line 331 of core/lib/Drupal/Core/Database/Query/Merge.php). Drupal\views_natural_sort\IndexRecord->save() (Line: 329)
Drupal\views_natural_sort\ViewsNaturalSortService->storeIndexRecordsFromEntity(Object) (Line: 61)
Drupal\views_natural_sort\Plugin\QueueWorker\EntityIndexer->processItem(Array) (Line: 210)
views_natural_sort_rebuild_index('views_natural_sort_entity_index', Array) (Line: 297)
_batch_process() (Line: 139)
_batch_do() (Line: 95)
_batch_page(Object) (Line: 52)
Drupal\system\Controller\BatchController->batchPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
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: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 44)
Drupal\redirect_after_login\RedirectMiddleware->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: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->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: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3500675-use-keys-for-array-support.patch | 779 bytes | caldenjacobs |
Issue fork views_natural_sort-3500675
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
caldenjacobs commentedComment #3
caldenjacobs commentedComment #4
caldenjacobs commentedUpdate issue name
Comment #5
caldenjacobs commentedComment #6
caldenjacobs commentedComment #7
byrond commentedWe were getting the following error just trying to enable this module on a Drupal 11 site:
Installing the patch here fixes that issue.
Comment #10
mark_fullmerI can confirm that the patch in #6 resolves the issue.
Comment #12
joelpittetComment #14
joelpittetThank you all for fixing that issue and making this work with Drupal 11!