Problem/Motivation

3 errors displayed after enabling Visitors module with PHP 8.1.22

  1. Warning: Undefined array key "_cvar" in Drupal\visitors\Service\TrackerService->write() (line 112 of /modules/contrib/visitors/src/Service/TrackerService.php)
  2. Deprecated function: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in Drupal\visitors\Service\TrackerService->write() (line 112 of /modules/contrib/visitors/src/Service/TrackerService.php)
  3. Warning: foreach() argument must be of type array|object, null given in Drupal\visitors\Service\TrackerService->write() (line 113 of /modules/contrib/visitors/src/Service/TrackerService.php)

Steps to reproduce

Install and enable Visitors module 8.2.16 on PHP 8.1.22 on Drupal 9.5.11

Issue fork visitors-3389685

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

akmalfikri created an issue. See original summary.

akmalfikri’s picture

Issue summary: View changes
akmalfikri’s picture

Issue summary: View changes
shiv_yadav’s picture

Assigned: Unassigned » shiv_yadav
shiv_yadav’s picture

Assigned: shiv_yadav » Unassigned
viren18febs’s picture

Status: Active » Needs review

I am not able to reproduce the issue with module 8.1.26 on PHP 8.1.11 on Drupal 9.5.11.

bluegeek9’s picture

Category: Bug report » Support request
Status: Needs review » Active

Does clearing the cache help?

akmalfikri’s picture

I did clear the cache, but it is still happening. The error is still displayed despite disabling error display.

akmalfikri’s picture

Issue summary: View changes

Updated the correct visitor module's version.

chetan 11’s picture

Status: Active » Needs review
StatusFileSize
new84.65 KB

Hi @akmalfikri
I have reproduce the above module on my local & it is successfully enabled, i didn't get any error while installing.
My drupal version - 10 & version of is PHP 8.1.20 .
Attaching the screenshot for your reference.

bluegeek9’s picture

Assigned: Unassigned » bluegeek9
Category: Support request » Task
Status: Needs review » Active

I am not sure why cvar is not defined. I can update the code to handle cvar not defined, but unsure why.

  • bluegeek9 committed abdbd78e on 8.x-2.x
    Issue #3389685: Three different errors displayed
    
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned
Status: Active » Fixed

Some of these issues where resolved in other issues.

bluegeek9’s picture

This issue was resolved. A new release, 8.x-2.17, will be made soon, May 31st.

This is an excellent opportunity to beta test the dev branch, and report any issues.

Contributors (5)

bluegeek9, roshni27, abhishek_gupta1, sarwan_verma, SandeepSingh199

Changelog

Issues: 32 issues resolved.

Changes since 8.x-2.16:

Bug

Feature

Task

Status: Fixed » Closed (fixed)

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