Problem/Motivation

I'm seeing a lot of these warnings in my log after upgrading from 8.x-2.15 to 8.x-2.16:

Warning: Undefined array key "java" in Drupal\visitors\Service\TrackerService->write() (line 138 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)
Warning: Undefined array key "fla" in Drupal\visitors\Service\TrackerService->write() (line 137 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)
Warning: Undefined array key "pdf" in Drupal\visitors\Service\TrackerService->write() (line 136 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)
Warning: Undefined array key "ag" in Drupal\visitors\Service\TrackerService->write() (line 142 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)
Warning: Undefined array key "wma" in Drupal\visitors\Service\TrackerService->write() (line 141 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)
Warning: Undefined array key "realp" in Drupal\visitors\Service\TrackerService->write() (line 140 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)
Warning: Undefined array key "qt" in Drupal\visitors\Service\TrackerService->write() (line 139 of /var/www/mysite/web/modules/contrib/visitors/src/Service/TrackerService.php)

The location for each warning is the same:

https://www.mysite.org/visitors/_track?_cvar=%7B%227%22%3A%5B%22route%22...

Any clues?

Issue fork visitors-3380760

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

sah62 created an issue. See original summary.

bluegeek9’s picture

Hi @sah62,

Thank you for reporting the error.

The array keys are related to this report #3378571: Browser Plugin Report.

java is for java
fla is for flash
pdf is for PDF
ag is for Silverlight
wma is for Windows Media Audio
realp is for Real Player
qt is for Quick Time.

There is also cookie; if the browser supports cookies, but the URL includes that one.

cookie=1

https://www.mysite.org/visitors/_track
In 8.x-2.15, we changed how visits are tracked. We use to track the visits when a page was generated server side. This has a number of draw backs, so we began tracking visits with JavaScript: /visitors/_track is the path the JavaScript POSTs to.

#3307257: Log visits with ajax

In 8.x-2.16 we began logging browser plugin support.

Which web server are you using? Do you know what the URL length limit is on the web server?
The data is being truncated. The last item in the url query is too small. It is the refer URL, the previous page visited.

urlref=https%3A%2F%2Fwww.mysite.org%2Fspeedo-calc

There should be an option on your web server to increase the URL length.

To verify my theory, you can look in your web browser's network tab, and find the post to https://www.mysite.org/visitors/_track. You should see java, fla, and the other missing keys in the URL's query.

sah62’s picture

I'm using nginx/1.18.0. I have client_max_body_size set to 500M in nginx.conf.

bluegeek9’s picture

Humm

I can update the code so there are not warning about undefined array keys. I am not sure why the browser plugins are not defined. Unless, they are absent due to inability to detect.

The visitor was on a mobile phone, Samsung Galaxy Ultra SM. It could be something about the device, but you said there are many warnings.

I can understand redacting your site's name from the error. It would be helpful if I could look at the site. Maybe send me a DM of the site's address.
Direct Message

  • bluegeek9 committed a3d5290e on 8.x-2.x
    Issue #3380760: Warning: Undefined array key
    
bluegeek9’s picture

Status: Active » Fixed
alfthecat’s picture

Hi, sorry for the delay in my reply and thanks for all the activity and the info.

I will apply the latest update, if you need any further info from my side please let me know and I'll provide whatever I can.

Thanks!

Status: Fixed » Closed (fixed)

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

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

alfthecat’s picture

Hi @bluegeek9 very excited about the new release, I'll be running with it in the coming days :)