Closed (fixed)
Project:
Restrict IP
Version:
7.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2017 at 18:57 UTC
Updated:
11 Aug 2018 at 01:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
chri5tia commentedComment #3
chri5tia commentedComment #4
chri5tia commentedComment #5
bkeller commentedI'm using this module to restrict access on a development site, and I've got so many of those errors that the dev site actually comes up in a Google search for this error... well that was embarrassing.
I can only assume that the Countries and IP Country modules populate those variables (I don't have either installed), because I didn't see anywhere that they were defined before line 246.
Anyway, to stop those error messages, I just wrapped those two variables in an isset check, and that seems to have stopped the messages.
Line 246:
if($access_denied && isset($countries) && isset($ip2country))But again, for all I know adding that may negate the usage of those two modules.
Comment #6
antonyanimator commentedI am seeing this issue too, thanks @bkeller
Comment #7
chri5tia commentedI am using this to temporarily restrict access to the test site and production before it's launched. BKeller's fix #5, changing line 246 in the restrict_ip.module as noted worked for me, thanks!
Comment #8
rschwab commentedHere is a patch for #5 - thank you bkeller!
Comment #9
antonyanimator commented@rschwab thanks for the patch
Comment #10
nickonom commentedI do confirm patch takes care of the issue.
Comment #11
spanners commentedI just tried out this patch, but I now get the error...
Notice: Undefined property: stdClass::$data in restrict_ip_boot() (line 250 of /home/dimosdental/public_html/sites/all/modules/restrict_ip/restrict_ip.module).On top of that, country blocking isn't working - regardless of whether I select Disabled, Whitelist or Blacklist, everyone is blocked except for the IPs specified in the first field.
I came from the other issue in the issue queue https://www.drupal.org/project/restrict_ip/issues/2956653 because I'm having the same problem.
Using 7.x-2.1 version of the module on at Drupal 7.59 site.
Comment #13
jaypanThanks for the work and testing guys. The patch actually wasn't usable as-is, as it masked the problem instead of solving it. But the patch showed me exactly where the problem lay, and enabled me to re-write the code to fix it.