1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Undefined index - what does it mean?

Discussion in 'XenForo Development Discussions' started by Crazy-Achmet, Jun 27, 2013.

  1. Crazy-Achmet

    Crazy-Achmet Active Member

    Hey there,

    i've updated my site from 1.1.3 to 1.2 and now i've encountered a couple of errors in a custom addon someone made for me.

    The main errors are like "Undefined index: XenForo_NewsFeedHandler_DiscussionMessage_ProfilePost". What does it mean? Is it possible to just define an index?

    I'm not an expert in development but i have some basic skills, so i know what i'm doing. :)

    Thanks for your help

  2. Chris D

    Chris D XenForo Developer Staff Member

    You can have an array of data, e.g.

    $array = array(
    'someKey1' => 'someValue1',
    'someKey2' => 'someValue2'
    someKey1 and someKey2 are indexes of that array.

    To better instruct how to fix, we'd probably need to see the full error message (including the line numbers and stack trace) and know what the add-on is supposed to do.

    The index it is reporting is a bit confusing because that's a class name, but perhaps the code contains an array of class names for some purpose...

    Yeah getting a better idea of what the code is doing is needed.
    Crazy-Achmet likes this.
  3. tyteen4a03

    tyteen4a03 Well-Known Member

    Or in a nutshell, trying to get $array["Idontexist"] from @Chris Deeming 's example would raise this notice.
    Crazy-Achmet and Chris D like this.

Share This Page