TemplateCompile enabled and attributes disappear

Author Message

Heath

Sunday 01 July 2007 10:35:50 am

<b>Long Title</b>

TemplateCompile setting enabled and attribute_view_gui attributes disappear!

<b>Summary</b>

Merely in writing this one detailed document, which would accurately present the problem both in text, screenshot, settings, supporting url; I found I had found a pattern in describing the problem which matched the output surrounding my use of a feature which I was not certain was completely supported ('{attribute_view_gui attribute=$node.object.data_map.$a}').

When you have to pay for support, I always recommend one communicate clearly in the first email. This drastically improves the context and speed of email support.

<b>Problem Description</b>

In the interest of prompt development of new features the following was added to the settings of this build. These settings have been known to disable as completely as possible all available cache systems (while it does appear to work very well there may be further settings which can disable further cache sub systems as of yet unknown).

File: <i>settings/override/site.ini.append.php</i>

<b>Contents Added</b>

[ContentSettings]
ViewCaching=disabled

[TemplateSettings]
TemplateCache=disabled
TemplateCompile=disabled
DevelopmentMode=disabled
DevelopmentMode=enabled
CacheThreshold=0

<b>Error Description</b>

If I turn off all of these settings (remove them) now that development is completed I get a rather nasty artifact. The attributes of the form would disappear!

The Templates with the error were the feedback form's datatype attributes (not all but most..)
Attributes of a form dynamically called from an array here is an example. The following ...

{def $attribs=array('accept_cc','need_equip','monthly_charges','average_charge','likely_method')}
{foreach $attribs as $a}<div>{attribute_view_gui attribute=$node.object.data_map.$a}</div>{/foreach}

<b>Solution Description</b>

Replace the direct calling of the name in the previous example with another way of doing the same act.

{foreach $attribs as $a}<div>{def $a_name=$node.object.data_map.$a}{attribute_view_gui attribute=$a_name}</div>{/foreach}

I might note that only the ezstring datatype was not affected by this 'negative feature' all other datatypes were affected by this problem.

<b>Conclusion</b>

I started this process to solve this problem first by writing an email to a fictional support provider. I quickly found that after less than 5 minutes of writing a single complete (very verbose) supporting text document I had found my own solution.

Now my problem is solved, hope this helps someone else, time for a free beer!

Cheers!

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Xavier Dutoit

Monday 02 July 2007 3:14:19 am

Hi,

I noticed that node.data_map works(ed) better than node.object.data_map on some cases, even if the data_map logically belongs to the object.

X+

http://www.sydesy.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:26:33
Script start
Timing: Jan 18 2025 19:26:33
Module start 'layout'
Timing: Jan 18 2025 19:26:33
Module start 'content'
Timing: Jan 18 2025 19:26:34
Module end 'content'
Timing: Jan 18 2025 19:26:34
Script end

Main resources:

Total runtime0.6142 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0391152.6406
Module start 'layout' 0.00530.0020 740.679739.4766
Module start 'content' 0.00730.6054 780.1563541.5313
Module end 'content' 0.61270.0014 1,321.687512.1250
Script end 0.6142  1,333.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5090160.0002
Check MTime0.00140.2265160.0001
Mysql Total
Database connection0.00100.166610.0010
Mysqli_queries0.558690.9489540.0103
Looping result0.00060.0991520.0000
Template Total0.586495.520.2932
Template load0.00220.354820.0011
Template processing0.584295.120720.2921
Template load and register function0.00010.018210.0001
states
state_id_array0.00090.151310.0009
state_identifier_array0.00200.322220.0010
Override
Cache load0.00190.3072320.0001
Sytem overhead
Fetch class attribute can translate value0.00070.106220.0003
Fetch class attribute name0.00130.210640.0003
XML
Image XML parsing0.00130.210020.0006
class_abstraction
Instantiating content class attribute0.00000.001740.0000
General
dbfile0.00090.1484230.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs