Facing below error
Deprecated function: Creation of dynamic property Drupal\smart_image_optimizer\ImageConverter::$logger is deprecated in Drupal\smart_image_optimizer\ImageConverter->__construct() (line 41 of C:\xampp\htdocs\drupal\web\modules\contrib\smart_image_optimizer\src\ImageConverter.php)

CommentFileSizeAuthor
Screenshot 2026-05-12 164012.png41.63 KBrevathi.b
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

revathi.b created an issue. See original summary.

revathi.b’s picture

Status: Active » Needs review

MR !1 fixing this issue.

nishant’s picture

Title: Deprecated function Error » Contribution welcome: Fix for PHP 8.2 deprecation
Status: Needs review » Needs work

Hi Revathi.b,

Thank you for reporting this and providing the solution! You are correct—PHP 8.2+ requires explicit property declarations to avoid these deprecation notices.

I would love to have you contribute this fix to the project. Could you please create a Merge Request (MR) with the following changes?

Add the explicit property declaration for the logger:

/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

Remove the unused $loggerFactory property and its docblock, as it is currently redundant.

revathi.b’s picture

Status: Needs work » Needs review

Hi Nishant,

It is updated, please check.

nishant’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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