TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:24:08 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 171
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 171
  • Total: 172
  • tino

Undefined index: forum_name

Started by leftezi, November 02, 2016, 12:29:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

leftezi

SMF version: SMF 2.0.12
TP version: TP 1.2
Default Forum Language: Greek UTF8
Theme name and version: Curve (Default)
Related Error messages:

....index.php?action=dlattach;attach=7959;type=avatar
8: Undefined index: forum_name
File: ...Themes/default/languages/TPortal.english.php
Line: 305


line 305 is:
==>305:   $txt['whoall_forum'] = 'Viewing the board index of <a href="' . $scripturl . '">' . $context['forum_name'] . '[/url].';


and

..../index.php?action=dlattach;attach=9716;type=avatar
8: Undefined index: forum_name
File: ...Themes/default/languages/TPortal.greek-utf8.php
Line: 291


line 291 is:
==>291:$txt['whoall_forum'] = 'Εμφάνιση του καταλόγου του φόρουμ του <a href="' . $scripturl . '">' . $context['forum_name'] . '[/url].';


There are thousands of this errors

illori

this has been reported a few times and the only real fix we have found is to move avatars out of the attachments folder. it will solve the issue and may help with performance on your forum. it is not an ideal fix but SMF 2.1 is going this way moving forward anyway. http://www.simplemachines.org/community/index.php?topic=197938.0

bloc

I would think putting a small logic in there might help with the error. Have you guys tried exchanging:

$txt['whoall_forum'] = 'Viewing the board index of <a href="' . $scripturl . '">' . $context['forum_name'] . '</a>.';

with:

$txt['whoall_forum'] = 'Viewing the board index of <a href="' . $scripturl . '">' . (!empty($context['forum_name']) ? $context['forum_name'] : '*') . '</a>.';

illori

that does seem to resolve the error, but i wonder what is causing it in the first place and why not everyone that has the $context['forum_name'] defined has this error.

bloc

Well, the attach/download routine of avatars skips quite abit of code normally introduced in other actions. $context['forum_name'] probably never gets set...or at least not in every scenario.

leftezi

Sorry for my late answer. Although i have notifications turned on for the topic, i received no email notification.

Thank you all for your time and special thanks to Bloc.  O0

The solution with the code was easier for me. I replaced the code and now i have no errors.