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:
- 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.
- 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.
- 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
- Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | Screen Shot 2023-11-20 at 12.17.49 PM.png | 522.66 KB | ankithashetty |
| #34 | Screen Shot 2023-11-20 at 12.17.31 PM.png | 389.83 KB | ankithashetty |
| #34 | Screen Shot 2023-11-20 at 12.18.06 PM.png | 238.29 KB | ankithashetty |
| #34 | Screen Shot 2023-11-20 at 12.17.59 PM.png | 448.59 KB | ankithashetty |
| #34 | Screen Recording 2023-11-20 at 12.17.05 PM.mov | 4.38 MB | ankithashetty |
Issue fork simple_image_rotate-3298061
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
Comment #2
project update bot commentedThis 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 this patch makes this module compatible with Drupal 10! 🎉
This patch updates the
info.ymlfile 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
This patch was created using these packages:
Comment #3
akshaydalvi212 commentedHello,
I will review whether the patch makes the module compatible with drupal 10.
Comment #4
akshaydalvi212 commentedHello,
After applying the patch, the module gets installed successfully on drupal 10.

and we get an option as "Enable rotate icon" in the configuration of the image field.

But the icon to rotate the image is missing, hence shifting the issue to Needs work.

Thanks and regards.
Comment #5
reenaraghavan commentedComment #6
reenaraghavan commentedCouldn't fix the issue, needs work.
I have attached the screenshot of Drupal 9 which contains the rotate button.
Comment #7
project update bot commentedUpdating bot issue summary.See #3313904: Update project bot templates for RTBC status support and human interaction tips
Comment #8
tjtj commentedIn D9 upgrade status, I get
web/modules/custom/simple_image_rotate/simple_image_rotate.module 184 Call to deprecated function file_move(). Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use Drupal\file\FileRepositoryInterface::move() instead.
The patch did not apply.
Comment #9
tjtj commentedPlease fix this for D10 and issue a release. This simple module is really useful and important when importing images from others.
Comment #10
tjtj commentedPlease fix this for D10!
Comment #11
mukesh88 commentedPatch created for D10 tjtj
Comment #12
mukesh88 commentedComment #13
tjtj commentedmukesh88: Which version does this patch?
Comment #14
tjtj commentedStill does not work.
1. The patch is strange in that it is applied from the Web directory, not the directory of the module itself.
2. It applied to the release 2.1.0 version.
3. The icon appears and rotates the thumbnails
4. BUT it throws a php error when the content page is saved:
Comment #15
mukesh88 commentedtjtj i have created patch for 2.1.x version and patch is created to change the path of module itself and i have checked after save node i amn't getting any error also checked the FileSystemInterface class is already include in 2.1.x version. attached screenshot of node edit and node image rotate
Comment #16
tjtj commentedAlso, I tried to edit composer.json to use 2.1.0, and wegan's patch plugin, and the lenient plugin, but that threw a gazillion composer update errors, so I just did a manual install and patch.
[~/www/web/modules/contrib/simple_image_rotate]# patch -p1 < 3298061-12.patch
patching file js/simple_image_rotate.js
Hunk #1 FAILED at 19.
Hunk #2 succeeded at 36 (offset -1 lines).
1 out of 2 hunks FAILED -- saving rejects to file js/simple_image_rotate.js.rej
patching file simple_image_rotate.info.yml
patching file simple_image_rotate.libraries.yml
patching file simple_image_rotate.module
Hunk #1 succeeded at 65 (offset -3 lines).
Hunk #2 FAILED at 193.
1 out of 2 hunks FAILED -- saving rejects to file simple_image_rotate.module.rej
This (line 2) was not in the file:
- $image = $(this).closest(".image-widget").find("img")
- .add($(this).closest(".media-library-add-form li").find('[data-drupal-selector="edit-preview"] img'));
Comment #17
mukesh88 commentedThis 2 line was not in js file when i was created patch. After cloning 2.1.x branch and recreate patch
Comment #18
tjtj commentedThe patch applied. But when I added the rotate box option to the image field, it does not appear when I make a new instance of that content type.
See two attached images
Comment #19
tjtj commentedSee two images
Comment #20
mukesh88 commented@tjtj I checked the new instance of content type and used existing image field and added image rotate box and create content with new content type image is rotate. see the attached images.
Comment #21
tjtj commentedThen please issue this so I need not jump through patch hoops in my composer file.
Comment #22
tjtj commentedI cloned the git repository and changed info.yml for D10. But when installed, and box checked to display the rotate icon, it is not displayed. I tried it on 2 sites.
Comment #23
mgstablesI used patch #17 on a downloaded version 2.1.1-alpha1 (manual by hand)
I also changed line 197 in simple_image_rotate.module from:
if (file_move($file, $new_uri, FileSystemInterface::EXISTS_ERROR)) {to:
if (\Drupal::service('file.repository')->move($file, $new_uri, FileSystemInterface::EXISTS_ERROR)) {Module installed and tested on the imagefield of "article".
The icon was visible and usable and the image rotated.
Drupal 10.0.8
PHP 8.1.6
Comment #24
tjtj commentedMGStables: Yes that worked perfectly. Thank you.
Now someone please release the new version.
Comment #26
jaime@gingerrobot.com commentedI added #17 and #23 to the git branch. I also added a composer.json file so that I could import it directly into my installation with composer.
Then further down:
Comment #27
mgstablesThanks jaime@gingerrobot.com for this git version.
I've tested the git version from #26 and it didn't work. So I compared it with my self-patched version that did work.
In simple_image_rotate.module on line 74, an important element has been removed. (Maybe accidentally removed a line too much?)
$elements = &$field_widget_complete_form['widget'];Now this is:
If I put this line back, it works again.
Drupal 10.1.2
PHP 8.1.6
Comment #30
markus_petrux commentedHello,
I committed the fix to set the value for $elements, see #27
So back to ready to be reviewed.
Best regards,
Marc
Comment #31
mgstablesLatest git version works perfectly. The icon was visible and usable and the image rotated.
Drupal 10.1.4
PHP 8.1.6
Comment #32
sagesolutions commentedYou should simplify the once() function override in MR !4
Before:
$(".rotate-icon").once().click(function (e) {After:
$(once('rotate', '.rotate-icon', context)).on('click', function (e) {Comment #33
ankithashettyComment #34
ankithashettyUpdated the MR as suggested in #32.
Tested the change on Drupal 10.1.7-dev, works as expected.
Recording -
https://www.drupal.org/files/issues/2023-11-20/Screen%20Recording%202023...
Actual image -


After rotating -


Comment #35
sagesolutions commentedLooks good, just one spelling typo and its ready to go
In the composer.json file, change
"GPL-2.0-or-latery"to"GPL-2.0-or-later"Comment #36
ankithashettyAddressed the change requested in #35, thanks!
Comment #37
sagesolutions commentedThanks for the fix @ankithashetty
Comment #38
afagioliFind this fix with https://www.drupal.org/project/simple_image_rotate/releases/2.3.0-alpha1
Thanks for contributing
Comment #39
afagioliComment #41
afagioli