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: f479d32c
./vendor/bin/drupal-check modules/contrib/smtp/
9/9 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ---------------------------------------------------
Line smtp.install
------ ---------------------------------------------------
32 Call to deprecated function drupal_set_message().
33 Call to deprecated function drupal_set_message().
------ ---------------------------------------------------
[ERROR] Found 2 errors
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#29 | 3042630-29.patch | 9.36 KB | Suresh Prabhu Parkala |
| |||
#27 | 3042630-27.patch | 9.32 KB | Suresh Prabhu Parkala |
| |||
#24 | drupal-9-deprecated-code-report-3042630-24.patch | 9.02 KB | rivimey |
|
Comments
Comment #2
joy29 CreditAttribution: joy29 commentedComment #3
joy29 CreditAttribution: joy29 commentedComment #5
Waldoswndrwrld CreditAttribution: Waldoswndrwrld at iO commentedCreated #3054630: replace \Egulias\EmailValidator\EmailValidator with \Drupal\Component\Utility\EmailValidator which fixes the failing tests.
Comment #6
joy29 CreditAttribution: joy29 commented@Waldoswndrwrld Thanks
Comment #7
joy29 CreditAttribution: joy29 commentedComment #9
jigish.addweb CreditAttribution: jigish.addweb at AddWeb Solution Pvt. Ltd. commented@ChaseOnTheWeb, Kindly review the attached patch & let me know your views for the same.
Thanks!..
Comment #11
joy29 CreditAttribution: joy29 at Material commentedComment #12
John Cook CreditAttribution: John Cook at Creode commentedThe
strtolower()
errors have already been fixed as part of #3041687: Deprecated Unicode::* methods need to be replaced., so the the current patches are now obsolete.But there are now more errors reported by drupal-check:
I've updated the summary, hidden the existing patches, and set the status back to needs work.
Comment #13
Ankush_03Adding patch please review !
Comment #14
Diego_Mow CreditAttribution: Diego_Mow as a volunteer and at CI&T commentedLooks Good
Comment #15
swatichouhan012 CreditAttribution: swatichouhan012 at Valuebound for Valuebound commented@Diego_Mow Sorry to move this again in NW, i found one more deprecated code ,
------ -------------------------------------------------------------------------------------------------------------------
Line src/Plugin/Mail/SMTPMailSystem.php
------ -------------------------------------------------------------------------------------------------------------------
488 Call to deprecated constant FILE_EXISTS_REPLACE: Deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
\Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE.
i have created a patch to fix this kindly review,
Comment #16
Diego_Mow CreditAttribution: Diego_Mow as a volunteer and at CI&T commentedGood catch swatichouhan012.
I checked the patch and continue to look ok for me.
Comment #17
Diego_Mow CreditAttribution: Diego_Mow as a volunteer and at CI&T commentedComment #18
rivimeyComment #19
rivimeyComment #20
wundo CreditAttribution: wundo at Chuva Inc. for Galoa Science commentedPatch needs re-roll
Comment #21
Diego_Mow CreditAttribution: Diego_Mow as a volunteer and at CI&T commentedGenerated new patch considering code from patches #13 and #15 and also some new CR items to guarantee everything.
Comment #23
rivimey@Diego
In changing smtp_install() wouldn't it be better to cache the return value of \Drupal::messenger() and call addMessage from that?
If you're going to change Smtp_send_queue queuer please lets have a meaningful docblock, especially which indicates why the function exists. For example: "Add the outgoing mail to the SMTP Mail Queue."
Ditto for _smtp_mailer_send()
Question, not bug: for D9 compatibility, should file_save_data be rendered using a Drupal service instead?
Comment #24
rivimeyFixed the cause of the test error: the tester had been changed to expect smtpConnect() but the string is still SmtpConnect() and that is correct.
Also fixed the point about smtp_install() I mentioned above.
Also fixed the text of that message, which was still stuck in D7 menu terminology.
Comment #25
Diego_Mow CreditAttribution: Diego_Mow as a volunteer and at CI&T commentedTested and worked fine here.
Comment #26
BerdirThe .info.yml file is missing the new core_version_key, see https://www.drupal.org/node/3070687.
Comment #27
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedAdded the core version key in the info.yml file. Here is the updated patch.
Comment #28
BerdirI think this constant requires 8.7, so we should use ^8.7.7 || ^9 and remove the core: 8.x key.
Comment #29
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedUpdated patch please review!
Comment #30
rivimeyComment #32
japerry