Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\google_analytics\Form\GoogleAnalyticsAdminSettingsForm->buildForm() (line 211 of /app/web/modules/contrib/google_analytics/src/Form/GoogleAnalyticsAdminSettingsForm.php).

Drupal 9.4.4, PHP 8.1

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

beunerd created an issue. See original summary.

beunerd’s picture

Status: Active » Needs review
StatusFileSize
new791 bytes

Here's a patch.

michelle’s picture

Found the same issue in another area so added on to this patch.

Grevil made their first commit to this issue’s fork.

grevil’s picture

I created an MR with the patch from #3 by @Michelle and changed the NULL checks for !empty checks in cases, where $cookie_domain is an empty string.

anybody’s picture

Assigned: beunerd » Unassigned
Status: Needs review » Reviewed & tested by the community

MR!15 looks good to me! RTBC!

michelle’s picture

Thanks, @Grevil. I'm an old timer that hasn't gotten used to these new fangled MRs. LOL! And checking for empty instead of null is what I normally do in my own code so I'm in favor of that.

grevil’s picture

Thanks, @Michelle! Let's get this committed, then. :)

joegl’s picture

With PHP 8.1 being widely adopted are there any plans to make this module PHP 8.1 compatible and/or provide a new release? This is the second issue I've seen with a patch to fix this: https://www.drupal.org/node/3258588

The patch provided 3 months ago by Jeya sundhar addresses a number of issues with PHP 8.1 compatibility: https://www.drupal.org/project/google_analytics/issues/3258588#comment-1...

joegl’s picture

Issue tags: +PHP 8.1
japerry’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

For 4.x this will be handled in #3287765: Automated Drupal 10 compatibility fixes .. however, this issue can stay around for 2.x and 3.x which will not have 10 releases.

  • japerry committed eafb07d on 4.x authored by Grevil
    Issue #3300716 by Grevil, beunerd, Michelle, japerry: Deprecated...
japerry’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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