[meta] Add support for Drupal 10

Created on 16 June 2022, almost 3 years ago
Updated 18 February 2023, about 2 years ago

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 β†’ .

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    The MR and patch are not in sync, it looks like the patch is the most up to date, can we close the MR to avoid further confusion?

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Fixes #11, I'm still unsure if the failures need the expected values updated or they're highlighting an actual bug.

    Also changed some issets to null coalescing.

  • The last submitted patch, 14: 3288663-14.patch, failed testing. View results β†’
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Status changed to Needs review about 2 years ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    I'm assuming that the expected strings should be updated as we're following the deprecation changes correctly. We also need to fix the return type of ::mimeMailAddress as it can return an array.

  • πŸ‡§πŸ‡·Brazil renatog Campinas

    #16 seems good but is missing the composer.json

    I just saw in the #12 that the composer.json was added but as cited in the #13 we stopped using MR and used only patches. As I can see the composer.json isn't included on this patch

    I didn't saw it before and I reported it separated at ✨ Add a composer.json Fixed

  • πŸ‡§πŸ‡·Brazil renatog Campinas

    I'm including this as a "related" and I think we can merge it separated

  • Status changed to Needs work about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    I really do not like automated kitchen-sink patches like this, because they're always wrong in the details and because maintainers tend to commit them without questioning, which creates more problems for the future.

    In this case, the change:

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

    is wrong. After this patch, this module will absolutely NOT be compatible with Drupal 8 or Drupal 9.0 or Drupal 9.1.

    I would really like to have distinct patches for the several issues we have in this module related to D10 support. Specifically, for features added in Drupal core in D9, or removed from Drupal core in D10, we need to ensure that our dependencies are declared correctly and that we're not (for example) using things that are only available in D10 but claiming we're still D9 compatible.

    I'm assuming that the expected strings should be updated as we're following the deprecation changes correctly. We also need to fix the return type of ::mimeMailAddress as it can return an array.

    Yes. And the MimeMailFormatHelperTest should also be updated to test the array return type. I would actually like to refactor mimeMailAddress() because, as I have said many times previously, like many other parts of this module it's a really bad mess that tries to do too many things in one function. Having a complete set of tests allows us to do this refactoring without breaking anything.

    Also, why does the patch inject the Request into the MimeMail plugin? It's not being used anywhere ...

    As a first step here, I'd like to see a new issue for the core change https://www.drupal.org/node/3207439 which includes the test string changes and the return type change/additional test as discussed above. This also requires increasing the Drupal core version to 9.2 and dropping support entirely for Drupal 8.

    Then we can proceed to adding return types to all the test methods (not just the setUp() methods). Again, in a separate issue.

    Then we can deal with the deprecation of file_create_url(), which also needs another change in Drupal core version supported.

    The absolute last step should be changing the core version requirement to declare that this module works on D10, and we should do that only after the tests run green in Drupal 10. A new release with the D10 support can also be rolled at that point. We can do that here in this issue, but only after all the other things are fixed.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • Status changed to Active about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • Status changed to Needs review about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    The child issues have been fixed and committed, so let's see if the tests pass when we up the core version requirement and test against D10.

    • TR β†’ committed 431273a1 on 8.x-1.x
      Issue #3288663 by acbramley, TR, RenatoG: [meta] Add support for Drupal...
  • Status changed to Fixed about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Committed #22 and closing this issue because the tests now run on Drupal 10.

    If further D10-specific issues arise, please open a new issue for each.

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Thanks @TR - what's the plan for releasing this? Will there be a new alpha/beta on 1.x? Or a new branch?

  • πŸ‡΅πŸ‡ΉPortugal jcnventura

    A new release would be nice.. And considering this never left alpha, I'd think a new branch is not needed. Maybe one last alpha to iron out the D10 kinks it may still have, but then maybe a beta or rc release?

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    New release on the 8.x-1.x branch first, then open a new 2.0.x branch to make the API changes and refactoring that are necessary to keep this project moving forward. I have a few clean-up issues to open and commit before the release, but that shouldn't take more than a few days.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Maybe one last alpha to iron out the D10 kinks it may still have, but then maybe a beta or rc release?

    There are only two issues in this module which are marked as beta blockers - I think I have been pretty conservative in that regard. See https://www.drupal.org/project/issues/search?text=&projects=Mime+Mail&as... β†’

    But they have been marked that way for almost THREE YEARS, and I haven't had any participation from the community to get those finished.

    And there are also some fundamental features that have not been fully ported from D7 yet - image attachments don't fully work, for example.

    I believe in truth in advertising, and if a module is labeled 1.0 I expect it to perform its basic function. If it doesn't IMO it should be labeled an alpha or beta. I recognize that others don't see it that way, but I am not able by myself to deal with all the things that need to be fixed, and I am unwilling to deal with all the new support issues that WILL be raised by a 1.0 release that I KNOW does not work correctly.

    So I will probably make another alpha release at this point then branch off a 2.0.x and work on re-writing all the legacy code that has proven to be far more work to fix than it would be to re-write.

  • πŸ‡΅πŸ‡ΉPortugal jcnventura

    @TR You have 24K installs of this module in Drupal 8/9 sites, I don't think that anyone actually believes any of the beta blockers to be important, nor do I think that users have skipped on creating issues just because it's an alpha version.

    But you're the maintainer, and I do appreciate your work on this important module, so if you don't think it is ready for beta, then it is not ready for beta. End of discussion from my part. Fingers crossed for the alpha5 release being soon, though.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    The beta blocker is important to ME because this code desperately needs to be refactored and rewritten, and until we have tests for some of this we can't do that without breaking things and causing major regressions. No one, including me, understands a lot of this legacy code, and writing the tests for the existing methods documents and defines what those methods are intended to do. I have already done a tremendous amount of work towards that, but there are still major parts that are undocumented and untested and not-really working.

Production build 0.71.5 2024