Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted June 7, 20222 yr I keep getting different template errors that I would never get before. Any ideas on this one. See image: 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}}
June 7, 20222 yr Hi, Similar error was reported twice: Solved: Unsolved: [announcementContentTop on the default theme. announcementTop + announcementContentTop on Ehren's theme.] Edited June 7, 20222 yr by Luuuk
June 7, 20222 yr Author Thanks @Luuuk but, just to make sure I'm reading it right, it's currently unsolved, correct?
June 7, 20222 yr First topic is solved - the error was Redis related. The second (mine) topic is not because I'm on Windows Server.
June 7, 20222 yr 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
June 7, 20222 yr Author 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?
June 7, 20222 yr 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.
June 7, 20222 yr Author Thanks for your patience. Done, now disabled (was enabled). I'll wait and see what happens. Thx again.
June 7, 20222 yr 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
June 7, 20222 yr Author 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.]]
June 7, 20222 yr Community Expert 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?
June 7, 20222 yr Since I'm already in your ACP and working on your other issue, I'll take this one too:)
June 7, 20222 yr 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} 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!!
June 7, 20222 yr Author I've always wondered if that tape works. Anyway, checked and, indeed, nicely fixed. THANK YOU.
June 7, 20222 yr Community Expert @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.
June 13, 20222 yr 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: [[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?
June 13, 20222 yr 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 June 13, 20222 yr by Giray
June 13, 20222 yr It's not the template, it's the underlaying code in the announcement class which was causing this.
June 13, 20222 yr Author 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?
June 13, 20222 yr 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:
June 13, 20222 yr 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.