------ -----------------------------------------------------------------------
Line manage_display/src/Plugin/Field/FieldFormatter/SubmittedFormatter.php
------ -----------------------------------------------------------------------
127 Call to deprecated function user_view():
in drupal:8.7.0 and is removed from drupal:9.0.0. Use
\Drupal::entityTypeManager()->getViewBuilder('user')->view() instead.
------ -----------------------------------------------------------------------

FILE: manage_display/src/Plugin/Field/FieldFormatter/SubmittedFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
108 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

Comments

sleitner created an issue. See original summary.

adamps’s picture

Category: Bug report » Task

Thanks @sleitner the fix looks good to me. The test was passing on D9 so I guess it doesn't call that line containing user_view(). Therefore we can't rely on the tests to confirm that the fix is working.

Did you test it on your local site?

sleitner’s picture

StatusFileSize
new1.94 KB

Yes I tested it on my local site. I found another error in the test files (wrong filename and class name).

adamps’s picture

Status: Needs review » Reviewed & tested by the community

Thanks. However this issue is about D9 compatibility. If you want to fix coding standards then please use #2995881: Coding standard.

I am willing to commit your first patch on this issue.

  • AdamPS committed ac408bb on 8.x-1.x authored by sleitner
    Issue #3138121 by sleitner: Drupal 9 compatibility
    
adamps’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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