update drupal
This commit is contained in:
@@ -272,8 +272,11 @@ abstract class AccountForm extends ContentEntityForm implements TrustedCallbackI
|
||||
// separately, assume that the user profile data is in the user's preferred
|
||||
// language. This entity builder provides that synchronization. For
|
||||
// use-cases where this synchronization is not desired, a module can alter
|
||||
// or remove this item.
|
||||
$form['#entity_builders']['sync_user_langcode'] = '::syncUserLangcode';
|
||||
// or remove this item. Sync user langcode only when a user registers and
|
||||
// not when a user is updated or translated.
|
||||
if ($register) {
|
||||
$form['#entity_builders']['sync_user_langcode'] = '::syncUserLangcode';
|
||||
}
|
||||
|
||||
$system_date_config = \Drupal::config('system.date');
|
||||
$form['timezone'] = [
|
||||
|
||||
@@ -205,10 +205,10 @@ class PermissionHandler implements PermissionHandlerInterface {
|
||||
|
||||
uasort($all_permissions, function (array $permission_a, array $permission_b) use ($modules) {
|
||||
if ($modules[$permission_a['provider']] == $modules[$permission_b['provider']]) {
|
||||
return $permission_a['title'] > $permission_b['title'];
|
||||
return $permission_a['title'] <=> $permission_b['title'];
|
||||
}
|
||||
else {
|
||||
return $modules[$permission_a['provider']] > $modules[$permission_b['provider']];
|
||||
return $modules[$permission_a['provider']] <=> $modules[$permission_b['provider']];
|
||||
}
|
||||
});
|
||||
return $all_permissions;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Drupal\user\Plugin\Block;
|
||||
|
||||
use Drupal\Component\Utility\UrlHelper;
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
||||
use Drupal\Core\Security\TrustedCallbackInterface;
|
||||
@@ -155,7 +156,7 @@ class UserLoginBlock extends BlockBase implements ContainerFactoryPluginInterfac
|
||||
public static function renderPlaceholderFormAction() {
|
||||
return [
|
||||
'#type' => 'markup',
|
||||
'#markup' => Url::fromRoute('<current>', [], ['query' => \Drupal::destination()->getAsArray(), 'external' => FALSE])->toString(),
|
||||
'#markup' => UrlHelper::filterBadProtocol(Url::fromRoute('<current>', [], ['query' => \Drupal::destination()->getAsArray(), 'external' => FALSE])->toString()),
|
||||
'#cache' => ['contexts' => ['url.path', 'url.query_args']],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class Roles extends PrerenderList {
|
||||
|
||||
if ($uids) {
|
||||
$roles = user_roles();
|
||||
$result = $this->database->query('SELECT u.entity_id as uid, u.roles_target_id as rid FROM {user__roles} u WHERE u.entity_id IN ( :uids[] ) AND u.roles_target_id IN ( :rids[] )', [':uids[]' => $uids, ':rids[]' => array_keys($roles)]);
|
||||
$result = $this->database->query('SELECT u.entity_id AS uid, u.roles_target_id AS rid FROM {user__roles} u WHERE u.entity_id IN ( :uids[] ) AND u.roles_target_id IN ( :rids[] )', [':uids[]' => $uids, ':rids[]' => array_keys($roles)]);
|
||||
foreach ($result as $role) {
|
||||
$this->items[$role->uid][$role->rid]['role'] = $roles[$role->rid]->label();
|
||||
$this->items[$role->uid][$role->rid]['rid'] = $role->rid;
|
||||
|
||||
Reference in New Issue
Block a user