drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

D9 Deprecated function call to getUsername in DatabaseLogBase:221

Open LedzZm opened this issue 3 years ago • 0 comments

D9 Deprecated function call to getUsername in DatabaseLogBase:221 used by command:LogPollCommand

Problem

The issue appeared in the LogPollCommand but in reality it lies in it's parent "DatabaseLogBase". In DatabaseLogBase:221 a call to the getUsername function is made. Looking at Drupal\user\Entity\User::getUsername() I see:

in Drupal 8.0.0, will be removed before Drupal 9.0.0. Use \Drupal\Core\Session\AccountInterface::getAccountName() or \Drupal\user\UserInterface::getDisplayName() instead.

Hope we can integrate the above mentioned change so that, probably one of the most underappreciated commands, is functional again.

  • Drupal version: Spotted in 9.0.9 but should be an issue in earlier versions as well.
  • Console version: 1.9.7.
  • Console Launcher: 1.9.7.
  • Steps to reproduce: Just run the database:log:poll command.

Best Regards, Marios.

LedzZm avatar Dec 30 '20 15:12 LedzZm