function content_moderation_test_views_views_query_alter
Same name in other branches
- 9 core/modules/content_moderation/tests/modules/content_moderation_test_views/content_moderation_test_views.module \content_moderation_test_views_views_query_alter()
- 8.9.x core/modules/content_moderation/tests/modules/content_moderation_test_views/content_moderation_test_views.module \content_moderation_test_views_views_query_alter()
- 10 core/modules/content_moderation/tests/modules/content_moderation_test_views/content_moderation_test_views.module \content_moderation_test_views_views_query_alter()
Implements hook_views_query_alter().
See also
\Drupal\Tests\content_moderation\Kernel\ViewsModerationStateSortTest::testSortRevisionBaseTable()
File
-
core/
modules/ content_moderation/ tests/ modules/ content_moderation_test_views/ content_moderation_test_views.module, line 18
Code
function content_moderation_test_views_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
// Add a secondary sort order to ensure consistent builds when testing click
// and table sorting.
if ($view->id() === 'test_content_moderation_state_sort_revision_table') {
$query->addOrderBy('node_field_revision', 'vid', 'ASC');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.