Skip to main content
Topic: Undefined index (Read 2551 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Undefined index

I am getting thousands of these errors since the upgrade to 1.1.2.

Notice: Undefined index: mentions

Notice: Undefined index: unread_messages

Re: Undefined index

Reply #1
You are not alone, these errors are all over the place

Re: Undefined index

Reply #2
Report them is the first step to have them fixed. :)
Bugs creator.
Features destroyer.
Template killer.

Re: Undefined index

Reply #3
That one I think it's part of:
https://github.com/elkarte/Elkarte/issues/3124
so removing:
Code: [Select]
$labels = array();
from sources/subs/PersonalMessage.subs.php will do the trick. :)

And if you have the cache enabled, then you'll need to cleanup the cache as well.
Bugs creator.
Features destroyer.
Template killer.


Re: Undefined index

Reply #5
That one I think it's part of:
https://github.com/elkarte/Elkarte/issues/3124
so removing:
Code: [Select]
$labels = array();
from sources/subs/PersonalMessage.subs.php will do the trick. :)

And if you have the cache enabled, then you'll need to cleanup the cache as well.
Deleting that line and clearing the cache did not get rid of the errors.

Errors are now coming from:
Notice: Undefined index: mentions
File: /home/creedmoo/public_html/sources/subs/Menu.subs.php
Line: 627

Notice: Undefined index: unread_messages
File: /home/creedmoo/public_html/sources/subs/Menu.subs.php
Line: 608

Notice: Undefined index: mentions
File: /home/creedmoo/public_html/themes/default/Theme.php
Line: 845

Notice: Undefined index: unread_messages
File: /home/creedmoo/public_html/themes/default/Theme.php
Line: 844

Re: Undefined index

Reply #6
I'm not sure what I read yesterday... of course are two different things.

Would you mind including also the URL part of the error?
It doesn't need to have the domain name if you don't want, but at least everything else so that I can see where the error occurs.
Bugs creator.
Features destroyer.
Template killer.

Re: Undefined index

Reply #7
Here are URLs:
Code: [Select]
http://www.65creedmoor.com/index.php?
http://www.65creedmoor.com/index.php?http://www.65creedmoor.com/

Re: Undefined index

Reply #8
Oook.
These are (IMO) actually two issues:
1) errors happening too early were failing very disgracefully because the database is not yet loaded,
2) the parsing of the request fails because having "http" in the query is "evil".

The first is fixed here: https://github.com/elkarte/Elkarte/commit/dfd04508ad058e2252389dfc86909bea3fd61ba0 it's a bit more than what I wanted to change for this, but this way it should be a bit more robust (I think... I hope :P).

The second... I still have to apply "the fix" because I prefer to verify a couple of things, but to me the check could very well be removed because pointless.
Bugs creator.
Features destroyer.
Template killer.

Re: Undefined index

Reply #9
I applied the fixes and deleted the cache, but I am still getting the same errors:
   txcas
Today at 10:18:07 AM
45.27.161.195
3AXM6MRDZnlU0ALdc3vltDQ19WGljOUK
Type of error: Undefined
Notice: Undefined index: mentions
http://www.65creedmoor.com/index.php?
File: /home/creedmoo/public_html/sources/subs/Menu.subs.php
Line: 627

   txcas
Today at 10:18:07 AM
45.27.161.195
3AXM6MRDZnlU0ALdc3vltDQ19WGljOUK
Type of error: Undefined
Notice: Undefined index: unread_messages
http://www.65creedmoor.com/index.php?
File: /home/creedmoo/public_html/sources/subs/Menu.subs.php
Line: 608

   txcas
Today at 10:18:07 AM
45.27.161.195
3AXM6MRDZnlU0ALdc3vltDQ19WGljOUK
Type of error: Undefined
Notice: Undefined index: mentions
http://www.65creedmoor.com/index.php?
File: /home/creedmoo/public_html/themes/default/Theme.php
Line: 845

   txcas
Today at 10:18:07 AM
45.27.161.195
3AXM6MRDZnlU0ALdc3vltDQ19WGljOUK
Type of error: Undefined
Notice: Undefined index: unread_messages
http://www.65creedmoor.com/index.php?
File: /home/creedmoo/public_html/themes/default/Theme.php
Line: 844

Re: Undefined index

Reply #10
Ohh... you have simple portal, that's an important bit.
And on top of that, you have a menu block on the front page, and that's a crucial bit.

The problem is in SP, open /sources/subs/spblocks/Menu.block.php and change:
Code: [Select]
		if (empty($context['menu_buttons']))
{
setupMenuContext();
}
to:
Code: [Select]
		if (empty($context['menu_buttons']))
{
setupThemeContext();
setupMenuContext();
}

@Spuds that's for you! :D
Bugs creator.
Features destroyer.
Template killer.

Re: Undefined index

Reply #11
Done .. thanks !
Be safe, Be kind, Happy Programing

Re: Undefined index

Reply #12
Thanks guys. The SP fix took care of the errors.