Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#18 | drupal_9_deprecated_code-3042861-18.patch | 3.58 KB | jcnventura |
| |||
#18 | interdiff_17_18.txt | 595 bytes | jcnventura |
Comments
Comment #2
Sergiu Stici CreditAttribution: Sergiu Stici at FFW commentedHere is the patch, please review.
Comment #3
joy29 CreditAttribution: joy29 at Material commentedComment #4
joy29 CreditAttribution: joy29 at Material commentedlooks good.. thanks for patch
Comment #5
DamienMcKennaComment #6
BerdirNote: Will also need #3106773: Add the 'core_version_requirement' key in info.yml.
Comment #7
oknateHere's a combined patch that includes #3106773: Add the 'core_version_requirement' key in info.yml. That one isn't applying for me.
Comment #8
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedPlease 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.
Comment #9
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedThe coding standard changes should be handled in #3106510: Drupal Coding Standard issues.
Comment #10
DamienMcKennaPlease 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?
Comment #11
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedOther 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.
Comment #12
Berdirhttps://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.
Comment #13
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedIndeed, 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.
Comment #14
joestewart CreditAttribution: joestewart at Mediacurrent commentedRerolled #7 without the removal of "core: 8.x".
Comment #15
joestewart CreditAttribution: joestewart at Mediacurrent commentedRerolled after RTBC #3106510-19: Drupal Coding Standard issues patch applied.
Comment #16
joestewart CreditAttribution: joestewart at Mediacurrent commentedRemoved extra line from constructor header.
Comment #17
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedPatches #15 and #16 failed to apply, so here's a re-roll of #14 without the coding standards changes.
Comment #18
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedOne coding standard change was still present.
Comment #20
jcnventura CreditAttribution: jcnventura at 1xINTERNET commented