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 svg_image-3299276

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
new2.96 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
atul_ghate’s picture

Assigned: Unassigned » atul_ghate
Issue summary: View changes

Hi,
i will review this patch.

atul_ghate’s picture

StatusFileSize
new3.86 KB

Verified patch #2 on Drupal 10 Patch applied successfully

Testing Steps:

1. Install drupal 10
2. clone the branch on drupal (8.x-1.x-dev) on drupal 9 and checked deprecated code uisng upgrade status module
3. Added some changes in info.yml file and provide a patch as said upgrade status module and Applied patch #4 and #2 again checked
deprecated code on drupal 9
4. Then installed module on drupal 10
5. check module installed sucsessfully or not

module has been installed succesfully but after installing module on my drupal 10 site ,site not working properly showing errors in recent log messages, it can be moved to needs work.
thanks and regards

jrglasgow’s picture

Status: Needs review » Reviewed & tested by the community

patch in #4 works for me

Webbeh’s picture

Assigned: atul_ghate » Unassigned
Status: Reviewed & tested by the community » Needs work

module has been installed succesfully but after installing module on my drupal 10 site ,site not working properly showing errors in recent log messages, it can be moved to needs work.

Given #4, moving to NW. #4, can you please provide the error messages? That would be very helpful.

ameymudras’s picture

Status: Needs work » Needs review
StatusFileSize
new8.43 KB
new5.81 KB

There were 2 issues in the above patch #4
1. The manage display page throwing website encountered error. Logs displayed following error

ArgumentCountError: Too few arguments to function Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter::__construct(), 9 passed in /app/modules/contrib/svg_image/src/Plugin/Field/FieldFormatter/SvgImageFormatter.php on line 49 and exactly 10 expected in Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter->__construct() (line 75 of /app/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php)

2. The code was using /Drupal calls and not dependency injection

I have fixed these issues along with other coding standard issues

project update bot’s picture

kristen pol’s picture

Issue summary: View changes
Issue tags: +Needs manual testing

@ameymudras Thanks for testing and updating the patch and providing an interdiff.

This module needs functional testing on Drupal 10. Adding general instructions:

https://www.drupal.org/community-initiatives/contribution-events-initiat...

nx2611’s picture

Status: Needs review » Reviewed & tested by the community

This is working for me in Drupal 9.5 and 10.1. Here are the steps for manual testing:

  1. Create a new gitpod.io instance
  2. Install and enable the module
  3. Go to Article > edit field_image
  4. Under the field "Allowed file extensions", add "svg"
  5. Create a new Article and upload an SVG image
  6. Try the responsiveness of the SVG. It doesn't work yet.
  7. Install and enable SVG Image Responsive
  8. Reload the article that was just created. The SVG should become responsive.
kristen pol’s picture

Issue tags: -Needs manual testing

Thanks for the updated patch and testing. Removing testing tag.

I took a quick look at the interdiff and nothing jumped out at me so keeping as RTBC.

prudloff’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new8.95 KB
new477 bytes

ConfigManagerInterface::findConfigEntityDependents() is deprecated so I updated #7 to replace it.

yashingole’s picture

StatusFileSize
new32.6 KB
new25.51 KB

I have reviewed and checked Patch #12 this works for drupal 9.4 and drupal 10.0. and 10.0.1
Screenshots of the compatibility on 9.4 and the Uploaded svg image on 10 have been attached for reference:

gaurav-mathur’s picture

varify patch #2 and #4 module succesfully installed but site is not working and log displayed errors ,it can be moved to need work and need testing for drupal 10 .

Webbeh’s picture

Status: Needs review » Needs work

From #14, marking as Needs Work, although we do need logged errors of what actually was shown to diagnose the issue.

Removing images from the attachments, as those are not necessary.

j-vee’s picture

Status: Needs work » Reviewed & tested by the community

Can't reproduce issues mentioned in #14, the patch in #12 works fine and SVG images & related functionality works as before. I think this is ready to be released especially with D10 being out.

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

smustgrave’s picture

Hello wonder if this can get committed for a D10 release now that 10 is out.

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

Pretty sure that the usage of the file_url_generator service makes this no longer compatible with Drupal <9.3, as it was introduced in that version.

smustgrave’s picture

My suggestion would be to start a new branch supporting 9.4 and 10

martijn de wit’s picture

@imyaro Do you have time to work on this module or do you need some (new) co-maintainers?

danflanagan8’s picture

Status: Needs work » Needs review
StatusFileSize
new9.78 KB
new2.35 KB

Here's an update patch that corrects the core_version_requirement to make it 9.3 and up. I also removed code related to cache context that is no longer needed as of #2669074: Convert file_create_url() & file_url_transform_relative() to service, deprecate it. That was a workaround before the url generator service was in here.

My suggestion would be to start a new branch supporting 9.4 and 10

At this point 9.2 is no longer supported so I don't think a new branch is required here.

daniel_j’s picture

StatusFileSize
new12.07 KB

The 'core' key must be removed if support for Drupal < 8.7 is dropped. The attached patch does this. It also uses dependency injection for the FileUrlGenerator service rather than calling \Drupal::service().

danflanagan8’s picture

StatusFileSize
new4.39 KB

The 'core' key must be removed if support for Drupal < 8.7 is dropped.

I just learned that about an hour ago!

The updates in the latest patch look good to me. I haven't tested it though. Here's the interdiff between 22 and 23.

anybody’s picture

Priority: Normal » Major

Drupal 10 is out, so this is important. Any maintainer plans here?

sarikawirtz’s picture

Assigned: Unassigned » sarikawirtz
sarikawirtz’s picture

Status: Needs review » Needs work
Issue tags: -ProjectUpdateBotD10, -Drupal 10 compatibility +ContributionWeekend2023
StatusFileSize
new31.86 KB

#23 Installed and enabled module on Drupal10. Applied patch. Allowed field to accept "SVG" image but did not work for me. after uploading sgv image got an error(
svg-error.png)

In log error: Entity view display 'node.article.default': Component 'comment' was disabled because its settings depend on removed dependencies.

sarikawirtz’s picture

Assigned: sarikawirtz » Unassigned
martijn de wit’s picture

@Sarika Wirtz can you post also your image field widget settings form?
Did you install and test it on a clean D10 installation ?

poker10’s picture

I tried to repeat the steps from #27, but cannot reproduce the problem.

Clean D10 installation, installed and enabled this module with the patch applied. Allowed field to accept the "SVG" format. Created new node and uploaded SVG image without any problems. The node detail page is displayed correctly with the SVG image.

Also I suppose we should leave the tags here just in case the bot comes with something new (or the maintainer should decide if/when to remove that tag).

danflanagan8’s picture

Status: Needs work » Needs review

This should be at NR. The errors in #27 appear unrelated to this module and it should not have been kicked back to NW. It would be great if someone who has tested (@poker10?) would RTBC this.

sarikawirtz’s picture

Assigned: Unassigned » sarikawirtz

As @Martijn de Wit said. I installed fresh installation of Drupal10.

sarikawirtz’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -ProjectUpdateBotD10, -Drupal 10 compatibility

As @Martijn de Wit said. I installed fresh installation of Drupal10. Installed module. Applied patch, allowed field to accept svg and I must say it's working perfectly fine. I can not reproduce my own error anymore. moving to RTBC.

sarikawirtz’s picture

sarikawirtz’s picture

@poker10 By mistake i removed your tag. Added them again. My apologies.

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

grevil’s picture

RTBC +1. Couldn't find any missing deprecation errors, using the upgrade_status module and PHPStan. Installs successfully under Drupal 10.

I closed MR 13 for visibility's sake (since it was on the wrong issue fork branch). Removed patch #12 from "3299276-automated-drupal-10", applied patch #23 by @daniel_j to branch "3299276-automated-drupal-10" and opened an MR for easier review!

anybody’s picture

Assigned: sarikawirtz » Unassigned

Thank you for this review and cleanup @Grevil! Also confirming RTBC! :)

Maintainers?

nagy.balint’s picture

I sent a mail through contact form to the maintainer.

le72’s picture

This is the one of few modules which prevent our upgraded to D10!
Please add a new version.

asterovim’s picture

I can confirm, it's work ! thanks.

imyaro’s picture

Assigned: Unassigned » imyaro

Checking patch, will do a release soon.
Thanks everyone for participating

  • imyaro committed abcd2997 on 8.x-1.x authored by Grevil
    Issue #3299276: Automated Drupal 10 compatibility fixes
    
imyaro’s picture

Great job!
Merged. Release coming soon.

imyaro’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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