In Reports > Recent log messages, I am getting this Notice:

Notice: Undefined index: region in include() (line 283 of /home3/carolloo/public_html/sites/all/themes/terrajmm1/templates/page--front.tpl.php).

Smart IP seems to be working; I'm getting the Region value I expect. I'm just not sure why I'm getting the undefined index error. And when I get and print the session variables, all spit out just fine, including "Region".

The Smart IP code on my page--front.tpl.php page looks like this:

$smart_ip_session = smart_ip_session_get('smart_ip');

if ($smart_ip_session['location']['region'] == 'Alaska' OR $smart_ip_session['location']['region'] == 'Idaho' OR $smart_ip_session['location']['region'] == 'Oregon' OR $smart_ip_session['location']['region'] == 'Washington'):

print render($page['project_nw_1']);
print render($page['project_nw_2']);
print render($page['project_nw_3']);

elseif ($smart_ip_session['location']['region'] == 'Alabama' OR $smart_ip_session['location']['region'] == 'Florida' OR $smart_ip_session['location']['region'] == 'Georgia' OR $smart_ip_session['location']['region'] == 'Kentucky' OR $smart_ip_session['location']['region'] == 'Mississippi' OR $smart_ip_session['location']['region'] == 'North Carolina' OR $smart_ip_session['location']['region'] == 'South Carolina' OR $smart_ip_session['location']['region'] == 'Tennessee'):

print render($page['project_se_1']);
print render($page['project_se_2']);
print render($page['project_se_3']);

else:

print render($page['project_default_1']);
print render($page['project_default_2']);
print render($page['project_default_3']);

endif;

Thank you.
Jean

Comments

jmatuska created an issue. See original summary.

birdsnbees’s picture

Category: Bug report » Support request
Status: Active » Fixed

The sites/all/themes/terrajmm1/templates/page--front.tpl.php is not Smart IP's part of source codes. It is your (user's) codes, so this is not Smart IP's bug.

Suggestion: add isset($smart_ip_session['location']['region']) checker in your code.

Status: Fixed » Closed (fixed)

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