Problem/Motivation

In \Drupal\user\UserStorage the constructor has the password service injected.

This is never used. Instead, it seems it's fetched from \Drupal in \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem

Proposed resolution

Change the constructor so that the password service is not injected, and remove the unused class variable that hold it.

Remaining tasks

User interface changes

none

API changes

Service constructor change

Data model changes

none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin created an issue. See original summary.

shabirahmad’s picture

Assigned: Unassigned » shabirahmad
shabirahmad’s picture

Status: Active » Needs review
FileSize
2.24 KB

patch!

naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

looks good to go.Bot will be happy

swentel’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/user/src/UserStorage.php
@@ -44,15 +36,11 @@ class UserStorage extends SqlContentEntityStorage implements UserStorageInterfac
+  public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityManagerInterface $entity_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager) {

I think we can remove the __construct and createInstance underneath as well

shabirahmad’s picture

Status: Needs work » Needs review
shabirahmad’s picture

shabirahmad’s picture

shabirahmad’s picture

Status: Needs review » Needs work

The last submitted patch, 9: 2648290-removed-constructor-8.patch, failed testing.

naveenvalecha’s picture

Status: Needs work » Needs review
FileSize
1.87 KB

Straight Reroll

Status: Needs review » Needs work

The last submitted patch, 11: 2648290-removed-constructor-9.patch, failed testing.

naveenvalecha’s picture

Status: Needs work » Needs review
FileSize
1.13 KB
2.54 KB

I suspect the above failures were random.let's see
Removed the unused use statements and password property.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Sweet code cleanup.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 13: 2648290-13.patch, failed testing.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture