Trigger Error instead of 404 Error?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
JackOutoftheBox
Forum Members
Forum Members
Posts: 89
Joined: Thu Jan 25, 2007 8:05 pm

Trigger Error instead of 404 Error?

Post by JackOutoftheBox »

I have 3 unclickable section headers in a menu, but found that if someone should happen to click the address looking for that page, they receive the following error, instead of the expected 404 (Page Not Found) error:
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1593 - trigger_error
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1415 - _fetch_resource_info
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1261 - _compile_resource
/home/content/19/8625219/html/index.php:268 - fetch
string(51) "Smarty error: unable to read resource: "tpl_top:-1"" /home/content/19/8625219/html/lib/smarty/Smarty.class.php:1593 - trigger_error
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1415 - _fetch_resource_info
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1261 - _compile_resource
/home/content/19/8625219/html/index.php:270 - fetch
string(52) "Smarty error: unable to read resource: "tpl_head:-1"" /home/content/19/8625219/html/lib/smarty/Smarty.class.php:1593 - trigger_error
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1415 - _fetch_resource_info
/home/content/19/8625219/html/lib/smarty/Smarty.class.php:1261 - _compile_resource
/home/content/19/8625219/html/index.php:269 - fetch
string(52) "Smarty error: unable to read resource: "tpl_body:-1""
Here is a page within the site: http://theewartgroup.info/resources/newsletter/
Here is the Section Header link: http://theewartgroup.info/resources/

Can anyone shed light on this for me? Do I have to adjust something within my Menu Manager template (listed below):

Code: Select all

{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
  {assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}

{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
  {repeat string='<ul class="unli">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
  {repeat string='</li><li class="separator once" style="list-style-type: none;">&nbsp;</li></ul>' times=$node->prevdepth-$node->depth}
  </li>
  {elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or $node->current == true}
  {assign var='classes' value='menuactive'}
  {if $node->parent == true}
    {assign var='classes' value='menuactive menuparent'}
  {/if}
  {if $node->children_exist == true and $node->depth < $number_of_levels}
    {assign var='classes' value=$classes|cat:' parent'}
  {/if}
  {if $node->type == 'sectionheader'}
    <li class="{$classes}"><a class="{$classes}"><span class="sectionheader">{$node->menutext}</span></a>
  {else}
    <li class="{$classes}"><a class="{$classes}"
  {/if}
{elseif $node->type == 'sectionheader' and $node->haschildren == true}
  <li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'sectionheader'}
  <li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'separator'}
  <li style="list-style-type: none;"> <hr class="menu_separator" />
{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
  <li class="menuparent"><a class="menuparent" 
{else}
  <li>
  <a 
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
{if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string='</li><li class="separator once" style="list-style-type: none;">&nbsp;</li></ul>' times=$node->depth-1}
</li>
</ul>
<div class="clearb"></div>
</div>
{/if}
Thank you for any insight you can provide.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Trigger Error instead of 404 Error?

Post by Dr.CSS »

How does someone "happen to click the address looking for that page" there are no links for it in the site?...
JackOutoftheBox
Forum Members
Forum Members
Posts: 89
Joined: Thu Jan 25, 2007 8:05 pm

Re: Trigger Error instead of 404 Error?

Post by JackOutoftheBox »

It might be unlikely, but why does it not have the traditional 404 page? Someone might mistakenly come up the link because it used to be a page on the site, and I want the traditional 404 page to appear if they do instead of a bunch of errors.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Trigger Error instead of 404 Error?

Post by Dr.CSS »

Have you tried setting up a 404 error page?...
JackOutoftheBox
Forum Members
Forum Members
Posts: 89
Joined: Thu Jan 25, 2007 8:05 pm

Re: Trigger Error instead of 404 Error?

Post by JackOutoftheBox »

Yes, it's set up and working just fine for the other pages that aren't section headers. See:

http://www.theewartgroup.info/resources/
http://www.theewartgroup.info/resources/d
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Trigger Error instead of 404 Error?

Post by Dr.CSS »

Almost looks like it is trying to pull the old page, have you cleared your site cache in admin, maybe even going to site, FTP or server file manager, and deleting all files from tmp/cache and tmp/templates_c, except the dummy index.html files...
JackOutoftheBox
Forum Members
Forum Members
Posts: 89
Joined: Thu Jan 25, 2007 8:05 pm

Re: Trigger Error instead of 404 Error?

Post by JackOutoftheBox »

I appreciate your help, but none of those worked. Any other ideas? Should I just delete them completely and start over?
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: Trigger Error instead of 404 Error?

Post by carasmo »

This strange thing is something that is found and google site search finds these section headers and then instead of a 404 error it provides a list of strange stuff such as trigger_error and the smarty_class stuff on the page. HELP!
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: Trigger Error instead of 404 Error?

Post by carasmo »

I think has something to do with the hierarchy and now that you can't turn it off, the only thing I could think of for the time being is to create a directory named the section holder (good thing I use sparingly) and put an index.php file in there with a redirect to the first page in that "directory".

Code: Select all

<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://domain.tld/sectionheader/first-page.html");
exit();
?>
Now it works great! I wish I could figure out how to do this with htaccess, so far all I get is a redirect loop.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: Trigger Error instead of 404 Error?

Post by carasmo »

Yes, I know that I could use an internal page link as the header, but with IOS devices that link will cause people to link to the top level instead of being able to click on the top level and see the choices in the menu, css hovers don't work in IOS, they need to be turned into click menus.

Code: Select all

// iOS Hover Event Class Fix - http://niteodesign.com/web-design/iphone-ipad-ios-and-the-css-hover-event/
// alternate http://blog.0100.tv/2010/05/fixing-the-hover-event-on-the-ipadiphoneipod/
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
$(".nav li a").click(function(){  // Update class to point at the head of the list
});
}


Post Reply

Return to “CMSMS Core”