Problem/Motivation
Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 10.
To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects
Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.
The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.
Proposed resolution
You have a few options for how to use this issue:
- Accept automated patches until this issue is closed
If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.
As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.
Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.
- Leave open but stop new automated patches.
If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.
- Close it and don't use it
If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.
If the issue is reopened, then new automated patches will be posted.
If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.
Remaining tasks
Using the patches
- Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
- Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.
Providing feedback
If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue.
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | mimetypeguesser.diff | 5.19 KB | chadmandoo |
| #24 | htmlmail-uasort-3287920-24.patch | 777 bytes | ruscoe |
| #17 | htmlmail_drupal10_support.patch | 4.2 KB | maris.abols |
| #9 | htmlmail-after-MR.png | 40.72 KB | rishu_kumar |
| #9 | htmlmail-after-patch.png | 139.83 KB | rishu_kumar |
Issue fork htmlmail-3287920
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
project update bot commentedThis is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.12.0, cannot fix all Drupal 10 compatibility problems.
This patch does not update the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #4
project update bot commentedThis is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.13.0, cannot fix all Drupal 10 compatibility problems.
This patch does not update the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #5
project update bot commentedUpdating bot issue summary.See #3313904: Update project bot templates for RTBC status support and human interaction tips
Comment #6
joseph.olstadThese changes look reasonable, I haven't seen the bot fail yet.
Comment #9
rishu_kumar commentedWhen I apply #2 patch.
Patch apply cleanly but I got 2 errors and 1 warning(see attached screenshot) when HTML Mail module check on Upgrade Status module.
So, I create MR for that.
Please review this MR.
Thanks
Comment #11
rohan-sinha commentedMR on #10 works for me , issues have gone.
Comment #12
la vague illuminee commentedSorry for the multiple push. I squashed my commits into one.
Their was an issue with a deprecated function call "system_sort_modules_by_info_name" (see https://www.drupal.org/node/3225999) fixed in the branch.
Comment #13
tr commentedThis is wrong. Just as one example, it is incompatible with this change:
The function system_sort_modules_by_info_name() is deprecated.
because that change will break this module if installed on D8.8.2, D8.9, D9.0, D9.1, or D9.2.
Rather than spend time trying to port this module to D10 when it doesn't even work properly in D9, I would like to see get community help for a long-term solution. Please comment in #3339287: The future of the HTML Mail module if having HTML mail support in Drupal 10 is important to you.
Comment #14
rahul17 commentedI have tested MR in #10 with D9 and D10 both, working fine for me and making module D10 compatible. Upgrade status is also showing no error found.
Moving this to RTBC for D10 compatible stable release.
Comment #15
tr commentedComment #17
maris.abols commentedHi,
Is it still possible to release Drupal 10 version? Here is the patch with changes I saw that was needed. In our case we just need to upgrade whole project to Drupal 10 and moving functionality to mimemail module is not reasonable.
Comment #18
joseph.olstad@TR, the solution you suggested seems to be to change this:
core_version_requirement: ^8.8.2 || ^9 || ^10to this:
core_version_requirement: ^9.3 || ^10once this change is made to the merge request htmlmail.info.yml file, I think we can put this back to RTBC
as for the module as a whole, it would be good to merge the upgraded code which will allow people to swallow moving to another mail solution some time after their D10 upgrade.
Lets make the transition to D10 a bit easier for people, as it's already a significant upgrade to deal with.
With that said, I don't see why we have to restrict ourselves and others to only one possible mail solution regardless of the obvious benefits of that there's also some discomfort involved in switching.
Beside that, I haven't looked at all the positives and negatives in comparison to symfony mailer. Does the symfony mailer support theming in a friendly way as this one does? Not sure.
Comment #19
salvisOr create a 4.x branch for D10 and keep 8.x-3.x available for D8/9?
Comment #21
shivam_tiwari commentedComment #22
shivam_tiwari commentedComment #23
salvisI sympathize with #17 and #18, and I've created a new branch 4.x for D10 compatibility.
This issue is a mess. Please provide a combined patch including #4, #12, #16, and (if possible) remove the guessMimeType() hack, against 4.x-dev.
Comment #24
ruscoe commentedPatch for comment #13 made against the 4.x-dev branch.
Comment #25
sundharAfter using this issue repo
D10 site throws
Comment #26
sundharOh! mistakenly tested 8.x-3.x
3287920-automated-drupal-10 branch doesn't show that issue
Comment #29
colanI merged MR !2 into !5 targetting 4.x, and fixed the
core_version_requirementconflict, setting it to D9 and D10 as per #18. Setting it for D10 only is a bad idea because it requires folks to upgrade Drupal core and this contrib module at the same time, which I don't recommend.Comment #30
colanAssuming there are no other problems, MR !5 is good to go. Please review.
Maintainers: If you'd like help with getting this out (merging & cutting a new release), please add me as a co-maintainer; I'll get it done.
After this gets in, we really should focus on #3339287: The future of the HTML Mail module next.
Comment #31
chadmandoo commentedI am getting the following error:
TypeError: Drupal\htmlmail\Plugin\Mail\HtmlMailSystem::__construct(): Argument #10 ($mimeTypeGuesser) must be of type Symfony\Component\Mime\MimeTypesInterface, Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser given, called in /var/www/html/docroot/modules/contrib/htmlmail/src/Plugin/Mail/HtmlMailSystem.php on line 147 in Drupal\htmlmail\Plugin\Mail\HtmlMailSystem->__construct() (line 109 of /var/www/html/docroot/modules/contrib/htmlmail/src/Plugin/Mail/HtmlMailSystem.php).
I am trying to supply a patch that will fix this issue.
Comment #32
colan@chadmandoo: Please push to the MR as well so that it stays up-to-date. Thanks!
Comment #33
hemangi.gokhaleThe MR looks good! Upgrade patch got applied cleanly to 'composer require drupal/htmlmail:4.x-dev#9abc3ae', using https://git.drupalcode.org/project/htmlmail/-/merge_requests/5.diff
Comment #34
joseph.olstadMR 5 by @colan is good
we're using it like this:
dbd771f3
in the repositories section of the composer.json:
Then:
composer require drupaloverride/htmlmailComment #37
joseph.olstadMR 5 was merged in, we've been using it for quite some time.
With that said, here's the rankings in popularity for html mailers:
21,040 installs, 3000 installs on Drupal 8/9/10, 17000 on D7
Comment #38
joseph.olstadHere's a dev release
https://www.drupal.org/project/htmlmail/releases/4.0.x-dev
With that said, please consider switching to Symfony_mailer or mimemail.
There's still 21000 installs of htmlmail currently.