Skip to content
Snippets Groups Projects

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

Merged Igor Biki requested to merge feature/ISTWCMS-5925-ibiki-redirects-migrations into 1.1.x
1 file
+ 13
0
Compare changes
  • Side-by-side
  • Inline
+ 13
0
@@ -21,6 +21,8 @@ use Drupal\fillpdf\Form\FillPdfFormForm;
@@ -21,6 +21,8 @@ use Drupal\fillpdf\Form\FillPdfFormForm;
use Drupal\media_library\MediaLibraryState;
use Drupal\media_library\MediaLibraryState;
use Drupal\user\UserInterface;
use Drupal\user\UserInterface;
use Drupal\uw_cfg_common\Service\UWService;
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\WebformInterface;
use Drupal\webform\WebformSubmissionStorageInterface;
use Drupal\webform\WebformSubmissionStorageInterface;
@@ -1603,3 +1605,14 @@ function _uw_cfg_common_allowed_media_types(
@@ -1603,3 +1605,14 @@ function _uw_cfg_common_allowed_media_types(
'image' => 'Image',
'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');
 
}
 
}
Loading