- ๐บ๐ธUnited States tjtj
Please fix this for D10 and issue a release. This simple module is really useful and important when importing images from others.
- Status changed to Needs review
almost 2 years ago 10:37am 27 February 2023 - ๐บ๐ธUnited States tjtj
Still does not work.
1. The patch is strange in that it is applied from the Web dorectory, 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:Error: Class "FileSystemInterface" not found in simple_image_rotate_rotate_image() (line 194 of /home/orcmaorg/public_html/web/modules/contrib/simple_image_rotat e/simple_image_rotate.modul
tjtj โ 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
- ๐บ๐ธUnited States tjtj
[~/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.rejcat simple_image_rotate.js.rej --- js/simple_image_rotate.js +++ js/simple_image_rotate.js @@ -19,14 +19,12 @@ // Leaving out absolute icon placement for now. // $('.rotate-icon').parent('.image-preview').addClass('rotate-enabled'); // Treat click on rotate image icon - $(".rotate-icon").once().click(function (e) { - + $(once('rotate', '.rotate-icon', context)).each(function () { + $(this).on('click', function(e) { // Prevent default click on rotate icon e.preventDefault(); - // Current rotate value and thumbnail image - var rotate = parseInt($(this).attr("data-rotate")); - $image = $(this).closest(".image-widget").find("img") - .add($(this).closest(".media-library-add-form li").find('[data-drupal-selector="edit-preview"] img')); + var rotate = parseInt($(this).attr("data-rotate")), + $image = $(this).closest(".image-widget").find("img"); // Rotate Input $rotate_input = $(this).closest(".image-widget").find('.rotate'); // Remove current rotate CSS class
This 2 line was not in js file when i was created patch. After cloning 2.1.x branch and recreate patch
- ๐บ๐ธUnited States tjtj
The 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.
@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.
- ๐บ๐ธUnited States tjtj
Then please issue this so I need not jump through patch hoops in my composer file.
- ๐บ๐ธUnited States tjtj
What is the holdup in releasing this for Drupal 10?
- ๐ง๐ชBelgium mgstables
I 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 - ๐บ๐ธUnited States tjtj
MGStables: Yes that worked perfectly. Thank you.
Now someone please release the new version. - ๐ฆ๐บAustralia jaime@gingerrobot.com
jaimekristene โ made their first commit to this issueโs fork.
- ๐ฆ๐บAustralia jaime@gingerrobot.com
I 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.
"repositories": [ { "type": "vcs", "url": "https://git.drupalcode.org/issue/simple_image_rotate-3298061.git" }, { "type": "composer", "url": "https://packages.drupal.org/8", "exclude": ["drupal/simple_image_rotate"] } ]
Then further down:
"drupal/simple_image_rotate": "dev-3298061-automated-drupal-10",
- ๐ง๐ชBelgium mgstables
Thanks 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:
function simple_image_rotate_field_widget_complete_form_alter(&$field_widget_complete_form, FormStateInterface $form_state, array $context) { $field_definition = $context['items']->getFieldDefinition(); $field_name = $field_definition->getType();
If I put this line back, it works again.
function simple_image_rotate_field_widget_complete_form_alter(&$field_widget_complete_form, FormStateInterface $form_state, array $context) { $elements = &$field_widget_complete_form['widget']; $field_definition = $context['items']->getFieldDefinition(); $field_name = $field_definition->getType();
Drupal 10.1.2
PHP 8.1.6 - First commit to issue fork.
- ๐ช๐ธSpain markus_petrux
Hello,
I committed the fix to set the value for $elements, see #27
So back to ready to be reviewed.
Best regards,
Marc - ๐ง๐ชBelgium mgstables
Latest git version works perfectly. The icon was visible and usable and the image rotated.
Drupal 10.1.4
PHP 8.1.6 - Status changed to Needs work
about 1 year ago 7:46pm 17 November 2023 - ๐จ๐ฆCanada sagesolutions
You 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) {
- Assigned to ankithashetty
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 7:06am 20 November 2023 - ๐ฎ๐ณIndia ankithashetty Karnataka, India
- Status changed to Needs work
about 1 year ago 1:37pm 20 November 2023 - ๐จ๐ฆCanada sagesolutions
Looks 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"
- Status changed to Needs review
about 1 year ago 3:20am 21 November 2023 - ๐ฎ๐ณIndia ankithashetty Karnataka, India
Addressed the change requested in #35, thanks!
- Status changed to RTBC
about 1 year ago 3:35am 21 November 2023 - ๐ฎ๐นItaly afagioli Rome
Find this fix with https://www.drupal.org/project/simple_image_rotate/releases/2.3.0-alpha1 โ
Thanks for contributing