Home »
FUDforum Development »
Bug Reports »
Unused template causing compiler error
Unused template causing compiler error [message #24717] |
Wed, 11 May 2005 17:38  |
petej74
 Messages: 5 Registered: January 2005
Karma: 0
|
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
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 07 18:04:59 GMT 2025
Total time taken to generate the page: 0.05961 seconds