News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

hundreds of undefinex index: href and title

Started by Ataru Moroboshi, June 15, 2011, 04:27:22 AM

Previous topic - Next topic

Ataru Moroboshi

I got hundreds of this error in my log:


/index.php?/topic,6129.40.html
8: Undefined index: href
File: /var/www/.../index.template.php
Riga: 437

/index.php?/topic,6129.20.html
8: Undefined index: title
File: /var/www/.../index.template.php
Riga: 438

it happens only to registered and logged people, not every time, and not at all all users (e.g. i never had that issue).

these are lines 437 and 438 of my custom (based on curve) theme's index.template.php:

Quote<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
                  <span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>

people tells me that sometimes they can't see 'forum' button (I'm using simpleportal, so I have a Home and a forum button befor the help button), i think those things could be related.

someone coud help me?

Kindred

well, have you defined the button array fully?   From the errors, it would appear that $button['href'] and $button['title'] are not defined...


However, I think the error is in subs.php in the menu array that is being used to generate that button list. Make sure that an href and title are defined for every menu item in the array in subs.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ataru Moroboshi

they are defined

some users generate that error, aome others don't.

same users that generate that error, sometimes don't generate it.

I really can't understand

Kindred

what mods do you have installed?

Are they defined with conditionals?

If it's the same users generating the errors all the time, then what do they have in common (e.g. same membergroup)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ataru Moroboshi

they've nothing in common, but from 2 days ago i receive those errors also from not logged people but not from everyone, it seems to be absolutely random

Kindred

Random thongs are nearly impossible to solve...    There must be some factor which they share....

And you did not answer the first question.

WHAT MODS DO YOU HAVE INSTALLED?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ataru Moroboshi

1.     Favicon      1.3
2.    Hide Membergroup Titles    1.0
3.    WYSIWYG Quick Reply    2.1
4.    SimplePortal    2.3.2
5.    Order Custom Profile Fields
6.    Tapatalk SMF 2.0 RC3 Plugin    2.0.0
7.    Karma Description Mod    2.6.8
9.    Ignore User Button    1.0
11.    SMF Articles    1.3.2a
12.    Next Topic Page    1.2
13.    JW Player    1.1
14.    Sitemap    2.1.2
15.    YouTube BBCode    2.6

Yngwiedis

Hello...

I am having the exact same problem.
Can somebody help please ?

Here is my installed mods list:

1.    Admin Notepad    2.0.1
2.    WYSIWYG Quick Reply    2.3
3.    Adk Blog    2.0
4.    SA Shop    0.7
5.    Arcade Skin 2.5 RC1    1.0.0
6.    Spoiler Tag    0.7.2a
7.    Tabbed smileys    0.3.7
8.    View Voters at Polls    1.0
9.    SMF Shop Lottery    1.0.1
10.    6 Custom buttons / tabs with Sub Menus (4)    0.5
11.    Add Stars To Profile    1.0.1
12.    Google Analytics Code    1.4
13.    ENotify    2.0.1
14.    SimpleAds    1.0.1
15.    Aeva Media    1.4w
16.    SA Chat    Beta 3 Rev41
17.    SMF Arcade v2.5 PDL Package    3.4
18.    SMFPets    0.2
19.    SimplePortal    2.3.3
20.    Greek translation of Aeva Media 1.3a    1.3a
21.    SMF Arcade PDL Jeza Edits    1.3
22.    SMF Arcade    2.5 RC1
23.    PaypalDonations    2.0
24.    Menu Order    0.2.6
25.    SMF Gallery Lite    3.1.1
26.    Additional Membergroups on Profile    1.1.2
27.    SA Facebook    2.0 RC Rev24
28.    Google Member Map    2.0.8
29.    Error Log Counter    1.0
30.    SimplePortal - Greek    2.3.3
31.    Calling Your twitter    2.5
32.    Off-Topic BBC Tag    1.1.2-rc3
33.    Greeklish to Greek    1.01
34.    Search Focus Dropdown    1.52
35.    Users Online Today    2.0 RC3
36.    Add GooglePlus to Posts    1.0
37.    newstaffblock    1.0
38.    Ultimate Profile    0.9.1
39.    Activity_Bar    1.0.1.3
40.    Align text with Smiley    1.2
41.    Birthday on Profile Summary v2    2.1
42.    Countdown BBCode    2.0
43.    Custom Copyright    1.0.2
44.    Default Avatar    2.1
45.    Disable 'last edit by...' for Administrators    1.2
46.    Enhanced Dropdown    1.3
47.    Enhancements to purge inactive members    1.2.1
48.    Enhanced PM Popup    1.0.1
49.    Float BBCODE    1.0.2
50.    Hidden Admin    1.0
51.    Join date and Location in Posts    1.2
52.    Karma Buttons    1.1
53.    Last Active On MemberList    1.4
54.    More Spiders    1.2


Thank you very very much.
AmityHost.com - The Affordable Host

Illori

please open a separate topic for your issue this topic belongs to someone else.

Yngwiedis

AmityHost.com - The Affordable Host

Hj Ahmad Rasyid Hj Ismail

Quote from: Kindred on June 15, 2011, 12:50:58 PM
However, I think the error is in subs.php in the menu array that is being used to generate that button list. Make sure that an href and title are defined for every menu item in the array in subs.php
I have the same thought. Would you mind providing your menu code in Subs.php?

sbarker

I had a similar problem and cured it by adding the following code before the line that was listed in the error notice.

if (!isset($_POST['xxxx']))
{
$_POST['xxxxx'] = "undefine";
}

Change "xxxx" to the name of the variable that is causing the error.

Kindred

Which masks the problem and does not actually solve it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Joker™

Quote from: ahrasis on July 29, 2011, 02:44:58 AM
Quote from: Kindred on June 15, 2011, 12:50:58 PM
However, I think the error is in subs.php in the menu array that is being used to generate that button list. Make sure that an href and title are defined for every menu item in the array in subs.php
I have the same thought. Would you mind providing your menu code in Subs.php?

Ataru Moroboshi, also does errors pop's up on default theme too, might be some code missing in custom theme.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

sbarker

Quote from: Kindred on November 19, 2011, 07:44:01 AM
Which masks the problem and does not actually solve it.

It's masking the problem by doing what should be done elsewhere in the code.

Do a search here and look at the number of people reporting problems with "undefined Index"errors. These errors then fills up their error logs and masks other, potentially more serious problems.
One of the most common solutions offered is to switch off error logging which has far more serious consequences than the (temporary) solution I am suggesting.

Kindred

Actually, no..  It is masking the problem by (incorrectly) defining something that was undefined.
The error is correct... There is a mod which is leaving something undefined and it really should be defined.

However, indenting a "fake" definition does not actually love the problem. You have, essentially, done exactly the same thing as turning off the error instead of tracking the specific missing definition back to where it should be defined.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

sbarker

Quote from: Kindred on November 20, 2011, 11:08:51 AM
Actually, no..  It is masking the problem by (incorrectly) defining something that was undefined.
The error is correct... There is a mod which is leaving something undefined and it really should be defined.

Not sure if this anwer is from Donald Rumsfelt

"There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we know we don't know. But there are also unknown unknowns. There are things we don't know we don't know."

or Life of Brian.

"There shall, in that time, be rumours of things going astray, erm, and there shall be a great confusion as to where things really are, and nobody will really know where lieth those little things"

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: