Automated Drupal 10 compatibility fixes

Created on 16 June 2022, over 2 years ago
Updated 12 March 2023, almost 2 years ago

Manual UI Testing Steps for Pathologic

1. Enabl the module on D10 using the latest patched version
2. Add a new "base path" for the site at admin/config/content/pathologic
3. Add Pathologic to the text format filters on Drupal core's "Basic HTML" text format.
4. Create a "Basic page" node with a link using the base path added in Step 2.
5. Verify that the text format filter correctly rewrites the path to match the testing site domain when viewed.
6. Verify that a text-format specific setting also works.

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

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

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Just amplifying what others have said before: thanks for this module, which has wide adoption! A soft commit on the default branch for testing would be great, and a release would be even better! (Given the limited amount of change involved for D10, I don't think there is much need to wait to do a release.)

  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Thanks, Mark, for the patch in #14
    Testing with drupal:filter and CKEditor 5 and CKEditor 4

  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Had Real physical testing round for Pathologic 1.0.x-dev with Drupal ~10 and Drupal ~9
    With CKEditor 5 and CKEditor 4 drupal:filter

    Attached the steps for the testing setup
    Real-physical-testing-round-for-pathologic-1-0-x-dev--with-d10-and-d9.zip β†’

    Build Drupal ~10.0 sandbox test site and have Drush ~11.0

    mkdir -p /var/www/html/sandboxes
    composer create-project drupal/recommended-project:~10.0 /var/www/html/sandboxes/drupal10pathologic_1__test
    cd /var/www/html/sandboxes/drupal10pathologic_1__test/
    composer require drush/drush:~11.0;
    

    Change minimum stability to dev for testing on the recommended Drupal 10 project template

    composer config minimum-stability dev
    

    Add CKEditor 4 for testing only

    composer require drupal/ckeditor:~1.0
    

    Add the Pathologic module

    mkdir -p /var/www/html/sandboxes/drupal10pathologic_1__test/web/modules/contrib
    cd /var/www/html/sandboxes/drupal10pathologic_1__test/web/modules/contrib/
    git clone --branch '8.x-1.x' https://git.drupalcode.org/project/pathologic.git
    

    Git Apply the patch.

    cd /var/www/html/sandboxes/drupal10pathologic_1__test/web/modules/contrib/pathologic/
    wget https://www.drupal.org/files/issues/2022-12-02/3289033-drupal-10-compatibility-14.patch
    git apply 3289033-drupal-10-compatibility-14.patch
    

    Change file/directory mod and ownership of files:

    cd /var/www/html/sandboxes/drupal10pathologic_1__test/
    sudo chmod 775 -R .;sudo chown www-data:$USER -R .;
    

    Install with Drush

    ./vendor/drush/drush/drush site:install standard --yes --site-name="Pathologic 1.0.x-dev - Real physical testing with Drupal ~10" --account-name="webmaster" --account-pass="d" --account-mail="test@drupal.org" --db-url="mysql://root:123___@localhost/sandboxes_drupal10pathologic_1__test" -vvv ;
    
    ./vendor/drush/drush/drush pm:enable pathologic
    ./vendor/drush/drush/drush pm:enable ckeditor
    

    Rebuild the cache:

    sudo chmod 775 -R .;sudo chown www-data:$USER -R .;
    ./vendor/drush/drush/drush cache:rebuild
    

    Open a browser and change the address to: http://localhost/sandboxes/drupal10pathologic_1__test/web/

  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Tested, Working well.
    Ready to commit #14 and ready for a release.

  • Status changed to Fixed almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    The original creator of this fundamental Drupal module, Garrett Albright, added me as a maintainer, after I reached out about ongoing support. I've committed the D10-compatibility fix to the 8.x-1.x branch. Marking this issue as "Fixed."

    Next step: cutting a new release.

  • πŸ‡ΊπŸ‡ΈUnited States Garrett Albright

    Yep. I'm sorry, everyone, that I haven't kept up on this module for the past half decade, but I just don't work with Drupal that much anymore and don't have much interest in maintaining code projects in my free time anymore either. Thanks to Mark for picking up my slack and I'm glad to see this module is still proving useful to people.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    @Garrett Albright: Indeed, thanks for this extremely useful module! Glad I was able to help it with a D8/D9 release, and give it a burst of attention at the time. No need to apologize for moving on. Grateful you contributed all your work when you did!

    Welcome aboard, @mark_fullmer! I just was pulling a bunch of git repos on my machine and noticed a commit in here, which I didn't expect. ;) Glad to see why. Thanks for stepping in to help!

    It's too bad this is the only change to the module, and the only thing that breaks D8 compatibility:

    -    $new_parts = parse_url(file_create_url(\Drupal::config('system.file')->get('default_scheme') . '://' . $parts['path']));
    +    $uri = \Drupal::config('system.file')->get('default_scheme') . '://' . $parts['path'];
    +    $new_parts = parse_url(\Drupal::service('file_url_generator')->generateAbsoluteString($uri));
    

    but oh well, life moves on. πŸ˜‰ D8 is EOL, so we might as well cut a new release for D9/D10.

    I wonder if we should call that 2.0.0-alpha1 and switch to semver now, instead of 8.x-1.0-alpha4 or something. πŸ˜…

    Regardless, I think it'd be wise to sort out πŸ› Internal URL handling (language prefixes, base://, ...) Needs work and πŸ› 8.x-1.0-alpha3 breaks images in multi-language sites. Fixed before we really call this "stable".

    Probably we should move this to a new issue about the next release...

    Although I'm glad to see the tests changed to use assertEquals(), I found the original formatting a lot easier to read and make sense of. What do you think about reverting that (and using assertEquals()) before we cut a new release?

    Thanks again!
    -Derek

  • Status changed to Needs review almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Yeah, honestly, I think we should make a new 2.0.x branch with what you committed, revert the commit to 8.x-1.x branch, and leave the possibility of a 8.x-1.0-whatever release that fixes the known bugs for people still stuck on D8, and allow us to move to semver for everything else D9+ moving forward. Sound good?

    Thanks to everyone who worked on this issue doing reviews and testing! Nice to see so many folks interested in this module...

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Thanks, Derek, for this! I wholeheartedly agree that this is an opportune time to switch to semver and make the D10 compatible version a new major version release, and that it would be sensible to have the first release be 2.0.0-alpha1, given the other issues you flagged.

    The main implication with this change would be that sites in the process of updating to Drupal 10 would now need to manually change their Composer requirement to some variation of "drupal/pathologic: ^2", rather than automatically getting a compatible version with composer update. But that's standard practice, so we don't need to call out anything in particular.

    I also agree that the syntax in the tests should be switched to multi-line parameters.

    As far as reverting this commit for the 8.x-1.x branch, I suggest we create a new commit that performs that, rather than rewriting commit history, just for transparency.

    I'll wait a few days for response/action from the community before taking initiative myself.

    • dww β†’ committed fda6a37c on 8.x-1.x
      Revert "Issue #3289033 by taniachque, mark_fullmer, reenaraghavan,...
  • Status changed to Fixed almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Created 2.0.x branch with the D10 port committed, reverted the commit from 8.x-1.x branch, created a 2.0.x-dev β†’ release, and pushed commit faea7caf to fix the test formatting in the 2.0.x branch. Not totally sure why d.o didn't see the follow-up commit, since it had the right issue number. Maybe it's because the 2.0.x release didn't yet exist and d.o didn't know it should care. ;)

    Anyway, I think this issue is now done. Let's discuss future release plans at 🌱 Plan for new Pathologic releases Active .

    Thanks again!
    -Derek

  • πŸ‡§πŸ‡ͺBelgium svendecabooter Gent

    Could you also create a release for the 2.0.x branch, that would support Drupal 10?

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Could you also create a release for the 2.0.x branch, that would support Drupal 10?

    A new alpha release from the 2.0.x branch is called out in 🌱 Plan for new Pathologic releases Active as part of the plan, and I agree that this would is valuable and time-sensitive for people looking to update to D10, and that first alpha release doesn't need to wait until the other fixes called out are resolved. I'm a co-maintainer, but it looks like don't have the permission to create releases; that said, I think you can expect a new release pretty soon!

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

  • Status changed to Fixed almost 2 years ago
  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Tested the dev version. Good to release.

Production build 0.71.5 2024