Prepare the module for Drupal 9
- Remove the deprecated code
- Add the core_version_requirement key in the *.info.yml files
| Comment | File | Size | Author |
|---|---|---|---|
| #40 | 3102288-40.patch | 32.69 KB | kim.pepper |
Prepare the module for Drupal 9
| Comment | File | Size | Author |
|---|---|---|---|
| #40 | 3102288-40.patch | 32.69 KB | kim.pepper |
Comments
Comment #2
sreenivasparuchuri commentedI am going to work on it.Assigning to myself.
Comment #3
naveenvalechaThis will make the module compatible with the Drupal 9 too.
Comment #4
berdirThanks for starting this, the composer.json should also get the drupal/core dependency with the same definition.
There also still lots of deprecated code usages, ->url() calls, Unicode:: method calls, drupal_set_message(), simpletest tests and so on.
Comment #5
berdirComment #6
WidgetsBurritos commentedTagging for ContributionWeekend2020 as this may be a good candidate for making progress this weekend.
Comment #7
ankush_03Adding Compatibility patch only for info and composer file !
Comment #8
rksyraviHi,
The patch is working fine. Please review.
Comment #9
ankush_03Comment #10
akashkumar07 commentedPatch looks good to me. Moving to RTBC.
Thanks
Comment #11
WidgetsBurritos commentedI'm still seeing a few deprecation issues here:
Comment #12
iyyappan.govindHi Folks, Removed the deprecated usage in captcha module test. Please review it.
Comment #13
iyyappan.govindComment #14
WidgetsBurritos commentedTest failures need to be resolved:
Comment #15
andreyjan commentedMoved CaptchaSessionReuseAttackTestCase to the tests directory and fixed failing tests.
Comment #16
lestat commentedReviewed and tested.
Comment #17
iyyappan.govindComment #18
jeroentRunning the tests still result in a couple of deprecation notices:
Comment #19
berdirsome of the remaining deprecations require 8.8. If we do fix them there and not create a follow-up then this needs to be changed to ^8.8 || ^9.
there is no neeed anymore for this, it's easier to skip composer.json changes.
Comment #20
dhirendra.mishra commentedI am working on this.
Comment #21
dhirendra.mishra commentedComment #23
swatichouhan012 commentedIf we are using min version 8.8 then we need to remove core key from info file right ? See https://www.drupal.org/node/3070687
Comment #24
iyyappan.govindYes but the CAPTCHA module will support the earlier versions of Drupal 8. So we need to keep the
corekey in the info file other wise module will not detected onDrupal Core Version < D8.7.7.Comment #25
wundo commentedWhy not commit this in a separated branch? (I can create it)
Comment #26
berdirIt's not allowed to have ^8.8 and the old core key, if you require 8.8 then it is by design that older versions can't detect that anymore because they're not compatible.
I would vote against an 8.x-2.x branch for this, that creates considerable long-term maintenance overhead, and marking the old one as unsupported soon-ish would then force users to update as they get unsupported warnings. My approach is simply to wait until I decide to drop 8.7 support, which I plan to do for my modules that require 8.8 around march.
Comment #27
wundo commentedI was actually thinking of creating a 9.x branch not 8.x-2.x
Comment #28
berdirThat's not possible, d.o does not allow that. Instead, the 8.x- prefix will eventually go away and you'll be able to create an 2.x.y branch. But that will take some more time to become available.
Comment #29
wundo commentedGot it, so let's leave it the way its.
Thanks for your help Berdir
Comment #30
iyyappan.govind@Berdir, I agree with your point. Thanks for the clarification.
Comment #31
berdirFound a pre render callback that we need to move to a trusted callback, that just works on the Captcha class because it's a render plugin and all their methods are trusted becuase inherits from \Drupal\Core\Render\Element\RenderCallbackInterface through ElementInterface. I did keep the old function place in case someone calls it directly, that doesn't seem to be the case in contrib: grep.xnddx.ru/search?text=captcha_pre_render_process, so feel free to remove it if you don't think that's an official API from this module.
Also added the defaultTheme property and some assertTrue/False fixes, this is now passing all tests locally without remaining deprecation messages. I did improve some asserts related to those changes, e.g. using find() instead of xpath with a selector that works with the stark theme.
Comment #32
berdirTwo modules were missing the core_version_requirement key.
Comment #33
lisa.rae commentedLooks like a previously closed, duplicate issue was merged anyway.
Rerolling this patch to remove the duplicated code, I hope I caught everything.
Comment #35
lisa.rae commentedComment #36
neslee canil pintoComment #38
neslee canil pintoComment #39
kim.pepper@Neslee Canil Pinto can you please post interdiff files? Without them, it makes it difficult to see what's changed between patches.
Comment #40
kim.pepperThis is just a re-roll of #32 I don't know what the patches following that are doing.
Comment #41
gaëlgAutomated tests passed and drupal-check found no problem. What's still needed for RTBC?
Comment #42
gambryUpgrade status scan doesn't find any more issue, patch on #40 applies nicely to 1.0 too. RTBCed.
Comment #43
heddnI think we need to put a composer require section into the composer.json for
^8.8 || ^9.0. Otherwise someone might try to install the site on 8.7 and run into issues where composer didn't know about the stricter requirements that Drupal has outlined in the info.yml file.Comment #44
berdirSame as #3042808: Drupal 9 Deprecated Code Report, that's not necessary unless it already has a conflicting definition. Not doing it avoids mistakes in the future, like i I did for token.module where I forgot to update it when changing .info.yml :)
Comment #45
adrianpintilie commentedI understand that the code passed RTBC and the last comment isn't required. Who can move this forward as a release for D9? It might be an issue for many sites as they will try to upgrade to D9.
Comment #47
japerryRan through the tests, this works great. Committed just in time for D9!