what causes 8: Undefined index:

Started by shadav, September 12, 2019, 10:35:56 PM

Previous topic - Next topic

shadav

I have a ton of these errors in my log, I keep clearing my cache, and then clearing the logs but still they pop right back up

from what I gather, it's nothing really important.... but it's annoying
and most seem to say that it's language files, i've tried to compare and make sure that the language strings are there but still tons of 8: Undefined index: bla bla bla

am I missing something? Should I just not be worried with it? They build up fairly quickly.....

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."

SpacePhoenix

What version of SMF?

What version of PHP is the server using?

What mods does SMF have installed?

shadav

Quote from: SpacePhoenix on September 13, 2019, 02:11:29 AM
What version of SMF?

What version of PHP is the server using?

What mods does SMF have installed?

2.0.15, php 7.1....too many mods....

Quote from: Kindred on September 12, 2019, 11:19:12 PM
Please list the EXACT error message(s)

8: Undefined index: board_stats_limit
/Themes/default/languages/BoardStats.english.php (eval?)
Line: 13

8: Undefined index: board_stats_limit
/Themes/default/languages/PMAttachments.english-utf8.php (eval?)
Line: 13

8: Undefined index: description
/Themes/default/languages/AlternativeMenu.english.php (generic_menu_dropdown_above sub template - eval?)
Line: 303

8: Undefined index: title
/Themes/default/languages/AlternativeMenu.english.php (generic_menu_dropdown_above sub template - eval?)
Line: 291

8: Undefined index: BuyMeIcon
/Sources/Load.php
Line: 1286

8: Undefined index: additional_groups
/Sources/Load.php
Line: 1088

8: Undefined index: allow_hof
/Sources/Subs.php
Line: 4455

8: Undefined index: allow_view_blogs
/Sources/Subs.php
Line: 4387

8: Undefined index: allow_view_kb
/Sources/Subs.php
Line: 4373

8: Undefined index: blogs
/Sources/Subs.php
Line: 4385

8: Undefined index: kb
/Sources/Subs.php
Line: 4371

to name a few

Arantor

Better question, what language packs do you have installed?

shadav

Quote from: Arantor on September 13, 2019, 04:42:58 AM
Better question, what language packs do you have installed?

english and utf 8 english

Kindred

well, most of those appear to be mod related.... which, as Arantor suggests, indicates that the mod may not have been installed in all languages.

Make sure all strings exist in both modifications.english.php and modifications.english-utf8.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."

shadav

Quote from: Kindred on September 13, 2019, 11:42:41 AM
well, most of those appear to be mod related.... which, as Arantor suggests, indicates that the mod may not have been installed in all languages.

Make sure all strings exist in both modifications.english.php and modifications.english-utf8.php

so even if they have their own language file, i should still add them to the modifications.english.php and utf8 files?

Antechinus

If they're creating undefined index errors, that means somehow the strings (assuming they exist somewhere) aren't being read by SMF. So adding them to a default languages file should fix that.

The other possibility is that that have been shunted into a function which doesn't declare $txt as a global. That may be worth checking too. Shouldn't apply to most cases, but is a possibility. If that's the problem just add $txt to the globals at the start of the function and it should be good to go.

ETA: While I think of it, might be a good idea to check for missing globals in general. For example if $modSettings is required and ain't there, that might also bork the language strings for the relevant mod.

shadav

and i'm back to this issue  :P

keep getting a recurring one
Undefined index: page_title_html_safe

I have added to both the modifications.english.php and the utf-8

$txt['page_title_html_safe'] = 'Page Title';

but still this error keeps showing up in my logs....

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shadav

8: Undefined index: page_title_html_safe
File: /Sources/Subs.php
Line: 1339

line 1339
'content' => '<img src="$1" alt="' . $context['page_title_html_safe'] . '" class="bbc_img" />',

Sir Osis of Liver

Not core code, must be from a mod.  Something's calling the index before it's defined.  If nothing's broken, you can fudge the error by defining the variable, you just have to do it in the right place (somewhere before line 1339).



if(!isset($context['page_title_html_safe']))
       $context['page_title_html_safe'] = null;



If you get it right, should eliminate the error.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shadav

thank you...that seems to have cleared out all the log errors  :D

Advertisement: