Update Drupal 7 dependencies

This commit is contained in:
Mauricio Dinarte 2025-06-03 10:37:00 -06:00 committed by Janez Urevc
parent 7d902ba1ef
commit 13df912654
391 changed files with 2900 additions and 1502 deletions

View file

@ -5,7 +5,7 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
; Information added by Drupal.org packaging script on 2024-12-04
version = "7.103"
project = "drupal"
datestamp = "1709734591"
datestamp = "1733324608"

View file

@ -5,7 +5,7 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
; Information added by Drupal.org packaging script on 2024-12-04
version = "7.103"
project = "drupal"
datestamp = "1709734591"
datestamp = "1733324608"

View file

@ -5,7 +5,7 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
; Information added by Drupal.org packaging script on 2024-12-04
version = "7.103"
project = "drupal"
datestamp = "1709734591"
datestamp = "1733324608"

View file

@ -5,7 +5,7 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
; Information added by Drupal.org packaging script on 2024-12-04
version = "7.103"
project = "drupal"
datestamp = "1709734591"
datestamp = "1733324608"

View file

@ -5,7 +5,7 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
; Information added by Drupal.org packaging script on 2024-12-04
version = "7.103"
project = "drupal"
datestamp = "1709734591"
datestamp = "1733324608"

View file

@ -302,12 +302,12 @@ function hook_user_update(&$edit, $account, $category) {
/**
* The user just logged in.
*
* @param $edit
* The array of form values submitted by the user.
* @param $form_state
* A keyed array containing the current state of the login form.
* @param $account
* The user object on which the operation was just performed.
*/
function hook_user_login(&$edit, $account) {
function hook_user_login(&$form_state, $account) {
// If the user has a NULL time zone, notify them to set a time zone.
if (!$account->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) {
drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/$account->uid/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));

View file

@ -9,7 +9,7 @@ required = TRUE
configure = admin/config/people
stylesheets[all][] = user.css
; Information added by Drupal.org packaging script on 2024-03-06
version = "7.100"
; Information added by Drupal.org packaging script on 2024-12-04
version = "7.103"
project = "drupal"
datestamp = "1709734591"
datestamp = "1733324608"

View file

@ -1283,7 +1283,12 @@ function user_account_form_validate($form, &$form_state) {
elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($form_state['values']['mail']), 'LIKE')->range(0, 1)->execute()->fetchField()) {
// Format error message dependent on whether the user is logged in or not.
if ($GLOBALS['user']->uid) {
form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail'])));
// Do not fail the validation if user has not changed e-mail address.
// This means that multiple accounts with the same e-mail address exist
// and the logged-in user is one of them.
if ((isset($account->mail) && $account->mail != $mail) || !isset($account->mail)) {
form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $form_state['values']['mail'])));
}
}
else {
form_set_error('mail', t('The e-mail address %email is already registered. <a href="@password">Have you forgotten your password?</a>', array('%email' => $form_state['values']['mail'], '@password' => url('user/password'))));
@ -2312,12 +2317,12 @@ function user_authenticate($name, $password) {
* The function records a watchdog message about the new session, saves the
* login timestamp, calls hook_user_login(), and generates a new session.
*
* @param array $edit
* The array of form values submitted by the user.
* @param array $form_state
* A keyed array containing the current state of the login form.
*
* @see hook_user_login()
*/
function user_login_finalize(&$edit = array()) {
function user_login_finalize(&$form_state = array()) {
global $user;
watchdog('user', 'Session opened for %name.', array('%name' => $user->name));
// Update the user table timestamp noting user has logged in.
@ -2329,11 +2334,12 @@ function user_login_finalize(&$edit = array()) {
->execute();
// Regenerate the session ID to prevent against session fixation attacks.
// This is called before hook_user in case one of those functions fails
// or incorrectly does a redirect which would leave the old session in place.
// This is called before hook_user_login() in case one of those functions
// fails or incorrectly does a redirect which would leave the old session in
// place.
drupal_session_regenerate();
user_module_invoke('login', $edit, $user);
user_module_invoke('login', $form_state, $user);
}
/**

View file

@ -144,10 +144,7 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
variable_set('configurable_timezones', 1);
variable_set('date_default_timezone', 'Europe/Brussels');
// Check that the account information fieldset's options are not displayed
// is a fieldset if there is not more than one fieldset in the form.
$this->drupalGet('user/register');
$this->assertNoRaw('<fieldset id="edit-account"><legend>Account information</legend>', 'Account settings fieldset was hidden.');
$edit = array();
$edit['name'] = $name = $this->randomName();
@ -2343,6 +2340,42 @@ class UserEditTestCase extends DrupalWebTestCase {
$this->drupalLogin($user1);
$this->drupalLogout();
}
/**
* Tests that the user can edit the account when another user with the same
* e-mail address exists.
*/
public function testUserEditDuplicateEmail() {
// Create two regular users.
$user1 = $this->drupalCreateUser(array('change own username'));
$user2 = $this->drupalCreateUser(array('change own username'));
// Change the e-mail address of the user2 to have the same e-mail address
// as the user1.
db_update('users')
->fields(array('mail' => $user1->mail))
->condition('uid', $user2->uid)
->execute();
$this->drupalLogin($user2);
$edit['name'] = $user2->name;
$this->drupalPost("user/" . $user2->uid . "/edit", $edit, t('Save'));
$this->assertRaw(t("The changes have been saved."));
$this->drupalLogout();
// Change the e-mail address of the user2 to have the same e-mail address
// as the user1, except that the first letter will be uppercase.
db_update('users')
->fields(array('mail' => ucfirst($user1->mail)))
->condition('uid', $user2->uid)
->execute();
$this->drupalLogin($user2);
$edit['name'] = $user2->name;
$this->drupalPost("user/" . $user2->uid . "/edit", $edit, t('Save'));
$this->assertRaw(t("The changes have been saved."));
$this->drupalLogout();
}
}
/**