Problem/Motivation

When the image fails to process or load, a type error appears:
TypeError: Symfony\Component\HttpFoundation\Response::__construct(): Argument #1 ($content) must be of type ?string, Drupal\Core\StringTranslation\TranslatableMarkup given, called in /app/docroot/modules/contrib/drimage_improved/src/DrimageManager.php on line 429 in Symfony\Component\HttpFoundation\Response->__construct() (line 224 of /app/vendor/symfony/http-foundation/Response.php).

Proposed resolution

Ensure the error message is a string by casting it to a string type.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ✅ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release notes snippet
  • ✅ Release drimage_improved-1.0.6, drimage_improved-1.0.7

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3469425 by qusai taha: Fixed the type error by removing translation for system error messages
CommentFileSizeAuthor
#2 3469425-2.patch1.58 KBqusai taha
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

Qusai Taha created an issue. See original summary.

qusai taha’s picture

StatusFileSize
new1.58 KB
qusai taha’s picture

Status: Active » Needs review
qusai taha’s picture

Assigned: qusai taha » Unassigned

rajab natshah’s picture

Title: Fix Type Error in /app/docroot/modules/contrib/drimage_improved/src/DrimageManager.php on line 429 » Fix the type error by casting the error message to a string to ensure it is always a string

rajab natshah’s picture

Issue summary: View changes
Issue tags: +drimage_improved-1.0.6
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Title: Fix the type error by casting the error message to a string to ensure it is always a string » Fix the type error by removing translation for system error messages

  • rajab natshah committed 5ea603bc on 1.0.x
    Issue #3469425: Fix the type error by removing translation for system...
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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