When entering the API key for the IPInfoDB service for the first time this message pops up.
Error message
Notice: Undefined variable: ip in smart_ip_admin_settings_submit() (line 350 of sites/all/modules/smart_ip/includes/smart_ip.admin.inc).This is using drupal 7.22
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | IPInfo_API_key_enter-1983568_1.patch | 1.04 KB | lostkangaroo |
| #6 | IPInfo_API_key_enter-1983568.patch | 1.35 KB | lostkangaroo |
| #3 | IPInfo_API_key_enter-1983568-3.patch | 1.01 KB | lostkangaroo |
| #1 | smartip_undefined_variable_350.jpg | 68.01 KB | mveplus |
Comments
Comment #1
mveplus commentedJust installed Drupal 7.22 and Smart IP, can confirm this issue as well...
IP is not served, but Country, Region etc.. work.
Comment #2
kingfisher64 commentedSince the IP is not served I think it's more than a minor issue so bumping this to major.
Comment #3
lostkangaroo commentedIt looks like the IP address used was not being used in the drupal_set_message calls causing the notices when the debug setting was turned off. This is what I noticed at least when I started investigating this issue. Try this patch and let me know if it solves your problem.
Also setting this to normal as the IP in the submit form is indeed being passed which can be verified by doing a dpm() on the returned $location array.
Comment #4
kingfisher64 commentedThis was tested against:
7.x-2.0 2013-Mar-26
7.x-1.9 2013-Feb-04 &
7.x-1.x-dev 2013-Mar-28 versions
Comment #5
lostkangaroo commentedThat's interesting I will look into this right now.
Comment #6
lostkangaroo commentedAlright rerolled the patch and tested its ability to apply and came back clean.
Comment #7
kingfisher64 commentedHi lostkangaroo, sorry i'm not getting sucess when applying the patch. The following displays when applied against stable 2.x branch. I'm (stuck) using a windows environment so am using cygwin but normally don't have any problems. Just trying to think why it's coming back clean for you and saying it's already applied for me?
Many thanks :)
Comment #8
lostkangaroo commentedTry this one. It removes the second bit that was harmless to me but seems to be messing with you.
Comment #9
kingfisher64 commentedIt's not having it again kangaroo, sorry.
Comment #10
lostkangaroo commentedAlright then we will have to do this the manual way. There are 2 lines you will need to change.
Line 350
Line 387
This is all the patches from above were going to do. Good luck and let me know if the error message becomes a thing of the past so we can mark this RTBC and watch it go green.
Comment #11
kingfisher64 commentedWell using the IP lookup functionality now works so I'm assuming this is part and parcel of the issue. I'm seeing no error at present.
Thank you - for your time and patience :)
Comment #12
lostkangaroo commentedNo worries on a fresh install I was having the same problems so hopefully soon this will be rolled into the current releases to prevent any future admins from having the same experiences.
Comment #13
arpeggio commentedHi, thank you for reporting this issue kingfisher64 also for sharing the patch lostkangaroo. However, the fix for Line 387:
IP address is not always the IP of the current user (ip_address()), but it can also be the value supplied at "IP address to use for testing" field. Anyway, this issue is already fixed. Please use the dev version. Thanks.
Comment #14
kingfisher64 commentedI'm only seeing a 2.x branch stable and the 1.x branch for dev. Are we to be using the 1.x branch? I'm assuming so, it's also no biggie to just copy & paste according to #13 for the 2.x branch.
Would just appreciate some clarification.
Thank you for your time and an excellent module arpeggio :)
Comment #15
arpeggio commentedI'm sorry, I forgot to mentioned that the fix is already pushed, please use the dev version (7.x-1.x-dev).
You're welcome kingfisher64.
Thanks.
Comment #16
lostkangaroo commentedNo worries arpeggio the code in #13 is simply there to help address any cases when $ip wasn't assigned as a fallback until you could take a look at it.