updated core and modules

This commit is contained in:
Bachir Soussi Chiadmi
2017-09-09 16:27:51 +02:00
parent 027aa99b32
commit 41863f872c
7810 changed files with 318922 additions and 83631 deletions
+18 -15
View File
@@ -44,7 +44,7 @@ function hook_user_cancel($edit, $account, $method) {
$nodes = \Drupal::entityQuery('node')
->condition('uid', $account->id())
->execute();
node_mass_update($nodes, array('status' => 0), NULL, TRUE);
node_mass_update($nodes, ['status' => 0], NULL, TRUE);
break;
case 'user_cancel_reassign':
@@ -53,10 +53,10 @@ function hook_user_cancel($edit, $account, $method) {
$nodes = \Drupal::entityQuery('node')
->condition('uid', $account->id())
->execute();
node_mass_update($nodes, array('uid' => 0), NULL, TRUE);
node_mass_update($nodes, ['uid' => 0], NULL, TRUE);
// Anonymize old revisions.
db_update('node_field_revision')
->fields(array('uid' => 0))
->fields(['uid' => 0])
->condition('uid', $account->id())
->execute();
break;
@@ -94,12 +94,12 @@ function hook_user_cancel_methods_alter(&$methods) {
unset($methods['user_cancel_reassign']);
// Add a custom zero-out method.
$methods['mymodule_zero_out'] = array(
$methods['mymodule_zero_out'] = [
'title' => t('Delete the account and remove all content.'),
'description' => t('All your content will be replaced by empty strings.'),
// access should be used for administrative methods only.
'access' => $account->hasPermission('access zero-out account cancellation method'),
);
];
}
/**
@@ -109,18 +109,21 @@ function hook_user_cancel_methods_alter(&$methods) {
* that is displayed. Can be used to ensure user privacy in situations where
* $account->getDisplayName() is too revealing.
*
* @param string $name
* The string that $account->getDisplayName() will return.
* @param string|Drupal\Component\Render\MarkupInterface $name
* The username that is displayed for a user. If a hook implementation changes
* this to an object implementing MarkupInterface it is the responsibility of
* the implementation to ensure the user's name is escaped properly. String
* values will be autoescaped.
* @param \Drupal\Core\Session\AccountInterface $account
* The user object on which the operation is being performed.
*
* @param $account
* The account object the name belongs to.
*
* @see \Drupal\Core\Session\AccountInterface->getDisplayName()
* @see \Drupal\Core\Session\AccountInterface::getDisplayName()
* @see sanitization
*/
function hook_user_format_name_alter(&$name, $account) {
// Display the user's uid instead of name.
if ($account->id()) {
$name = t('User @uid', array('@uid' => $account->id()));
$name = t('User @uid', ['@uid' => $account->id()]);
}
}
@@ -134,7 +137,7 @@ function hook_user_login($account) {
$config = \Drupal::config('system.date');
// If the user has a NULL time zone, notify them to set a time zone.
if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
drupal_set_message(t('Configure your <a href=":user-edit">account time zone setting</a>.', array(':user-edit' => $account->url('edit-form', array('query' => \Drupal::destination()->getAsArray(), 'fragment' => 'edit-timezone')))));
drupal_set_message(t('Configure your <a href=":user-edit">account time zone setting</a>.', [':user-edit' => $account->url('edit-form', ['query' => \Drupal::destination()->getAsArray(), 'fragment' => 'edit-timezone'])]));
}
}
@@ -146,10 +149,10 @@ function hook_user_login($account) {
*/
function hook_user_logout($account) {
db_insert('logouts')
->fields(array(
->fields([
'uid' => $account->id(),
'time' => time(),
))
])
->execute();
}