[SOLVED] Upgrade to 1.11.4, ContentPreCompile not called

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
dbuenzli
Forum Members
Forum Members
Posts: 12
Joined: Sat Nov 12, 2011 6:07 pm

[SOLVED] Upgrade to 1.11.4, ContentPreCompile not called

Post by dbuenzli »

In my upgrade to 1.11.4, the event ContentPreCompile is never called on the content of my pages.

A little bit of logging indicates me that the code path for 'content' in this file is never taken on my content because the value of $smarty->_current_file is a kind of hash.

This problem was previously reported here. And is marked as fixed. But it doesn't appear to be on my side. Any ideas of what may have gone wrong ?

To be more precise I logged $smarty->_current_file, $result and $tpl_output of the afromentioned function. It appears at a certain point there is a $smarty->_current_file with value 'content:page_data' but at that moment the variable $tpl_output is empty:

Code: Select all

[14-Jan-2013 15:50:01 Europe/Zurich] ------------------------------------------------------------
[14-Jan-2013 15:50:01 Europe/Zurich] Precompile $smarty->_current_file: content:pagedata
[14-Jan-2013 15:50:01 Europe/Zurich] Precompile $result:
[14-Jan-2013 15:50:01 Europe/Zurich] Precompile $tpl_output:
The actual page content is called later with a hash-like $smarty->_current_file which means that the ContentPreCompile event is not generated.

Code: Select all

[14-Jan-2013 15:50:01 Europe/Zurich] ------------------------------------------------------------
[14-Jan-2013 15:50:01 Europe/Zurich] Precompile $smarty->_current_file: 3a4988ec627d8eba5ff304975c8687ef94bfff35
[14-Jan-2013 15:50:01 Europe/Zurich] Precompile $result:
[14-Jan-2013 15:50:01 Europe/Zurich] Precompile $tpl_output:Livre polyvalent [...]
N.B. This is in a context where WYSIWYG is globally disabled I tried with both {content} and {content wysiwyg='false'} in the template.

Thanks in advance for any help.
Last edited by dbuenzli on Mon Jan 14, 2013 9:08 pm, edited 1 time in total.
dbuenzli
Forum Members
Forum Members
Posts: 12
Joined: Sat Nov 12, 2011 6:07 pm

Re: Upgrade to 1.11.4, ContentPreCompile not called with con

Post by dbuenzli »

I tried on a fresh 1.11.4 install. The same problem occurs. The content of the page has a hash in $smarty->_current_file and thus doesn't generate a ContentPreCompile event in this code.

Is that a deprecated way of doing things or is it a bug ? I need to be able to distinguish between compilation of a template and compilation of content.

Here the logging code and the output log whenever the page content is compiled.

Code: Select all

function smarty_prefilter_precompilefunc($tpl_output, &$template)
{
  $smarty = $template->smarty;
        $result = explode(':', $smarty->_current_file);

  error_log('---------------------------------------------------------');
  error_log('$smarty->_current_file:' . $smarty->_current_file);
  error_log('$result:' . print_r($result, true));
  error_log('$tpl_output:' . $tpl_output);

Code: Select all

[14-Jan-2013 19:36:09 UTC] ---------------------------------------------------------
[14-Jan-2013 19:36:09 UTC] $smarty->_current_file:1ca1860526cbff457f2ebbe8ee212a1e181f1dc4
[14-Jan-2013 19:36:09 UTC] $result:Array
(
    [0] => 1ca1860526cbff457f2ebbe8ee212a1e181f1dc4
)

[14-Jan-2013 19:36:09 UTC] $tpl_output:**Wiki** //markup// ! 
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Upgrade to 1.11.4, ContentPreCompile not called with con

Post by calguy1000 »

I fixed this this morning in svn... it will be released with 2.0 or if we do another release in the 1.11.x series.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
dbuenzli
Forum Members
Forum Members
Posts: 12
Joined: Sat Nov 12, 2011 6:07 pm

Re: Upgrade to 1.11.4, ContentPreCompile not called with con

Post by dbuenzli »

Thanks for the fix ! It works.

I was trying, at the moment, to understand what was happening in CMS_Content_Block but I wasn't getting anywhere...

For those interested before the next release, the fix is easy to integrate, see the following link (as code, square brackets seems to confuse the forum software):

Code: Select all

http://viewsvn.cmsmadesimple.org/comp.php?repname=cmsmadesimple&compare[]=%2Ftrunk@8635&compare[]=%2Ftrunk@8636
Locked

Return to “[locked] Installation, Setup and Upgrade”