News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

8: Undefined index: id_member

Started by extremenewbie, April 02, 2009, 01:17:59 PM

Previous topic - Next topic

extremenewbie

I have been getting this error consistently in my forum, does anyone know what causes this and how to fix it?

8: Undefined index: id_member

Using:
SMF 2.0 RC1
No mods installed

The error comes up using both themes I have installed. 3column Theme and Clean Theme... I dont think it has anything to do with the theme...

Thanks in advance....
"20 Years from now you will be more disappointed by the things you didn't do than by the ones you did"

jeri

Having same problem after changing my forum from 2.0 to 1.1.8

Tyrsson

Can you please post the entire error message.
PM at your own risk, some I answer, if they are interesting, some I ignore.

extremenewbie

Sure thing, now I'm getting more.... (or possibly had them and didn't notice)

8: Undefined index:  Hello_member_ndt
File: /home/content/c/t/u/ctunite/html/forums/Themes/default/MessageIndex.template.php (body_above sub template - eval?)                               Line: 191

[/]
2: Invalid argument supplied for foreach()
File: /home/content/c/t/u/ctunite/html/forums/Themes/3columnCOPYtoedit/BoardIndex.template.php (main sub template - eval?)                               Line: 439                            

[/]
8: Undefined variable: mark_read_button
File: /home/content/c/t/u/ctunite/html/forums/Themes/3columnCOPYtoedit/BoardIndex.template.php (main sub template - eval?)                               Line: 220                            

Thanks Tyrsson!


[/]
"20 Years from now you will be more disappointed by the things you didn't do than by the ones you did"

Tyrsson

Run this and then clear the error log and post the new errors so we can figure out exactly where they are coming from.

To disable template eval via phpMyAdmin ( What is phpMyAdmin? )

REPLACE INTO smf_settings
   (variable, value)
VALUES ('disableTemplateEval', '1');


PM at your own risk, some I answer, if they are interesting, some I ignore.

SoLoGHoST

Just a little info for ya that I picked up along the way about undefined_index errors...

undefined_index usually means that a variable is being called and it is null or empty.  Best practice to get rid of these warnings in your error logs is to check if it is not empty or if it isset and then perform the necessary code.  For example:

if (!empty($Hello_Member_ndt)) {

// Continue on...

}

if (!empty($mark_read_button)) {


}

// OR YOU CAN TRY THIS


if (isset(Hello_Member_ndt)) {
// Continue on...
}

if (isset(mark_read_button)) {
// Continue on...

}

Informatics

Quote from: extremenewbie on April 03, 2009, 07:15:39 PM
Sure thing, now I'm getting more.... (or possibly had them and didn't notice)

8: Undefined index:  Hello_member_ndt
File: /home/content/c/t/u/ctunite/html/forums/Themes/default/MessageIndex.template.php (body_above sub template - eval?)                               Line: 191

[/]
2: Invalid argument supplied for foreach()
File: /home/content/c/t/u/ctunite/html/forums/Themes/3columnCOPYtoedit/BoardIndex.template.php (main sub template - eval?)                               Line: 439                            

[/]
8: Undefined variable: mark_read_button
File: /home/content/c/t/u/ctunite/html/forums/Themes/3columnCOPYtoedit/BoardIndex.template.php (main sub template - eval?)                               Line: 220                            

Thanks Tyrsson!


[/]


I think it's came from Ajax Chat.. like on mine


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

Tyrsson

That is a default language string. Its found in the index.template.php and is defined in the index.english.php.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Kimmie

I am having an issue with a similar error (while someone was viewing a board):

8: Undefined index: id_member
File: /home//public_html/Sources/Security.php
Line: 227

any ideas?

Just upgraded from 1.9 to 2.0

Mods Installed are:
1.   Generic Avatars   1.1   [ Uninstall ]
2.   Justify BBCode   2.1   [ Uninstall ]
3.   New Topic Button   1.0   [ Uninstall ]
4.   New Style Message Icon   1.1   [ Uninstall ]
5.   Aeva ~ Auto-Embed Video & Audio   6.9.100   [ Uninstall ]
6.   Global Headers Footers   2.0   [ Uninstall ]
7.   Thank-O-Matic   2.0 Beta 10   [ Uninstall ]
8.   Hide Tag BBC Image   1.0.1   [ Uninstall ]
9.   Hide Tag   2.3.5   [ Uninstall ]
10.   Users Online Today   1.5.4

N3RVE

Attach ./Sources/security.php

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

Kimmie


greyknight17

Kimmie, is this issue resolved now?

Is this error only showing up when members view a board? Clear your error log and test it out to see what's triggering it.

Did you make any changes prior to this problem? Do you remember the last mod you installed? Try uninstalling the Thank-O-Matic mod to see if it helps.

Kimmie

Honestly, I had totally forgotten about this issue, and I am assuming its because I havent seen that error since then and/or because I hadnt had a response since i uploaded that file for [n3rve]

Give me a couple of days (will be busy with family/holiday tomorrow) and I will check on this and close the thread if necessary :)

Arantor

Are you still having trouble with this, or is it resolved now?

Kimmie

I havent had the error again so I am gonna assume its fine and will mark solved. :)

Arantor

extremenewbie, is this still an issue?

rosspet

#16
I'm getting this error as well with SMF 2.0 RC1.2 . I cleared the error log, went to the home page then back to the error log and found:-
   
8: Undefined index: id_member

File: /home/sapasor1/public_html/Themes/default/GenericMenu.template.php (body_above sub template - eval?)
Line: 240
..................................................
8: Undefined index: id_member
File: /home/sapasor1/public_html/Themes/default/GenericMenu.template.php (body_above sub template - eval?)
Line: 239
..................................................
8: Undefined index: id_member
File: /home/sapasor1/public_html/Themes/clean/BoardIndex.template.php (body_above sub template - eval?)
Line: 240
.................................................
8: Undefined index: id_member
File: /home/sapasor1/public_html/Themes/clean/BoardIndex.template.php (body_above sub template - eval?)
Line: 239
..................................................
8: Undefined index: id_member
File: /home/sapasor1/public_html/Themes/default/Errors.template.php (body_above sub template - eval?)
Line: 240
.................................................
8: Undefined index: id_member
File: /home/sapasor1/public_html/Themes/default/Errors.template.php (body_above sub template - eval?)
Line: 239
...............................................

Cleared log, went to moderate then back to log. Six errors, 2 being the same Errors.template.php ones, 2 the same GenericMenu.template.php, and 2 new ones, both Themes/default/ModerationCenter.template.php (body_above sub template - eval?)
Line: 240 and line 239
..................................................

Any ideas please?

Arantor


rosspet

1.     PortaMx v0.961     0.961
2.    EmailValidator    1.0

Arantor

Hmmm.

The problem is that it's not very clear where the errors are. The "eval" part is actually masking where the real error is.

Can you install Disable Template Eval, then tick the box it gives you. This will change the errors so we can see exactly where they are.

rosspet

Only one file showing now - Themes/clean/index.template.php lines 239 and 240



Arantor

Please can you attach that file here so we can take a look at it?


rosspet

Removed the reference to id_member in lines 239 and 240 as I can't find where it is set. Left template eval disabled, errors gone and all seems to be working OK.
Thanks.

Arantor

Interesting. There are two things that should be broken but aren't only on a technicality.

You could replace $context['id_member'] with $context['user']['id'] though which should also fix the issue.

rosspet

Thanks Arantor, tried your suggestion, unticked Disable template evaluation, everything works  8)

Arantor

You could leave it ticked, actually. There is a performance boost given too.

Prosoi

Hello!

I've same problem on my forum - SMF2.0 RC2. No mods installed.

Very strange. This error in the log came only from one user, a Global Moderator. But other users and Globals - no problem.

szinski

I know this is an old topic, but I'm seeing the same behavior. Just upgraded from 1.1.18 to 2.0.4 and I'm seeing this in my log:

http://www.pizzamaking.com/forum/index.php?action=dlattach;topic=20346.0;attach=72069;image
8: Undefined index: id_member
File: /home/pizza/public_html/forum/Sources/Security.php
Line: 239

Here is line 239 from my Security.php file:

    // Only check the ban every so often. (to reduce load.)
    if ($forceCheck || !isset($_SESSION['ban']) || empty($modSettings['banLastUpdated']) || ($_SESSION['ban']['last_checked'] < $modSettings['banLastUpdated']) || $_SESSION['ban']['id_member'] != $user_info['id'] || $_SESSION['ban']['ip'] != $user_info['ip'] || $_SESSION['ban']['ip2'] != $user_info['ip2'] || (isset($user_info['email'], $_SESSION['ban']['email']) && $_SESSION['ban']['email'] != $user_info['email']))
    {



system1024

Quote from: Blue Crab on March 09, 2013, 05:13:00 PM
I know this is an old topic, but I'm seeing the same behavior. Just upgraded from 1.1.18 to 2.0.4 and I'm seeing this in my log:

8: Undefined index: id_member
File: /home/pizza/public_html/forum/Sources/Security.php
Line: 239

Here is line 239 from my Security.php file:

    // Only check the ban every so often. (to reduce load.)
    if ($forceCheck || !isset($_SESSION['ban']) || empty($modSettings['banLastUpdated']) || ($_SESSION['ban']['last_checked'] < $modSettings['banLastUpdated']) || $_SESSION['ban']['id_member'] != $user_info['id'] || $_SESSION['ban']['ip'] != $user_info['ip'] || $_SESSION['ban']['ip2'] != $user_info['ip2'] || (isset($user_info['email'], $_SESSION['ban']['email']) && $_SESSION['ban']['email'] != $user_info['email']))
    {

same bug... how to fix?

margarett

Did you also upgrade from 1.1.x to 2.0.x?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

system1024

Quote from: margarett on January 23, 2015, 05:54:36 AM
Did you also upgrade from 1.1.x to 2.0.x?

yes - upgrade from 1.1.18 to 2.0.9

margarett

This is a known issue (not exactly an issue) and it will be fixed by itself. A quote about this issue:
QuoteThe variable in question is $_SESSION['ban']['id_member'] - it's the only mention of id_member in that line, so it *must* be that.

SMF 1 to SMF 2 changed how ban-checking per session was done very slightly, the byproduct of which is this error. There's no point fixing it because it's just an extra check that would otherwise need to be carried out every so often, and it's only an issue during the 1.1 to 2.0 upgrade.

Once the session refreshes or the ban check refreshes - whichever first - the new values are generated, and the problem fixes itself. Saying to leave it for an hour simply ensured that the session would be cleared (the default is 20 minutes) so that the new session check would be done that fixed it
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: