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
As of commit e935322714de920f9378958b801cd3ab58f3d7e8
------ --------------------------------------------------------------------------------------
Line captcha.module
------ --------------------------------------------------------------------------------------
257 Call to deprecated method url() of class Drupal\Core\Config\Entity\ConfigEntityBase.
320 Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.
320 Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.
350 Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.
350 Call to deprecated method strtolower() of class Drupal\Component\Utility\Unicode.
------ --------------------------------------------------------------------------------------
------ ------------------------------------------------------
Line image_captcha/src/Controller/CaptchaImageRefresh.php
------ ------------------------------------------------------
46 Call to deprecated method url() of class Drupal.
------ ------------------------------------------------------
------ -----------------------------------------------------
Line image_captcha/src/Form/ImageCaptchaSettingsForm.php
------ -----------------------------------------------------
75 Call to deprecated function drupal_set_message().
------ -----------------------------------------------------
------ -----------------------------------------------------------
Line modules/captcha_long_form_id_test/src/Form/LongIdForm.php
------ -----------------------------------------------------------
44 Call to deprecated function drupal_set_message().
------ -----------------------------------------------------------
------ ---------------------------------------------------
Line src/Form/CaptchaPointDeleteForm.php
------ ---------------------------------------------------
40 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
------ ---------------------------------------------------
Line src/Form/CaptchaPointDisableForm.php
------ ---------------------------------------------------
48 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
------ ---------------------------------------------------
Line src/Form/CaptchaPointEnableForm.php
------ ---------------------------------------------------
48 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
------ ---------------------------------------------------
Line src/Form/CaptchaPointForm.php
------ ---------------------------------------------------
104 Call to deprecated function drupal_set_message().
109 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
------ ---------------------------------------------------
Line src/Form/CaptchaSettingsForm.php
------ ---------------------------------------------------
237 Call to deprecated function drupal_set_message().
252 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
[ERROR] Found 15 errors
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#19 | interdiff-3042586-16-17.txt | 6.89 KB | JeroenT |
#17 | 3042586-17.patch | 8.77 KB | JeroenT |
|
Comments
Comment #2
ChaseOnTheWebPatch attached to address all listed issues.
Strtolower is a simple find/replace per CR [#2850048]. drupal_set_message is also a simple find/replace for anything implementing FormBase per CR [#2774931].
I think I updated the url() calls correctly. I will test out and update the patch if not. I'm new to D8/9 development. I submitted this as part of a contribution sprint at MidCamp 2019.
Comment #4
ChaseOnTheWebTypo in last patch, sorry for noise
Comment #6
thallesFollow the patch!
Comment #7
thallesComment #9
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #10
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #11
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #12
arpitr CreditAttribution: arpitr commentedThanks @yogenprasad for working on this.
Few issues which I see
1. There is one pending deprecated message
------ --------------------------------------------------------------------------------------
Line captcha.module
------ --------------------------------------------------------------------------------------
257 Call to deprecated method url() of class Drupal\Core\Config\Entity\ConfigEntityBase.
------ --------------------------------------------------------------------------------------
[ERROR] Found 1 error
2. Instead of using the procedural way of drupal set message if we can use Messenger Trait
Replace
+ \Drupal::messenger()->addMessage
with Messenger Trait as in example
https://www.drupal.org/node/2774931
Comment #13
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedChanges done as per suggestions.
Comment #14
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #16
yogen.prasad CreditAttribution: yogen.prasad as a volunteer commentedComment #17
JeroenTComment #18
thalles@JeroenT, can you post the interdiff?
Comment #19
JeroenTAdded interdiff.
Comment #20
thallesThanks @JeroenT!
Comment #21
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedComment #22
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedComment #24
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedThanks, committed
Comment #25
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #27
Steven Brown CreditAttribution: Steven Brown as a volunteer commentedRun against
6731656
. Here are some new deprecations since this issue was closed.