Skip to content

Commit

Permalink
Fixes #3962 Alter Sort Order of user admin view
Browse files Browse the repository at this point in the history
  • Loading branch information
Troy Dean committed Jan 8, 2025
1 parent de2fc6b commit 0d10312
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/custom/az_core/az_core.module
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use Drupal\Core\Url;
use Drupal\block\Entity\Block;
use Drupal\node\NodeInterface;
use Drupal\pathauto\PathautoPatternInterface;
use Drupal\views\ViewExecutable;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;

Expand Down Expand Up @@ -480,6 +481,22 @@ function az_core_node_access(NodeInterface $node, $op, AccountInterface $account
return AccessResult::neutral();
}

/**
* Implements hook_views_pre_view().
*
* Modifies sort order of the user administration view.
*/
function az_core_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
if ($view->id() === 'user_admin_people') {
$display = $view->getDisplay();
$style = $display->getPlugin('style');
// @todo should this rely on a Quickstart configuration setting?
if (!empty($style->options['default'])) {
$style->options['default'] = 'access';
}
}
}

/**
* Implements hook_form_BASE_FORM_ID_alter() for enterprise attribute reset.
*
Expand Down

0 comments on commit 0d10312

Please sign in to comment.