view_parameters only works once

Author Message

Daniel Guerrier

Friday 16 December 2005 9:39:26 pm

For some unknown reason this code only works once in linux. Works fine on windows.
This code:

<?xml version="1.0" encoding="UTF-8"?>
<media>
{def $episode=fetch( 'content', 'object', hash( 'object_id', $view_parameters.content_id ) )}
<item>
<name>{$episode.data_map.name.content|wash()}</name>
<description>{$episode.data_map.shortdescription.content|wash()}</description>
<path>
{let site_url=ezini('SiteSettings','SiteURL') file_path=$episode.data_map.file.content.filepath}
{concat('http://', $site_url, '/', $file_path)}
{/let}
</path>
<thumbnail>
{let site_url=ezini('SiteSettings','SiteURL') image_path=$episode.data_map.thumbnail.content[original].url}
{concat('http://', $site_url, '/', $image_path)}
{/let}
{/def}
</thumbnail>
</item>
</media>

is called with this url

http://www.example.com/layout/set/episodexml/(content_id)/117

works on the first request. every request after that does not get the the content_id parameter until the content cache is cleared. This is the debug error

Error: eZTemplate @ design/s2h/templates/episodexml.tpl:18[0]  	Dec 17 2005 00:39:31

parser error @ design/s2h/templates/episodexml.tpl:18[0]
End tag "def" for function which does not accept children, ignoring tag

Error: eZTemplate 	Dec 17 2005 00:39:31

Unknown template variable 'view_parameters' in namespace ''

Error: eZModuleFunctionInfo::execute content::object 	Dec 17 2005 00:39:31

Missing parameter 'object_id' for function 'object' in module 'content'

Error: eZTemplate @ design/s2h/templates/episodexml.tpl:5[6] 	Dec 17 2005 00:39:31

Cannot retrieve attribute of a NULL

Error: eZTemplate @ design/s2h/templates/episodexml.tpl:6[13] 	Dec 17 2005 00:39:31

Cannot retrieve attribute of a NULL

Error: eZTemplate @ design/s2h/templates/episodexml.tpl:8[0] 	Dec 17 2005 00:39:31

Cannot retrieve attribute of a NULL

Error: eZTemplate @ design/s2h/templates/episodexml.tpl:13[0] 	Dec 17 2005 00:39:31

Cannot retrieve attribute of a NULL

using 3.7 on apache2/fedora2/php4.4

again it gets the url param the first time but will not receive the param again until the content cache is cleared

Daniel Guerrier

Saturday 17 December 2005 12:56:59 pm

I reduced the template down to just outputing the view_parameters.myparam and it only gets passed once per variable until I remove the content cache. The permissions are set to 770 and owned by the webserver user. That part is working fine. The only error when debug is turned on is the error stating the parameter is null on the second execution. any idea what can be the problem. again the same code works fine on windows.

Daniel Guerrier

Saturday 17 December 2005 1:12:07 pm

I've reduced everything to this and it wont take in the parameter if a cache entry exists.

{def $ep_id=$view_parameters.content_id}
{$ep_id}
{undef}

I'm getting this
Error: eZTemplate @ design/s2h/templates/episodexml.tpl:1[0] Dec 17 2005 16:12:09
Unknown template variable 'view_parameters' in namespace ''

Daniel Guerrier

Wednesday 21 December 2005 1:38:26 pm

Are any of the ez folks concerned about this one?
I would think that an issue that seems this important would get more attention.

Paul Forsyth

Thursday 22 December 2005 12:32:23 am

Try filing a bug for this.

Paul

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 15:56:51
Script start
Timing: Jan 18 2025 15:56:51
Module start 'layout'
Timing: Jan 18 2025 15:56:51
Module start 'content'
Timing: Jan 18 2025 15:56:52
Module end 'content'
Timing: Jan 18 2025 15:56:52
Script end

Main resources:

Total runtime1.4200 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 589.3438152.6250
Module start 'layout' 0.00730.0037 741.968839.4609
Module start 'content' 0.01101.4071 781.4297499.7578
Module end 'content' 1.41810.0019 1,281.187512.1641
Script end 1.4200  1,293.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.2799160.0002
Check MTime0.00140.1005160.0001
Mysql Total
Database connection0.00090.066610.0009
Mysqli_queries1.363596.0174630.0216
Looping result0.00070.0518610.0000
Template Total1.373596.720.6868
Template load0.00270.187220.0013
Template processing1.370896.535220.6854
Template load and register function0.00010.010510.0001
states
state_id_array0.00450.318010.0045
state_identifier_array0.00180.130020.0009
Override
Cache load0.00230.1635290.0001
Sytem overhead
Fetch class attribute can translate value0.00050.036020.0003
Fetch class attribute name0.00110.080250.0002
XML
Image XML parsing0.00030.018220.0001
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00570.4007100.0006
String conversion0.00000.000640.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs