100 MessageIndex.template.php errors

Started by Shades., September 13, 2021, 02:57:35 AM

Previous topic - Next topic

Shades.

2.1RC4

Everytime I go to board=13 I get 100 of these and even on the child boards
QuoteError
Type of error
General
Error message
8: Trying to access array offset on value of type null
File
/home2/*****/public_html/*****/Themes/default/MessageIndex.template.php
Line
410
URL of page causing the error
https://********/index.php?board=13.0
Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Themes/default/MessageIndex.template.php on line 410
#1: template_bi_board_info()
Called from /home2/*****/public_html/*****/Themes/default/MessageIndex.template.php on line 43
#2: template_main()
Called from /home2/*****/public_html/*****/Sources/Load.php on line 2735
#3: loadSubTemplate()
Called from /home2/*****/public_html/*****/Sources/Subs.php on line 3540
#4: obExit()
Called from /home2/*****/public_html/*****/index.php on line 190
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

GL700Wing

Quote from: Shades. on September 13, 2021, 02:57:35 AM2.1RC4

Everytime I go to board=13 I get 100 of these and even on the child boards

Unlucky number maybe?   ;)
Life doesn't have to be perfect to be wonderful ...

Arantor

So what's, say, line 400 through 420 of MessageIndex.template.php?

Shades.

Quote from: Arantor on September 13, 2021, 03:52:12 AMSo what's, say, line 400 through 420 of MessageIndex.template.php?

* Outputs the board info for a standard board or redirect.
 *
 * @param array $board Current board information.
 */
function template_bi_board_info($board)
{
global $context, $scripturl, $txt;

echo '
<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">
', $board['name'], '&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" />
</a>';

// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link amt">!</a>';

echo '
<div class="board_description">', $board['description'], '</div>';
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Antechinus

Why tf is that markup nesting an anchor inside another anchor?

See: https://html.spec.whatwg.org/#the-a-element

Specifically:
QuoteContent model:
    Transparent, but there must be no interactive content descendant, a element descendant, or descendant with the tabindex attribute specified.

ETA: Actually the anchor for .subject is unclosed, so that's another issue. The linked RSS icon should definitely not be inside a.subject though.

Arantor

Add $settings to the global line.

As for the nested links... 🤷‍♂️

Shades.

That did it thanks! :)

As for the nested link thats probably the rss feed mod I installed.  ???
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Antechinus

Lolz. Sounds like a buggy mod.

ETA Just parsed the code for it here - https://custom.simplemachines.org/index.php?mod=376

Yup, it has a markup bug built in. Nice feature. :D

Antechinus

The finished markup should look like this.
<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">
', $board['name'], '
</a>
&nbsp;
<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss">
<img src="' . $settings['images_url'] . '/rss.png" alt="rss" />
</a>';

Shades.

Quote from: Antechinus on September 13, 2021, 04:43:58 AMLolz. Sounds like a buggy mod.
I use it on another 2.1 site with the same mods and it works fine. This is on the one I'm trying to upgrade from 2.0.18 and nothing is going my way lol! I get one thing fixed and something else goes wrong, It's frustrating! >:(

But I'm getting it all worked out with the help of you fine folks! ;)  8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

Quote from: Antechinus on September 13, 2021, 04:48:54 AMThe finished markup should look like this.
<a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '">
', $board['name'], '
</a>
&nbsp;
<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss">
<img src="' . $settings['images_url'] . '/rss.png" alt="rss" />
</a>';
Do I still need to add $settings to the global line?
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Antechinus

Yes, you do need $settings in the globals for that function.

Arantor

Yup, because it calls $settings for the path to images like the RSS icon.

Shades.

ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Advertisement: