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:

  1. 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.

  2. 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.

  3. 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

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. 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.

Issue fork htmlmail-3287920

Command icon 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

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new529 bytes

This 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.yml file 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

Bot run #127

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.9
  2. palantirnet/drupal-rector: 0.12.0

Status: Needs review » Needs work

The last submitted patch, 2: htmlmail.3.x-dev.rector.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

project update bot’s picture

Status: Needs work » Needs review
StatusFileSize
new5.18 KB
new5.01 KB

This 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.yml file 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

Bot run #139

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.24
  2. palantirnet/drupal-rector: 0.13.0
project update bot’s picture

joseph.olstad’s picture

Issue summary: View changes

These changes look reasonable, I haven't seen the bot fail yet.

rishu_kumar made their first commit to this issue’s fork.

rishu_kumar’s picture

StatusFileSize
new139.83 KB
new40.72 KB

When 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

Guillaume Aveline made their first commit to this issue’s fork.

rohan-sinha’s picture

MR on #10 works for me , issues have gone.

la vague illuminee’s picture

Sorry 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.

tr’s picture

-core_version_requirement: ^8.8.2 || ^9
+core_version_requirement: ^8.8.2 || ^9 || ^10

This 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.

rahul17’s picture

Status: Needs review » Reviewed & tested by the community

I 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.

tr’s picture

Status: Reviewed & tested by the community » Needs work

Driskell made their first commit to this issue’s fork.

maris.abols’s picture

StatusFileSize
new4.2 KB

Hi,

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.

joseph.olstad’s picture

@TR, the solution you suggested seems to be to change this:
core_version_requirement: ^8.8.2 || ^9 || ^10

to this:
core_version_requirement: ^9.3 || ^10

once 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.

salvis’s picture

Or create a 4.x branch for D10 and keep 8.x-3.x available for D8/9?

shivam_tiwari made their first commit to this issue’s fork.

shivam_tiwari’s picture

shivam_tiwari’s picture

Status: Needs work » Needs review
salvis’s picture

Version: 8.x-3.x-dev » 4.x-dev
Priority: Normal » Major
Status: Needs review » Needs work

I 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.

ruscoe’s picture

StatusFileSize
new777 bytes

Patch for comment #13 made against the 4.x-dev branch.

sundhar’s picture

After using this issue repo
D10 site throws

TypeError: Drupal\htmlmail\Plugin\Mail\HtmlMailSystem::__construct(): Argument #10 ($mimeTypeGuesser) must be of type Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface, Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser given, called in /modules/custom/htmlmail/src/Plugin/Mail/HtmlMailSystem.php on line 147 in Drupal\htmlmail\Plugin\Mail\HtmlMailSystem->__construct() (line 109 of modules/custom/htmlmail/src/Plugin/Mail/HtmlMailSystem.php).
sundhar’s picture

Oh! mistakenly tested 8.x-3.x
3287920-automated-drupal-10 branch doesn't show that issue

colan made their first commit to this issue’s fork.

colan’s picture

I merged MR !2 into !5 targetting 4.x, and fixed the core_version_requirement conflict, 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.

colan’s picture

Component: Code » Module compatibility
Status: Needs work » Needs review

Assuming 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.

chadmandoo’s picture

StatusFileSize
new5.19 KB

I 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.

colan’s picture

@chadmandoo: Please push to the MR as well so that it stays up-to-date. Thanks!

hemangi.gokhale’s picture

The 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

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

MR 5 by @colan is good

we're using it like this:

dbd771f3

in the repositories section of the composer.json:

        "0": {
            "type": "package",
            "package": {
                "name": "drupaloverride/htmlmail",
                "version": "dev-1",
                "type": "drupal-module",
                "dist": {
                    "type": "zip",
                    "url": "https://git.drupalcode.org/api/v4/projects/project%2Fhtmlmail/repository/archive.zip?sha=dbd771f3"
                }
            }
        },

Then:
composer require drupaloverride/htmlmail

  • colan committed dbd771f3 on 4.x
    Issue #3287920: Enabled GitLab CI so we can see test results in GitLab...

  • 29af8565 committed on 4.x
    Issue #3287920 by colan: Merge branch '3287920-automated-drupal-10' into...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

MR 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:

  1. mimemail 64000+ installs , 24000+ installs for Drupal 8 and about 40,000 installs for Drupal 7.
  2. Swiftmailer 27,400 + installs deprecated by symfony_mailer
  3. Symfony_mailer 23000+ installs
  4. in last place: htmlmail
  5. 21,040 installs, 3000 installs on Drupal 8/9/10, 17000 on D7

joseph.olstad’s picture

Here'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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.