View previous topic :: View next topic |
Author |
Message |
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Aug 04, 2014 5:50 pm Post subject: |
|
|
It does look like that "SIDEMENU" is used as array element of of a template variable, but it is not defined. I think it's not related to this topic. |
|
Back to top |
|
TilmP Smarty Rookie
Joined: 04 Aug 2014 Posts: 8
|
Posted: Tue Aug 05, 2014 6:57 am Post subject: |
|
|
The only thing I changed in our webapp is that I exchanged Smarty 3.14 with Smarty 3.19. Using Smarty 3.14 all our integrated templates are working fine.
If (using 3.19) I comment out on page/smarty constructor the line:
#$this->inheritance_merge_compiled_includes = false;
I get other error message:
Exception: Syntax error in template "styles\default\templates\common\layout.html" on line 164 "{if $LAYOUT.HTML}{include "modules/{$TABS.ACTIVE}/{$LAYOUT.HTML}.html"}{/if}" variable template file names not allow within {block} tags
These are the related template lines:
163 {block name="body"}
164 {if $LAYOUT.HTML}{include "modules/{$TABS.ACTIVE}/{$LAYOUT.HTML}.html"}{/if}
165 {/block}
What has been changed within SMARTY environment that now causes these errors? What can I do to get rid of these errors and can update to Smarty 3.19? Thanks for the advices! |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Aug 05, 2014 7:51 pm Post subject: |
|
|
Do not comment out $this->inheritance_merge_compiled_includes = false;
The notice is caused by an access to an undefined array index. Somewhere you must have a variable access like
Where FOO is a placeholder for some real variable which has array index SIDEMENU not defined.
Maybe it did not popup with 3.1.14 because you did suppress E_NOTICE errors in that enviroment? |
|
Back to top |
|
TilmP Smarty Rookie
Joined: 04 Aug 2014 Posts: 8
|
Posted: Wed Aug 06, 2014 7:46 am Post subject: |
|
|
It's the same environment (only changing the used Smarty).
- Our development environment is XAMPP1.7.7/PHP5.3.8,
- Using Smarty 3.1.14, no issues, pages are generated stable,
- Exchanging 3.1.14 with 3.1.19 I receive these warning/errors:
a. (NOT setting $this->inheritance_merge_compiled_includes = false ).
Message: "Exception: Syntax error in template "styles\default\templates\common\layout.html" on line 164 "{if $LAYOUT.HTML}{include "modules/{$TABS.ACTIVE}/{$LAYOUT.HTML}.html"}{/if}" variable template file names not allow within {block} tags"
b. (setting $this->inheritance_merge_compiled_includes = false ).
Message:"PHP Notice: in file Smarty-3.1.19/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 86: Undefined index: SIDEMENU"
How can it happen that I see different behavior from the webapp if only the Smarty version changes? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Aug 06, 2014 5:27 pm Post subject: |
|
|
a.) Using variable file names within {block} tags could create the problem that when the filename was changed a wrong subtemplate got displayed.
For that reason this case is now catched by an error.
With $this->inheritance_merge_compiled_includes = false; this case can be handled. (See the inheritance release notes).
b.) This is a different problem. I currently have no idea why you did not see this notice in 3.1.14 unless your server has a different setting of the error reporting level.
It's caused by an arry variable which does use index 'SIDEMENU' which is not defined. Search for the usage of 'SIDEMENU' in your templates and make sure the the variable has that index defined. |
|
Back to top |
|
TilmP Smarty Rookie
Joined: 04 Aug 2014 Posts: 8
|
Posted: Thu Aug 07, 2014 12:11 pm Post subject: |
|
|
- if I introduce "isset checks" like
{if isset($TABLEFILTER) && $TABLEFILTER} these segments are not complaint anymore. There seems to be introduced "code eval" into Smarty-3.1.19\sysplugins\smarty_internal_templatebase.php ?
- Smarty 3.14 seems to be more "tolarant" as of accepting if elements like
{if $LAYOUT.MODAL_DIALOG || $LAYOUT.MODAL_POPUP}
- The webapp based on SMARTY has been handed over to me with more than 300 templates (using inheritance)! I found more than 300 if elements to be taken care of ...
- If I plan to update to 3.19 what else (except for stricter checking) has to be considered for our webapp sources to successfully migrate from 3.14 -> 3.19? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
|