FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Unused template causing compiler error
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Unused template causing compiler error [message #24717] Wed, 11 May 2005 17:38 Go to previous message
petej74 is currently offline  petej74   United States
Messages: 5
Registered: January 2005
Karma:
Junior Member
Running FUDforum 2.6.12...

Seems that removing all references to the "curtime" template in the default theme caused the template compiler to throw an error.

No source for curtime.tmpl


Poking around in the logic and playing with a theme that still contained curtime references revealed that there may be a logic error here.

If a template like "curtime" that doesn't have a src component is referenced before it is processed, then when resolve_compile() below is called, the file will already exist in the cache and will be ignoed.

If the template isn't referenced, then resolve_compile() below will try to compile it. When it finds that there is no src component (which seems perfectly valid for curtime.tmpl), it exits w/error. Changing the exit() call to a return() call fixed the issue for now without any visible side effects, but maybe I'm misunderstanding something here?

Here's the relevant code from include/compiler.inc...
    593         resolve_compile($file);
    594         if (isset($GLOBALS['file_cache'][$file]['inline'])) {
    595             continue;


    505 function resolve_compile($file)
    506 {
    507     if (isset($GLOBALS['file_cache'][$file])) {
    508         return;
    509     }
    510     resolve_refs($file, $file);
    511     resolve_inc_refs($file);
    512     if (empty($GLOBALS['file_cache'][$file]['src'])) {
    513         exit('No source for '.$file);
    514     }
    515
    516     $GLOBALS['file_cache'][$file]['compiled'] = compile_file($GLOBALS['file_cache'][$file]['src']);
    517 }

[Updated on: Wed, 11 May 2005 17:44]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Exporting messages to NNTP - unusable format
Next Topic: Blank screen when posting to newsgroups
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 22:36:03 GMT 2024

Total time taken to generate the page: 0.05608 seconds