Page 1 of 1

Uploads 1.23.3 throws template compile error

Posted: Fri Aug 05, 2016 2:49 pm
by rvwilliams
I have an upload template for the Uploads module that works perfectly well with CMSMS 2.0.1.1 and Uploads 1.20.1. However on CMSMS 2.1.4 and Uploads 1.23.3 it throws an error

Code: Select all

Syntax error in template "content:content_en"  on line 3 "

{cms_module module="Uploads" category="minutes" mode="upload"  template="my_upload" file_extensions="pdf"}
"  - Unexpected ";", expected one of: "}"

#0 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_templateparser.php(3135): Smarty_Internal_TemplateCompilerBase->trigger_template_error()
#1 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_templateparser.php(3199): Smarty_Internal_Templateparser->yy_syntax_error(25, ';')
#2 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(111): Smarty_Internal_Templateparser->doParse(25, ';')
#3 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php(273): Smarty_Internal_SmartyTemplateCompiler->doCompile('<h2><span style...')
#4 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_template.php(186): Smarty_Internal_TemplateCompilerBase->compileTemplate(Object(Smarty_Internal_Template))
#5 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(163): Smarty_Internal_Template->compileTemplateSource()
#6 /home/sites/mysite.org.uk/public_html/lib/classes/internal/class.CMS_Content_Block.php(290): Smarty_Internal_TemplateBase->fetch('content:content...', '|content_en', '65content_en')
#7 /home/sites/mysite.org.uk/public_html/tmp/templates_c/c1b18d9e612b70b38b8547563409f9a862ab2646.tpl_body.18.php(38): CMS_Content_Block::smarty_internal_fetch_contentblock(Array, Object(Smarty_Internal_Template))
#8 /home/sites/mysite.org.uk/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(182): content_57a367719d6110_75614180(Object(Smarty_Internal_Template))
#9 /home/sites/mysite.org.uk/public_html/index.php(160): Smarty_Internal_TemplateBase->fetch()
#10 {main}
The same thing happens when I omit a template, so I'm not sure that the error is within my template code. How can I find out exactly what is causing the smarty complier to throw this error? Where is {startform} defined?

Re: Uploads 1.23.3 throws template compile error

Posted: Fri Aug 05, 2016 3:05 pm
by Jo Morg
rvwilliams wrote:Syntax error in template "content:content_en" on line 3 "
This means that you have a syntax error on the page content, not on any particular template. Technically content blocks are still templates as they are parsed by smarty.
rvwilliams wrote:Unexpected ";", expected one of: "}"
For some reason there is a ";" somewhere on that page main content block that is breaking Smarty parsing.

Re: Uploads 1.23.3 throws template compile error

Posted: Sat Aug 06, 2016 8:47 am
by rvwilliams
Yes, I understood the meaning of the error message. I suspect that the error is in {startform} but I don't know where to locate it. The trace shows the start of a parse of <h2><span> and that code isn't in my template but it is on the final page as viewed in the previous version, so it can only be contained in {startform}.

Re: Uploads 1.23.3 throws template compile error

Posted: Sat Aug 06, 2016 11:24 am
by Jo Morg
Because tags are parsed and replaced recursively I don't think that is the problem. Besides, {startform} is a tag that just renders the <form...> HTML tag eventually with a few additional hidden fields. However you would probably find it on the 'my_upload' template, used explicitly by the Uploads tag call... In any case, make sure you clear the CMSMS cache, just in case.

Re: Uploads 1.23.3 throws template compile error

Posted: Sun Aug 07, 2016 5:59 am
by rvwilliams
I've tried with no template and also with the example template and, both times, the same error occurs so I don't think it's my template that is at fault.

SOLVED: Uploads 1.23.3 throws template compile error

Posted: Mon Aug 08, 2016 11:14 am
by rvwilliams
Sorry, the fault was mine. I eventually found the error and corrected it. However that then revealed a problem with the Uploads module where the code to detect a mode of 'upload' has been dropped from action_default.php, and all upload requests are treated as 'summary'. I will report this as a possible bug.