Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ebeyrent’s picture

FileSize
7.98 KB

First patch attempt

ebeyrent’s picture

Assigned: Unassigned » ebeyrent
Status: Active » Needs review

Status: Needs review » Needs work
Issue tags: -WSSCI Conversion

The last submitted patch, 2001044-1.patch, failed testing.

ebeyrent’s picture

Status: Needs work » Needs review

#1: 2001044-1.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +WSSCI Conversion

The last submitted patch, 2001044-1.patch, failed testing.

ebeyrent’s picture

Status: Needs work » Needs review
FileSize
8.71 KB

Status: Needs review » Needs work

The last submitted patch, 2001044-6.patch, failed testing.

alexander.ilivanov’s picture

Will be done today during Code Sprint UA

alexander.ilivanov’s picture

Status: Needs work » Needs review
Issue tags: -WSSCI Conversion
FileSize
7.05 KB

drupal_container() replaced
Patch attached.

alexander.ilivanov’s picture

Berdir’s picture

+++ b/core/modules/user/user.moduleundefined
@@ -1288,7 +1288,7 @@ function user_login_name_validate($form, &$form_state) {
-  $flood = Drupal::service('flood');
+  $flood = \Drupal::service('flood');

\ is not necessary if it's not in a class, same for other cases.

Instead of Drupal::service('flood'), you can use Drupal::flood()

alexander.ilivanov’s picture

You are right.

andypost’s picture

Each test have own container so use it

+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.phpundefined
@@ -71,7 +71,7 @@ function testUserCancelUid1() {
-      'pass' => drupal_container()->get('password')->hash(trim($password)),
+      'pass' => \Drupal::service('password')->hash(trim($password)),

+++ b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.phpundefined
@@ -107,7 +107,7 @@ function testPasswordRehashOnLogin() {
-    $password_hasher = drupal_container()->get('password');
+    $password_hasher = \Drupal::service('password');

use $this->container->get('needed service')->operation

alexander.ilivanov’s picture

Fixed for Test
Patch added.

andypost’s picture

+++ b/core/modules/user/user.moduleundefined
@@ -1310,7 +1310,7 @@ function user_login_authenticate_validate($form, &$form_state) {
-        $identifier = $account->uid . '-' . Drupal::request()->getClientIP();
+        $identifier = $account->uid . '-' . \Drupal::request()->getClientIP();

PLease do not change this

Status: Needs review » Needs work

The last submitted patch, replace-drupal_container-2001044-14.patch, failed testing.

alexander.ilivanov’s picture

andypost’s picture

Status: Needs work » Needs review

Let's see what bot say

ddrozdik’s picture

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Awesome

andypost’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/user/user.moduleundefined
@@ -1288,7 +1288,7 @@ function user_login_name_validate($form, &$form_state) {
-  $flood = Drupal::service('flood');
+  $flood = Drupal::flood();

@@ -1336,7 +1336,7 @@ function user_login_authenticate_validate($form, &$form_state) {
-  $flood = Drupal::service('flood');
+  $flood = Drupal::flood();

This 2 hunks was lost

jlbellido’s picture

Added fixes for Drupal::service('flood'); lost in #19

Status: Needs review » Needs work
Issue tags: -WSSCI Conversion, -CodeSprintUA

The last submitted patch, 2001044-replace-drupal_container-user-module_22.patch, failed testing.

jlbellido’s picture

Status: Needs work » Needs review
unstatu’s picture

Status: Needs review » Needs work
Issue tags: +WSSCI Conversion, +CodeSprintUA

The last submitted patch, 2001044-replace-drupal_container-user-module_22.patch, failed testing.

jlbellido’s picture

Issue tags: +Needs reroll

Needs reroll

aitiba’s picture

Assigned: ddrozdik » aitiba
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
7.14 KB

I re-roll the patch using the re-roll guidelines and with @jlbellido's teach. I remove user_login_authenticate_validate() and user_login_final_validate() functions of user.module because these functions no longer exist and are deleted before the last patch was uploaded.

Thanks to @jlbellido for teach me how goes the re-rolling and @alexpott for guide me.

Status: Needs review » Needs work

The last submitted patch, 2001044-replace-drupal_container-user-module_28.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
FileSize
5.41 KB
+++ b/core/modules/user/user.moduleundefined
@@ -1095,8 +1095,80 @@ function user_menu_title() {
  */
+<<<<<<< HEAD
 function user_page_title(UserInterface $account = NULL) {
   return $account ? $account->getUsername() : '';
+=======
+function user_page_title($account) {
+  return is_object($account) ? user_format_name($account) : '';
+}

Hey @aitiba... this is part of the conflict information. Before you upload patches it's great to manually test them first. You can do this by enabling the simpletest module and running the user tests. And a manual inspection of the patch file before uploading can reveal this. Basically you should be able to review the patch file and think yep that all makes sense.

As I did the re-roll yesterday to help on irc I will upload my version so you can contrast and compare the patches... and perhaps try the reroll process again to see if you can come up with the same patch.

Also we can now inject the user.data service properly into the views UserData plugin and not just pull it from the Drupal static. The code that does this is...

   /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
+    return new static($configuration, $plugin_id, $plugin_definition, $container->get('user.data'));
+  }
+
+  /**
+   * Constructs a UserData object.
+   */
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, UserDataInterface $user_data) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+
+    $this->userData = $user_data;
+  }
+
+  /**
    * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
    */
   public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
     parent::init($view, $display, $options);
-
-    $this->userData = drupal_container()->get('user.data');
   }
alvar0hurtad0’s picture

Needs reroll

ebeyrent’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. RTBC

longwave’s picture

Status: Reviewed & tested by the community » Needs work
  /**
   * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);
  }

This method does nothing except call its parent now, so can't it just be removed?

ayelet_Cr’s picture

Status: Needs work » Needs review
FileSize
5.45 KB

Status: Needs review » Needs work
Issue tags: -WSSCI Conversion, -CodeSprintUA

The last submitted patch, 2001044-replace-drupal_container-user.patch, failed testing.

ayelet_Cr’s picture

Status: Needs work » Needs review
Issue tags: +WSSCI Conversion, +CodeSprintUA
Crell’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.