- 🇺🇸United States smustgrave
Updated it for D10
Since it's a task does it still need a test?
The last submitted patch, 27: 2560237-27.patch, failed testing. View results →
- 🇮🇳India ankithashetty Karnataka, India
Tried to fix the phpunit errors by replacing the deprecated method
getUsername()
withgetAccountName()
.Thanks!
- Status changed to RTBC
almost 2 years ago 4:27pm 29 January 2023 The last submitted patch, 29: 2560237-29.patch, failed testing. View results →
- Status changed to Needs work
almost 2 years ago 5:29pm 31 January 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php @@ -298,14 +297,14 @@ protected function runDbTasks() { protected function replaceUser1() { - /** @var \Drupal\user\UserInterface $account */ - // @todo Saving the account before the update is problematic. - // https://www.drupal.org/node/2560237 - $account = User::load(1); - $account->setPassword($this->rootUser->pass_raw); - $account->setEmail($this->rootUser->getEmail()); - $account->setUsername($this->rootUser->getAccountName()); - $account->save(); + Database::getConnection()->update('users_field_data') + ->fields([ + 'name' => $this->rootUser->getAccountName(), + 'pass' => \Drupal::service('password')->hash($this->rootUser->pass_raw), + 'mail' => $this->rootUser->getEmail(), + ]) + ->condition('uid', 1) + ->execute();
I think we could do with a comment to explain why we're doing it like this - so no one thinks this is a good idea to copy and to put into real run-time code.
- First commit to issue fork.
- Merge request !9693Issue #2560237 : UpdatePathTestBase saves the root user before updates have run. → (Open) created by bhanu951
- 🇺🇸United States smustgrave
Can issue summary be cleaned up some. Appears to have 2 solutions but not highlighted which.
- 🇷🇴Romania amateescu
Looks ready to me!
This is a blocker for 🐛 entity.last_installed_schema.repository has a race condition Needs review .
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Committed and pushed 8b53ceb644 to 11.x and a113593f22 to 10.4.x. Thanks!
-
alexpott →
committed a113593f on 10.4.x
Issue #2560237 by bhanu951, smustgrave, _utsavsharma, ankithashetty,...
-
alexpott →
committed a113593f on 10.4.x
-
alexpott →
committed 8b53ceb6 on 11.x
Issue #2560237 by bhanu951, smustgrave, _utsavsharma, ankithashetty,...
-
alexpott →
committed 8b53ceb6 on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.