diff --git a/uw_cfg_common.module b/uw_cfg_common.module index d3b0b0a9d931f3ba534d9a8807c745a42b7f4bcd..5eacc811a6bad55fde75a8abc387810e7ca20f95 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -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'); + } +}