Problem/Motivation

When rotating an image and clicking save on the node, Drupal throws an error and doesn't save

TypeError: Argument 3 passed to Drupal\file\FileRepository::move() must be of the type int, string given

#0 /var/www/html/web/core/modules/file/file.module(207): Drupal\file\FileRepository->move()
#1 /var/www/html/web/modules/contrib/simple_image_rotate/simple_image_rotate.module(201): file_move()
#2 /var/www/html/web/modules/contrib/simple_image_rotate/simple_image_rotate.module(142): simple_image_rotate_rotate_image()
...

Steps to reproduce

  • Enable module on Drupal 9 site
  • Create new node with image field
  • Upload image
  • Rotate image
  • Save node

Proposed resolution

'FILE_EXIST_ERROR' should be the class constant, not a string.

Remaining tasks

Update code

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3255089_2.patch1.84 KBsagesolutions

Comments

sagesolutions created an issue. See original summary.

sagesolutions’s picture

Status: Active » Needs review
StatusFileSize
new1.84 KB
glynster’s picture

@sagesolutions thanks for the patch works like a charm. RTBC +1

oriol_e9g’s picture

Status: Needs review » Reviewed & tested by the community

  • leevh committed a348c95 on 2.1.x
    issue #3255089 apply patch 3255089_2
    

  • leevh committed acd95b6 on 2.1.x
    issue #3255089 missed one chunk from patch
    

  • leevh committed 7c83af3 on 2.1.x
    issue #3255089 use statement
    

  • afagioli committed 94e2400 on 2.1.x
    fix #3186522, #3203735, #3223056, #3255089
    

afagioli credited leevh.

afagioli’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

mindhunter75’s picture

Thank you for the patch sagesolutions, works great!