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

Periodically patches will be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted simply close this issue (any status besides Active, Needs review or Needs work) or remove the "ProjectUpdateBotD10" tag from the issue.

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 or Needs work) 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.

  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 don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD10" tag from the issue.

    You can use Drupal Rector yourself to make these patches.

    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 or Needs work) 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 may be useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the patch in the comment by Project Update Bot.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.

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 Infrastructure project issue queue using the component “Bot: Drupal Rector”.

Issue fork diff-3296959

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
new1.21 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

Status: Needs review » Needs work

The last submitted patch, 2: diff.1.x-dev.rector.patch, failed testing. View results

kristen pol’s picture

Issue summary: View changes
Status: Needs work » Active

The dev branch is already compatible with Drupal 10 but moving this to Active for now in case there are more bot patches. This module also still needs a release for the Drupal 10 version.

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

balintpekker’s picture

Fixed a couple of issues reported by drupal-check as well as the tests. Intentionally missed out ProphecyTrait as it breaks PHP7.3/PHPUnit8 compatibility. If the maintainers decide that is OK and they want to drop support for these, of course it can be included.

nkoporec’s picture

Status: Active » Needs work

Found some minor things, so setting as needs work. I think we should only focus on D10 compatibility changes and not phpstan issus, they can be tracked in a separate issue, so its easier to review.

balintpekker’s picture

Status: Needs work » Needs review
nkoporec’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, setting as RTBC.

smustgrave’s picture

Wondering if we could get a release with this fix? We use diff in another contrib module and are blocked from updating. Thanks!

psingh10’s picture

StatusFileSize
new584 bytes

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 12: 3296959-drupal-10-compatibility.patch, failed testing. View results

balintpekker’s picture

Status: Needs work » Reviewed & tested by the community

Setting back to RTBC as the patch provided in #12 is already part of the MR with backwards compatibility, and tested.

mglaman’s picture

Status: Reviewed & tested by the community » Needs work

I left some feedback. Most of this isn't needed, but I am concerned on $format->name change. Given what was said in this issue, it should be crashing. And the code in this MR shouldn't work either (it's not a field value.)

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

heddn’s picture

Status: Needs work » Needs review

This passes green on local. Let's see how the testbot likes things.

heddn’s picture

This passes green on the testbot for 10.x and 9.4. LGTM.

berdir’s picture

As discussed, after the cleanup what's left here is fixing a single test that we previously didn't notice because when the already existing D10-compatible version was created as part of #3264928: Add support for Drupal 10, classy was still in core.

I left a comment about the changes there, feel free to either commit or make some changes first, it's pretty minor.

heddn’s picture

StatusFileSize
new2.39 KB

I did research and found that #2718381: Incorrect Breadcrumb for Markdown diff added the extra breadcrumb asserts. But they aren't really needed so I've removed it to make the tests less brittle. The other item that slipped in since this was re-rolled is a change that seems to impact the trimming logic in DiffPluginTest. I got tests passing by altering the test. It seems to be still testing what it was before, but I'm not really sure why the line numbers are all off. A bit disconcerting so leaving this up for review for other's feedback.

berdir’s picture

Fine by me, but the tests didn't run as it's the wrong php version.

Default configurations should be updated, I do prefer to do patch testing on the lowest supported version and have a weekly d10 test. It's IMHO more likely to break d9 than d10 at this point

heddn’s picture

We have a situation where on D10, there are only 4 rows and in D9, there are 5 rows. What changed here?

berdir’s picture

No idea, assuming it can be reproduced locally, you need to run the test and dump the exact output you get and compare it, seems to be testing a very specific thing with empty lines, possibly the test tools we use changed?

heddn’s picture

Status: Needs review » Needs work

I hunted and found that https://www.drupal.org/node/3299678 is what is breaking things. The new diff engine used by core 10.1+ shows slightly different amounts of context data then prior to that commit. Let's fix that.

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new2.97 KB
new1.39 KB

  • heddn committed 0ff9ea08 on 8.x-1.x
    Issue #3296959 by heddn, Berdir: Automated Drupal 10 compatibility fixes
    
berdir’s picture

+1 if that comes back green.

heddn’s picture

Status: Needs review » Fixed

Thanks everyone for your help and patience here. This is now landed and default CI test runner configuration adjusted to default to 9.5 on issue/commit and 10.1.x for weekly.

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

This fix should go into a tagged release. I just hit this on the latest tagged release 1.1.0 from 2 years back