Skip to main content
Topic: Post Error in 1.1 (Read 856 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Post Error in 1.1

I get the following error when I load the reply page in 1.1

    Type of error: Undefined
    Notice: Undefined index: attachments
    forum/index.php?action=post;topic=xxx.0;last_msg=yyy
    File: forum/themes/default/Post.template.php
    Line: 329

Also lines 336,740,and 741
$context['attachments'] is not defined. 

I run with attachments disabled but enabling them didn't help.  This is on an upgrade from 1.0.10 and yes I uninstalled all mods other than the various upgrades (1.0.8,1.0.9, etc.) before the upgrade.

Re: Post Error in 1.1

Reply #1
Darn, that one I guess is a big oversight on my side.
The original idea was to actually extract the parts of the template dealing with attachments and put them into different functions, but I didn't track the idea and lost track of it... :-[
Sorry about that.

As a quick workaround, I would change:
Code: [Select]
', $context['attachments']['can']['post'] ?
to:
Code: [Select]
', isset($context['attachments']) && $context['attachments']['can']['post'] ?

and:
Code: [Select]
if ($context['attachments']['can']['post'] || !empty($context['attachments']['current']))
to:
Code: [Select]
if (isset($context['attachments']) && $context['attachments']['can']['post'] || !empty($context['attachments']['current']))

Tracked at https://github.com/elkarte/Elkarte/issues/3015
Bugs creator.
Features destroyer.
Template killer.