Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
------ ---------------------------------------------------------------------------
Line src/Plugin/TfaSetup/GALoginHotpSetup.php
------ ---------------------------------------------------------------------------
185 Call to deprecated method getUsername() of class Drupal\user\Entity\User:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Session\AccountInterface::getAccountName() or
\Drupal\user\UserInterface::getDisplayName() instead.
------ ---------------------------------------------------------------------------
------ ---------------------------------------------------------------------------
Line src/Plugin/TfaSetup/GALoginTotpSetup.php
------ ---------------------------------------------------------------------------
182 Call to deprecated method getUsername() of class Drupal\user\Entity\User:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Session\AccountInterface::getAccountName() or
\Drupal\user\UserInterface::getDisplayName() instead.
------ ---------------------------------------------------------------------------
------ ---------------------------------------------------------------------------
Line tests/src/Functional/GALoginHotpValidationPluginTest.php
------ ---------------------------------------------------------------------------
108 Call to deprecated method getUsername() of class Drupal\user\Entity\User:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Session\AccountInterface::getAccountName() or
\Drupal\user\UserInterface::getDisplayName() instead.
132 Call to deprecated method getUsername() of class Drupal\user\Entity\User:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Session\AccountInterface::getAccountName() or
\Drupal\user\UserInterface::getDisplayName() instead.
------ ---------------------------------------------------------------------------
------ ---------------------------------------------------------------------------
Line tests/src/Functional/GALoginTotpValidationPluginTest.php
------ ---------------------------------------------------------------------------
108 Call to deprecated method getUsername() of class Drupal\user\Entity\User:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Session\AccountInterface::getAccountName() or
\Drupal\user\UserInterface::getDisplayName() instead.
141 Call to deprecated method getUsername() of class Drupal\user\Entity\User:
in drupal:8.0.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\Session\AccountInterface::getAccountName() or
\Drupal\user\UserInterface::getDisplayName() instead.
------ ---------------------------------------------------------------------------
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff-3120760-7-10.txt | 3.89 KB | acbramley |
#10 | 3120760-10.patch | 15.35 KB | acbramley |
|
Comments
Comment #2
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedPlease review the patch file. Thank you.
Comment #3
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedBest replacement for User::getUsername without risk of breaking the current code is $account->getAccountName().
Comment #4
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedIt seems clear to me that #2 was never actually tested. The only way for TfaValidationPluginManager to call the create() function is to make these TfaBasePlugin-derived classes extend the ContainerFactoryPluginInterface.
Also replaced the wrong replacement of User::getUsername() with User::getAccountName().
Comment #5
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #6
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedSome more deprecations that were not detected originally:
Comment #7
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedThis is also changing the visibility of
GALoginRecoveryCodeSetup::generateCodes()
from protected to public, as the parent class defines this method as public, and this can't be overridden here.Comment #8
divyesh19Patch #7 looks good and applies cleanly.
Installed module successfully after applying patch on D8.8.7 as well as D9.
Comment #9
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedThese constructor changes need to be applied to GALoginTotpSetup, GALoginHotpSetup, and GALoginRecoveryCodeSetup as well.
Comment #10
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedFixes #9
Comment #12
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #13
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedThank you @jcnventura! Any chance we can get a new release for this?