Problem/Motivation

Since PHP 8.2, PHP emits a deprecation notice on the following pattern the dollar sign ($) is placed at the outside of the curly braces. It can be seen in couple of places:

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/contrib/smart_ip/smart_ip.module on line 132.

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/web/modules/contrib/smart_ip/smart_ip.module on line 148

Steps to reproduce

1. Use a Drupal 10 project with PHP 8.2
1. Add drupal/smart_ip module via composer.
3. Observe warnings in the terminal when using Drush or via the web interface.

Proposed resolution

Use {$var} syntax instead of ${var} syntax to avoid deprecation notice.

CommentFileSizeAuthor
#3 strings_is_deprecated-3386941.patch924 byteschetan 11

Comments

suraj_vantagode created an issue. See original summary.

mohd sahzad’s picture

Assigned: Unassigned » mohd sahzad
chetan 11’s picture

StatusFileSize
new924 bytes

Hi @suraj_vantagode, I have installed this module with the above mentioned method.
I have made the changes in module file & attached the patch.

Please review & let me know if it's working fine.

masoom2206’s picture

Hello @suraj_vantagode, thanks for the patch it's working for me.

chetan 11’s picture

Status: Active » Needs review
fraserthompson’s picture

I was experiencing this issue after upgrading to Drupal 10 and PHP 8.2 and the above patch fixed it.

poker10’s picture

Version: 5.0.0-alpha3 » 5.0.x-dev
Assigned: mohd sahzad » Unassigned
Status: Needs review » Reviewed & tested by the community

I think the patch is correct, so moving to RTBC. Thanks!

agoradesign’s picture

agree, please commit!

heddn’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

I think this was fixed in #3462749: Drupal 11 support. Please re-open if I've closed this in error.