Problem/Motivation

drupal-check results on commit hash:
source : [git] https://git.drupal.org/project/blog 43a21717baa0e28888a40da5792601d33ecc016f
source : http://cgit.drupalcode.org/blog


 ------ ------------------------------------------------ 
  Line   blog.module                                     
 ------ ------------------------------------------------ 
  19     Call to deprecated method l() of class Drupal.  
  89     Call to deprecated function db_select().        
 ------ ------------------------------------------------ 

 ------ -------------------------------------------------- 
  Line   src/BlogLister.php                                
 ------ -------------------------------------------------- 
  52     Call to deprecated method getUsername() of class  
         Drupal\Core\Session\AccountInterface.             
 ------ -------------------------------------------------- 

 [ERROR] Found 3 errors                                                     

 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 drupal-9-deprecated.patch1.67 KBmaliknaik

Comments

mcdwayne created an issue. See original summary.

maliknaik’s picture

StatusFileSize
new1.67 KB

Fixed all the deprecated methods.

maliknaik’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: drupal-9-deprecated.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

maliknaik’s picture

Status: Needs work » Needs review
nevergone’s picture

$ /app/vendor/bin/drupal-check -a /app/web/modules/contrib/blog

------ -------------------------------------------------------------------------
Line blog.module
------ -------------------------------------------------------------------------
18 Call to deprecated method l() of class Drupal:
in drupal:8.0.0 and is removed from drupal:9.0.0. Use
\Drupal\Core\Link::fromTextAndUrl() instead.
47 Function url not found.
96 Call to deprecated function db_select():
in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get
a database connection injected into your service from the container and
call select() on it. For example,
------ -------------------------------------------------------------------------

------ ---------------------------------------------------------------------------------------------------------
Line src/BlogBreadcrumbBuilder.php
------ ---------------------------------------------------------------------------------------------------------
35 Method Drupal\blog\BlogBreadcrumbBuilder::applies() should return bool but return statement is missing.
------ ---------------------------------------------------------------------------------------------------------

------ -------------------------------------------------------
Line src/Controller/BlogController.php
------ -------------------------------------------------------
36 Unsafe usage of new static().
💡 Consider making the class or the constructor final.
------ -------------------------------------------------------

------ -------------------------------------------------------
Line src/Plugin/Menu/MyBlogLink.php
------ -------------------------------------------------------
34 Unsafe usage of new static().
💡 Consider making the class or the constructor final.
------ -------------------------------------------------------

------ ------------------------------------------------------------------------------
Line tests/src/Functional/BreadcrumbTest.php
------ ------------------------------------------------------------------------------
51 \Drupal calls should be avoided in classes, use dependency injection instead
62 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------

  • nevergone committed c20a554 on 8.x-2.x
    Issue #3042978 by maliknaik, nevergone: Drupal 9 Deprecated Code Report
    
nevergone’s picture

Status: Needs review » Fixed

Done.

Status: Fixed » Closed (fixed)

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