Jump to content

Featured Replies

Posted

I keep getting different template errors that I would never get before.

Any ideas on this one.

See image:

Could contain: Text, Page

This is the error log:

{{if $announcements = \IPS\core\Announcements\Announcement::loadAllByLocation('content')}}
	<div class='cAnnouncementsContent'>
		{{foreach $announcements as $announcement}}
		<div class='cAnnouncementContentTop ipsAnnouncement ipsMessage_{$announcement->color} ipsType_center'>
            {{if $announcement->type == \IPS\core\Announcements\Announcement::TYPE_CONTENT}}
			<a href='{$announcement->url()}' data-ipsDialog data-ipsDialog-title="{$announcement->title}">{$announcement->title}</a>
            {{elseif $announcement->type == \IPS\core\Announcements\Announcement::TYPE_URL}}
            <a href='{$announcement->url}' target="_blank" rel='noopener'>{$announcement->title}</a>
            {{else}}
            <span>{$announcement->title}</span>
            {{endif}}
		</div>
		{{endforeach}}
	</div>
{{endif}}

 

Hi,

Similar error was reported twice:

Solved:

Unsolved:

[announcementContentTop on the default theme. announcementTop + announcementContentTop on Ehren's theme.]

Edited by Luuuk

  • Author

Thanks @Luuuk but, just to make sure I'm reading it right, it's currently unsolved, correct?

First topic is solved - the error was Redis related. The second (mine) topic is not because I'm on Windows Server.

  • Community Expert

What you posted there is not an error log, it's a template. Please try disabling template caching if you have that enabled. 

Also, if you need support on a stock item, please post in the support forum 

  • Author
Just now, Marc Stridgen said:

What you posted there is not an error log, it's a template. Please try disabling template caching if you have that enabled. 

Also, if you need support on a stock item, please post in the support forum 

Thank you Marc but I'm never quite sure where to post and not get into trouble 😇

FYI, I believe my caching is already disabled? Posting image here just to make sure I have it right?

Could contain: Text, Menu

  • Community Expert

System->Settings->Advanced Configuration, template caching is what you need to disable.

If you are unsure, post in the support area. We will move it here if its unsupported. 

  • Author

Thanks for your patience. Done, now disabled (was enabled). I'll wait and see what happens. Thx again.

2 minutes ago, Giray said:

I'll wait and see what happens.

You can check if the error is still there by pasting in your browser a URL pointing to a non-existent attachment like:

https://YourSite/applications/core/interface/file/attachment.php?id=0

 

  • Author
1 hour ago, Luuuk said:

You can check if the error is still there by pasting in your browser a URL pointing to a non-existent attachment like:

https://YourSite/applications/core/interface/file/attachment.php?id=0

 

Unfortunately it is. Just tried what you suggested and I still get:

[[Template core/front/global/announcementContentTop is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

  • Community Expert
1 minute ago, Giray said:

Unfortunately it is. Just tried what you suggested and I still get:

[[Template core/front/global/announcementContentTop is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

What shows up in the logs?

  • Author

Log

TypeError: get_class(): Argument #1 ($object) must be of type object, null given in /home/myaccount/public_html/applications/core/sources/Announcements/Announcement.php:198
Stack trace:
#0 /home/myaccount/public_html/system/Theme/Theme.php(880) : eval()'d code(104): IPS\core\Announcements\_Announcement::loadAllByLocation('content')
#1 /home/myaccount/public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->announcementContentTop()
#2 /home/myaccount/public_html/system/Theme/Theme.php(880) : eval()'d code(18644): IPS\Theme\_SandboxedTemplate->__call('announcementCon...', Array)
#3 /home/myaccount/public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->widgetContainer('header', 'horizontal')
#4 /home/myaccount/public_html/system/Theme/Theme.php(880) : eval()'d code(6690): IPS\Theme\_SandboxedTemplate->__call('widgetContainer', Array)
#5 /home/myaccount/public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->globalTemplate('d09378790251aab...', '\n\n<section id='...', Array)
#6 /home/myaccount/public_html/system/Output/Output.php(748): IPS\Theme\_SandboxedTemplate->__call('globalTemplate', Array)
#7 /home/myaccount/public_html/init.php(913) : eval()'d code(26): IPS\_Output->error('We could not lo...', '2S328/1', 404, '', Array, NULL, NULL)
#8 /home/myaccount/public_html/applications/core/interface/file/attachment.php(136): IPS\cms_hook_Output->error('node_error', '2S328/1', 404, '')
#9 {main}

And backtrace

#0 /home/myaccount/public_html/system/Theme/SandboxedTemplate.php(71): IPS\_Log::log(Object(TypeError), 'template_error')
#1 /home/myaccount/public_html/system/Theme/Theme.php(880) : eval()'d code(18644): IPS\Theme\_SandboxedTemplate->__call('announcementCon...', Array)
#2 /home/myaccount/public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->widgetContainer('header', 'horizontal')
#3 /home/myaccount/public_html/system/Theme/Theme.php(880) : eval()'d code(6690): IPS\Theme\_SandboxedTemplate->__call('widgetContainer', Array)
#4 /home/myaccount/public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->globalTemplate('d09378790251aab...', '\n\n<section id='...', Array)
#5 /home/myaccount/public_html/system/Output/Output.php(748): IPS\Theme\_SandboxedTemplate->__call('globalTemplate', Array)
#6 /home/myaccount/public_html/init.php(913) : eval()'d code(26): IPS\_Output->error('We could not lo...', '2S328/1', 404, '', Array, NULL, NULL)
#7 /home/myaccount/public_html/applications/core/interface/file/attachment.php(136): IPS\cms_hook_Output->error('node_error', '2S328/1', 404, '')
#8 {main}

 

Just now, Daniel F said:

Since I'm already in your ACP and working on your other issue, I'll take this one too:) 

I thank you... while blushing 😉 Too kind!!

  • Author
1 minute ago, Daniel F said:

Images Repair GIF by getflexseal

I've always wondered if that tape works.

Anyway, checked and, indeed, nicely fixed. THANK YOU.

  • Community Expert
8 hours ago, Luuuk said:

@Daniel F

Could you tell me how it has been fixed?

It was a code fix, specifically it was related to the use of Pages when using the external dispatcher. The fix will be included in an upcoming release.

  • Author

Just found a new template error. Not sure if it's related to my previous template errors and fixed in upcoming release or not.

If I try to show an activity stream, e.g. my unread content, I get:

  1. [[Template core/front/streams/streamItems is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Is there some kind of temporary fix?

Could contain: Text, Page

  • Author

For quick reference, this is the template content. See anything...?

Note that I just tried with the default IPS theme and the problem persists.

Last point, this just suddenly started happening today, with no other changes made.

 

 

{{$currentSeparator = NULL;}}
{{if \count( $results )}}
    {{foreach $results as $result}}
        {{if $result !== NULL}}
            {{if $showTimeSeparators}}
                {{if $currentSeparator != 'earlier'}}
                    {{$separator = $result->streamSeparator( $sort == 'date' );}}
                    {{if $currentSeparator != $separator}}
                        <li class='ipsStreamItem_time' data-timeType='{$separator}'>{lang="$separator"}</li>
                        {{$currentSeparator = $separator;}}
                    {{endif}}
                {{endif}}
            {{endif}}
            {$result->html( $view, $sort != 'date', TRUE )|raw}
        {{endif}}
    {{endforeach}}
{{else}}
    {{if ! ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->before ) )}}
    <li class='ipsBox_alt ipsType_center ipsPad' data-role="streamNoResultsMessage">
        <p class='ipsType_reset ipsType_light ipsType_normal'>
            {lang="stream_no_results"}
        </p>
    </li>
    {{endif}}
{{endif}}

Edited by Giray

  • Author
11 minutes ago, Daniel F said:

It's not the template, it's the underlaying code in the announcement class which was causing this.

Thank you @Daniel F. And do you think that is what is causing this new error or should I be looking elsewhere?

4 minutes ago, Giray said:

Thank you @Daniel F. And do you think that is what is causing this new error or should I be looking elsewhere?

Yes, it's this one: 

 

  • Author

Thanks. Now the question you can't answer... fix timeframe? This one is pretty bad for anyone using this function which on my board happens to be FRONT and center 😉 I've made it into a 'see everything' button.

Could contain: Text, Flyer, Advertisement, Paper, Poster, Brochure, Page, File

  • Author

Any chance of getting a patch?

  • Author

Would the 4.7.0 Beta 6 have this fix?

Recently Browsing 0

  • No registered users viewing this page.