uasort(): Array was modified by the user comparison functionuasort(Array, Object)

Drupal\views\Entity\View->mergeDefaultDisplaysOptions()
Drupal\views\Entity\View::postLoad(Object, Array)
Drupal\Core\Entity\EntityStorageControllerBase->postLoad(Array)
Drupal\Core\Config\Entity\ConfigStorageController->loadMultiple(Array)
Drupal\views\ViewStorageController->loadMultiple(Array)
Drupal\views\Views::getApplicableViews('uses_route')
Drupal\views\EventSubscriber\RouteSubscriber->getApplicableViews()
Drupal\views\EventSubscriber\RouteSubscriber->getViewsDisplayIDsWithRoute()
Drupal\views\EventSubscriber\RouteSubscriber->alterRoutes(Object, 'config_test')
Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object, 'routing.route_alter', Object)
call_user_func(Array, Object, 'routing.route_alter', Object)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'routing.route_alter', Object)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('routing.route_alter', Object)
Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_alter', Object)
Drupal\Core\Routing\RouteBuilder->rebuild()
Drupal\Core\Routing\RouteBuilder->rebuildIfNeeded()
Drupal\config_translation\Tests\ConfigTranslationUiTest->testThemeDiscovery()
Drupal\simpletest\TestBase->run()
simpletest_script_run_one_test('148', 'Drupal\config_translation\Tests\ConfigTranslationUiTest')

Comments

longwave’s picture

Status: Needs review » Closed (cannot reproduce)
sun’s picture

Priority: Normal » Critical
Status: Closed (cannot reproduce) » Needs work

Definitely a problem, just re-occurred in https://qa.drupal.org/pifr/test/737658

However, this only happens rarely.

I wonder whether we should simply fix the faulty position: {} values (to be position: 0) in the views test config files and... "hope" ?

longwave’s picture

Status: Needs work » Needs review
sun’s picture

i.e., I'd propose to just simply go ahead and commit attached patch.

sun’s picture

Issue summary: View changes
longwave’s picture

Status: Needs review » Reviewed & tested by the community

The views YAML files are definitely malformed, so let's just get this in

$ git grep -l "position: 0"|grep views.view|wc -l
93
$ git grep -l "position: {  }"|grep views.view
core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml
core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed ba3a839 and pushed to 8.x. Thanks!

Nice find!

longwave’s picture

Status: Fixed » Active

Happened again in https://qa.drupal.org/pifr/test/745518

uasort(): Array was modified by the user comparison functionuasort(Array, Object) Drupal\views\Entity\View->mergeDefaultDisplaysOptions() Drupal\views\Entity\View::postLoad(Object, Array) Drupal\Core\Entity\EntityStorageControllerBase->postLoad(Array) Drupal\Core\Config\Entity\ConfigStorageController->loadMultiple(Array) Drupal\views\ViewStorageController->loadMultiple(Array) Drupal\views\Views::getApplicableViews('uses_route') Drupal\views\EventSubscriber\RouteSubscriber->getApplicableViews() Drupal\views\EventSubscriber\RouteSubscriber->getViewsDisplayIDsWithRoute() Drupal\views\EventSubscriber\RouteSubscriber->alterRoutes(Object, 'config_test') Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object, 'routing.route_alter', Object) call_user_func(Array, Object, 'routing.route_alter', Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'routing.route_alter', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('routing.route_alter', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_alter', Object) Drupal\Core\Routing\RouteBuilder->rebuild() Drupal\Core\Routing\RouteBuilder->rebuildIfNeeded() Drupal\config_translation\Tests\ConfigTranslationUiTest->testThemeDiscovery() Drupal\simpletest\TestBase->run() simpletest_script_run_one_test('148', 'Drupal\config_translation\Tests\ConfigTranslationUiTest')

andypost’s picture

There's a lot test views in core that have 'null' as position

berdir’s picture

NULL is fine, we verified that extensively.

None of those modules are enabled in that test, so I don't see how they should have fixed this :)

Time for some debugging I guess, will try a similar approach as in #2216701: Random test failure in ToolbarAdminMenuTest. Wouldn't be surprised if it's the same issue that caused it.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new416 bytes

The other one was fixed, let's see if this one still happens...

berdir’s picture

longwave’s picture

@Berdir: I couldn't reproduce it with that same patch in #0, I don't know a guaranteed way of triggering it.

berdir’s picture

Status: Needs review » Fixed

I did run that test twice and id didn't happen anymore. Cool, I'm going to set it back to fixed/duplicate of the other. We can still re-open if it happens again.

Status: Fixed » Closed (fixed)

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