Update to Drupal 8.0.3. For more information, see https://www.drupal.org/drupal-8.0.3-release-notes

This commit is contained in:
Pantheon Automation 2016-02-03 14:56:31 -08:00 committed by Greg Anderson
parent 10f9f7fbde
commit 9db4fae9a7
202 changed files with 3806 additions and 760 deletions

View file

@ -56,10 +56,6 @@ views.argument_default.current_user:
type: boolean
label: 'User ID from logged in user'
views.argument_default.node:
type: boolean
label: 'Content ID from URL'
views_field_user:
type: views_field
mapping:

View file

@ -451,6 +451,8 @@ class AccountSettingsForm extends ConfigFormBase {
->set('register_no_approval_required.subject', $form_state->getValue('user_mail_register_no_approval_required_subject'))
->set('register_pending_approval.body', $form_state->getValue('user_mail_register_pending_approval_body'))
->set('register_pending_approval.subject', $form_state->getValue('user_mail_register_pending_approval_subject'))
->set('register_pending_approval_admin.body', $form_state->getValue('register_pending_approval_admin_body'))
->set('register_pending_approval_admin.subject', $form_state->getValue('register_pending_approval_admin_subject'))
->set('status_activated.body', $form_state->getValue('user_mail_status_activated_body'))
->set('status_activated.subject', $form_state->getValue('user_mail_status_activated_subject'))
->set('status_blocked.body', $form_state->getValue('user_mail_status_blocked_body'))

View file

@ -94,11 +94,14 @@ class Permissions extends ManyToOne {
public function query() {
// @todo user_role_names() should maybe support multiple permissions.
$rids = array();
// Get all roles, that have the configured permissions.
// Get all role IDs that have the configured permissions.
foreach ($this->value as $permission) {
$roles = user_role_names(FALSE, $permission);
$rids += array_keys($roles);
// user_role_names() returns an array with the role IDs as keys, so take
// the array keys and merge them with previously found role IDs.
$rids = array_merge($rids, array_keys($roles));
}
// Remove any duplicate role IDs.
$rids = array_unique($rids);
$this->value = $rids;

View file

@ -37,6 +37,16 @@ class UserAdminSettingsFormTest extends SystemConfigFormTestBase {
'#config_name' => 'user.mail',
'#config_key' => 'cancel_confirm.subject',
),
'register_pending_approval_admin_body' => array(
'#value' => $this->randomString(),
'#config_name' => 'user.mail',
'#config_key' => 'register_pending_approval_admin.body',
),
'register_pending_approval_admin_subject' => array(
'#value' => $this->randomString(20),
'#config_name' => 'user.mail',
'#config_key' => 'register_pending_approval_admin.subject',
),
);
}
}

View file

@ -100,7 +100,7 @@ class UserPictureTest extends WebTestBase {
$image_style_id = $this->config('core.entity_view_display.user.user.compact')->get('content.user_picture.settings.image_style');
$style = ImageStyle::load($image_style_id);
$image_url = $style->buildUrl($file->getfileUri());
$image_url = file_url_transform_relative($style->buildUrl($file->getfileUri()));
$alt_text = 'Profile picture for user ' . $this->webUser->getUsername();
// Verify that the image is displayed on the node page.

View file

@ -49,4 +49,18 @@ class UserSaveTest extends WebTestBase {
$user_by_name = user_load_by_name($test_name);
$this->assertTrue($user_by_name, 'Loading user by name.');
}
/**
* Ensures that an existing password is unset after the user was saved.
*/
function testExistingPasswordRemoval() {
/** @var \Drupal\user\Entity\User $user */
$user = User::create(['name' => $this->randomMachineName()]);
$user->save();
$user->setExistingPassword('existing password');
$this->assertNotNull($user->pass->existing);
$user->save();
$this->assertNull($user->pass->existing);
}
}

View file

@ -21,7 +21,7 @@ class UserTimeZoneTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('node');
public static $modules = array('node', 'system_test');
/**
* Tests the display of dates and time when user-configurable time zones are set.
@ -73,5 +73,19 @@ class UserTimeZoneTest extends WebTestBase {
$this->assertText('2007-03-11 05:00 CLT', 'Date should be Chile time; four hours ahead of PST');
$this->drupalGet('node/' . $node3->id());
$this->assertText('2007-03-21 00:00 CLT', 'Date should be Chile time; three hours ahead of PDT.');
// Ensure that anonymous users also use the default timezone.
$this->drupalLogout();
$this->drupalGet('node/' . $node1->id());
$this->assertText('2007-03-09 21:00 PST', 'Date should be PST.');
$this->drupalGet('node/' . $node2->id());
$this->assertText('2007-03-11 01:00 PST', 'Date should be PST.');
$this->drupalGet('node/' . $node3->id());
$this->assertText('2007-03-20 21:00 PDT', 'Date should be PDT.');
// Format a date without accessing the current user at all and
// ensure that it uses the default timezone.
$this->drupalGet('/system-test/date');
$this->assertText('2016-01-13 08:29 PST', 'Date should be PST.');
}
}

View file

@ -62,6 +62,31 @@ class HandlerFilterPermissionTest extends UserKernelTestBase {
$this->assertIdenticalResultset($view, $expected, $column_map);
$view->destroy();
// Filter by not a permission.
$view->initHandlers();
$view->filter['permission']->operator = 'not';
$view->filter['permission']->value = array('administer users');
$this->executeView($view);
$this->assertEqual(count($view->result), 3);
$expected = array();
$expected[] = array('uid' => 1);
$expected[] = array('uid' => 2);
$expected[] = array('uid' => 3);
$this->assertIdenticalResultset($view, $expected, $column_map);
$view->destroy();
// Filter by not multiple permissions, that are present in multiple roles.
$view->initHandlers();
$view->filter['permission']->operator = 'not';
$view->filter['permission']->value = array('administer users', 'administer permissions');
$this->executeView($view);
$this->assertEqual(count($view->result), 2);
$expected = array();
$expected[] = array('uid' => 1);
$expected[] = array('uid' => 2);
$this->assertIdenticalResultset($view, $expected, $column_map);
$view->destroy();
// Filter by another permission of a role with multiple permissions.
$view->initHandlers();
$view->filter['permission']->value = array('administer users');