Skip to content

D9 Deprecated function call to getUsername in DatabaseLogBase:221 #4292

@LedzZm

Description

@LedzZm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions