Skip to content
Snippets Groups Projects
Commit 974343f3 authored by Igor Biki's avatar Igor Biki
Browse files

ISTWCMS-5925: Adding secondary sort, when created datetime is same after the migration.

parent d1d529a2
No related branches found
No related tags found
2 merge requests!298ISTWCMS-5925: Adding secondary sort, when created datetime is same after the migration.,!274Draft: ISTWCMS-5551: fixing office hours display
......@@ -21,6 +21,8 @@ use Drupal\fillpdf\Form\FillPdfFormForm;
use Drupal\media_library\MediaLibraryState;
use Drupal\user\UserInterface;
use Drupal\uw_cfg_common\Service\UWService;
use Drupal\views\Plugin\views\query\QueryPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\webform\WebformInterface;
use Drupal\webform\WebformSubmissionStorageInterface;
......@@ -1603,3 +1605,14 @@ function _uw_cfg_common_allowed_media_types(
'image' => 'Image',
];
}
/**
* Implements hook_views_query_alter().
*/
function uw_cfg_common_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
// Redirect page default sort updated, added redirect id to sort, on top of
// created datetime sort.
if ($view->id() === 'redirect') {
$query->addOrderBy('redirect', 'rid');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment