Problem/Motivation

drupal-check results on commit hash:
source : [git] https://git.drupal.org/project/login_history 6500ca00e28e6359671feba639f6c9170902cc83
source : http://cgit.drupalcode.org/login_history


 ------ ------------------------------------------ 
  Line   login_history.module                      
 ------ ------------------------------------------ 
  35     Call to deprecated function db_insert().  
  63     Call to deprecated function db_query().   
 ------ ------------------------------------------ 

 ------ -------------------------------------------------- 
  Line   src/Controller/LoginHistoryController.php         
 ------ -------------------------------------------------- 
  61     Call to deprecated function db_select().          
  107    Call to deprecated method getUsername() of class  
         Drupal\user\Entity\User.                          
 ------ -------------------------------------------------- 

 [ERROR] Found 4 errors                                                     

 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcdwayne created an issue. See original summary.

Sergiu Stici’s picture

Status: Active » Needs review
FileSize
8.43 KB

Here is the patch, please review.

joy29’s picture

Assigned: Unassigned » joy29
joy29’s picture

Status: Needs review » Reviewed & tested by the community

looks good.. thanks for patch

DamienMcKenna’s picture

Title: Drupal 9 Deprecated Code Report » Drupal 9 Deprecated Code Report for Login History module
Berdir’s picture

oknate’s picture

Here's a combined patch that includes #3106773: Add the 'core_version_requirement' key in info.yml. That one isn't applying for me.

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

Please don't remove the 'core: 8.x' from the info.yml, unless there is a reason to make this module not work with Drupal older than 8.7.7.

Also, it would be really, really nice if this wasn't applying coding standards changes that have nothing to do with Drupal 9.

jcnventura’s picture

The coding standard changes should be handled in #3106510: Drupal Coding Standard issues.

DamienMcKenna’s picture

Please don't remove the 'core: 8.x' from the info.yml, unless there is a reason to make this module not work with Drupal older than 8.7.7.
Is there a reason to retain compatibility for releases of core older than 8.7.7?

jcnventura’s picture

Other than the fact that there's no need to break it, no.

It seems that the documentation on core_version_requirement was not clear that there's no point in removing that property, so most patches remove it needlessly. This is one of those cases.

Berdir’s picture

https://www.drupal.org/node/3070687 is fairly clear I think. If you require 8.7.7 or higher, then you must remove core: 8.x, if ^8 is enough for your module, you can keep it. And a lot of modules rquire 8.7 or 8.8, so they had to remove it. core forces you to do that then.

That said, 8.7.7 and obviously anything below has been unsupported for a while now, so I don't really see the harm in removing it. If you do, then I would specifiy that you require ^8.7.7 though, because you can't actually be compatible with anything ^8 without a core key. It is possible that D9 or D10 will deprecate the core: 8.x line entirely and force you to to remove it, so it's one thing less to update for D10/11 compatibility.

jcnventura’s picture

Indeed, and since this patch specifies ^8 || ^9, I believe it should keep the core key. If it had specified anything different, I wouldn't have said something if it weren't for the fact that the patch in #7 is going outside the scope of this issue by fixing all the short array coding standard problems.

The core_version_requirement will need to be updated for D10/11 anyway, so removing core at that point is perfectly fine. There will probably
be a lot of other deprecations at that time that will need to be handled at that time.

At this point, even if unsupported, there are still more than 100K Drupal sites running 8.7 or lower. Forcing those sites to be on an older version of this module when this issue gets in a tagged release, when that can be avoided, seems a bit pointless.

joestewart’s picture

Status: Needs work » Needs review
FileSize
8.75 KB

Rerolled #7 without the removal of "core: 8.x".

joestewart’s picture

joestewart’s picture

Removed extra line from constructor header.

jcnventura’s picture

Patches #15 and #16 failed to apply, so here's a re-roll of #14 without the coding standards changes.

jcnventura’s picture

One coding standard change was still present.

  • jcnventura authored 38746db on 8.x-1.x
    Issue #3042861 by joestewart, jcnventura, Sergiu Stici, oknate, joy29,...
jcnventura’s picture

Status: Needs review » Fixed

  • jcnventura authored 6ca2872 on 8.x-1.x
    Issue #3042861 by joestewart, jcnventura, Sergiu Stici, oknate, joy29,...

Status: Fixed » Closed (fixed)

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