Forums / Setup & design / $module_result.content is empty!

$module_result.content is empty!

Author Message

Matthew Dawkins

Friday 06 May 2011 1:25:29 am

I'm trying to create a new template for my vanilla EZP 4.4.0. I've created the pagelayout.tpl and put it in the correct place, and changed the site.ini.append.php file to use my test design. However, when I try to view my home page it doesn't show any content.

The template is very minimal, for testing purposes, as follows:

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
<head>
 
<style type="text/css">
    @import url({'stylesheets/core.css'|ezdesign});
    @import url({'stylesheets/debug.css'|ezdesign});
</style>
 
{include uri='design:page_head.tpl'}
 
</head>
 
<body>
<p>Testing.</p>
{$module_result.content}
 
<!--DEBUG_REPORT-->
 
</body>
</html>

In the site.ini.append.php file I have the following:

[DesignSettings]
SiteDesign=minimal

When I view the home page, the template itself loads fine. The header meta content is populated, the fallback stylesheets are imported, my test paragraph is shown, but {$module_result.content} doesn't return anything at all. Why might that be?

If I change the template back to ezwebin my content shows perfectly, so it's not an issue with the page content itself. I've tried modifying the page content and re-saving, but that's not helped either. I've tried clearing all the caches, and that doesn't help. I've created another page in EZP, and that content shows up fine with the above template, so it's only the home page that's having problems. I've tried using {$module_result.node_id} and that correctly shows 2, so $module_result itself is fine. I've also tried {$module_result|attribute(show)}, which displays a complete overview of the whole object, and shows that everything else is fine except the content part, which is an empty string. I've even tried rebooting Apache, in desperation.

So any suggestions as to why {$module_result.content} might be empty, but only for my template? Is there an override setting I've missed?

Marko Žmak

Friday 06 May 2011 1:58:52 am

It seems like template override problem, maybe the override template used to render the homepage is empty. Try identifying which override template is used for displaying homepage by using DebugOutput and ShowUsedTemplates ini settings. And then loook at the content of this template.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Matthew Dawkins

Friday 06 May 2011 2:06:07 am

The debug information tells me that two templates were used to render the page:

1 pagelayout.tpl <No override> design/minimal/templates/pagelayout.tpl    
1 setup/debug_toolbar.tpl <No override> design/standard/templates/setup/debug_toolbar.tpl    

That's as I expected, and that first one is the template shown in my original post. As I say, the rest of the template is loading fine, it's just the $module_result.content that isn't.

Marko Žmak

Friday 06 May 2011 3:30:37 am

Try clearing all the cache and then reloading the page. You should have a larger list of used templates then.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Matthew Dawkins

Friday 06 May 2011 3:51:01 am

Actually no, I shouldn't. The only templates that should be used are the minimal pagelayout.tpl as shown above, the page_head.tpl fallback (which I haven't changed or overridden), and debug_toolbar.tpl. There really is nothing else going on here. In fact, I've now removed the page_head.tpl, just in case, so the only thing I'm using is my own page_layout.tpl.

I'm still not convinced it's a template issue, because the template as a whole is working fine (and I've done other tests to confirm that it's working). The issue here is the $module_result.content doesn't actually contain any data.

Is there another way of getting the page content, other than $module_result.content?

Matthew Dawkins

Tuesday 10 May 2011 7:46:28 am

I've done some more digging around, and the rest of the site appears to be unaffected by this problem - it's only the home page that is empty.

Furthermore, I can confirm that $module_result itself is being generated, and I can get to most of the attributes inside it. However, the content attribute is not being filled. I've been playing around with overrides, but since the content isn't being filled nothing I did would show anything anyway! $module_result.path isn't being populated either, I notice.

Could it be a corrupted database? Or a siteaccess setting that's wrong? Any help would be appreciated.

eZ debug

Timing: Jan 17 2025 22:53:06
Script start
Timing: Jan 17 2025 22:53:06
Module start 'content'
Warning: PHP: E_DEPRECATED Jan 17 2025 22:53:07
trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ze/public_html/share.se7enx.com/var/community/cache/template/compiled/table-c0a31fef795ad927ef08940ddf2d392f.php on line 147
Timing: Jan 17 2025 22:53:07
Module end 'content'
Timing: Jan 17 2025 22:53:07
Script end

Main resources:

Total runtime0.7541 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.7266180.8438
Module start 'content' 0.00520.6237 768.5703592.9531
Module end 'content' 0.62890.1251 1,361.5234341.6094
Script end 0.7540  1,703.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5149210.0002
Check MTime0.00140.1867210.0001
Mysql Total
Database connection0.00090.114210.0009
Mysqli_queries0.652286.48312030.0032
Looping result0.00200.26482010.0000
Template Total0.728096.520.3640
Template load0.00210.273820.0010
Template processing0.725996.263320.3630
Template load and register function0.00020.024710.0002
states
state_id_array0.00080.109010.0008
state_identifier_array0.00160.213420.0008
Override
Cache load0.00180.2331430.0000
Sytem overhead
Fetch class attribute can translate value0.00140.183930.0005
Fetch class attribute name0.00100.128770.0001
XML
Image XML parsing0.00400.534630.0013
class_abstraction
Instantiating content class attribute0.00000.002480.0000
General
dbfile0.01261.6738290.0004
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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/ezxmltags/td.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/td.tplEdit templateOverride template
2content/datatype/view/ezxmltags/tr.tpl<No override>extension/community/design/community/templates/content/datatype/view/ezxmltags/tr.tplEdit templateOverride template
1content/datatype/view/ezxmltags/table.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/table.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs