I regulary get this notice:
Notice: Undefined index: nid in main() (line 18 of xxxx/modules/statistics/statistics.php)
I found out this happens whith requests like this:
an ip-address - - [11/May/2015:10:42:05 +0200] "OPTIONS /modules/statistics/statistics.php HTTP/1.1" 200 304 "http://xxxx" ......
There is no problem when it is a POST request.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drupal-statistics_undefined_index-2486643-1.patch | 1.56 KB | AlexKirienko |
Comments
Comment #1
AlexKirienko commentedI have faced same issue. Regular notice messages in watchdog.
Please check attached patch with fix.
Comment #2
mrded commentedThe same issue.
Comment #3
promesThanks. The code seems correct to me.
Comment #4
silios commentedPatch rectifies the problem. Thanks
Comment #5
timmillwoodLooks good to me!
Comment #6
timmillwoodComment #7
David_Rothstein commentedCommitted to 7.x - thanks!
Looks like this was fixed elsewhere and in a different way in Drupal 8. And we can probably live without a test for something like this.