Module executed twice [solved - coding error]

Author Message

Eric Bourgain

Tuesday 27 March 2007 2:56:37 am

I'm writing a module, and it ends with:

$Result = array();
$Result['content'] =& $tpl->fetch($template);
$Result['path'] = array(array('url' => '/room/book',
                              'text' => ezi18n('iagbooking', 'Room booking')));

I've many inputs, one is a button called, let's say 'Update rooms', and some other are of type 'image'.
When I click on the 'Update rooms' button, my module is executed twice, the second time with an empty $_POST: all the inputs are lost. When I click on one of the image button, everything is OK.
Of course, there is no redirect, nothing of that kind in the module.
When I say that the module is executed twice, the module.php is loaded twice, the template is computed twice.

Can anyone see why?

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 18:34:12
Script start
Timing: Jan 18 2025 18:34:12
Module start 'layout'
Timing: Jan 18 2025 18:34:12
Module start 'content'
Timing: Jan 18 2025 18:34:13
Module end 'content'
Timing: Jan 18 2025 18:34:13
Script end

Main resources:

Total runtime1.0707 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.0469152.6406
Module start 'layout' 0.00490.0028 740.687539.4766
Module start 'content' 0.00771.0618 780.1641401.4766
Module end 'content' 1.06950.0012 1,181.64068.1250
Script end 1.0707  1,189.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3011160.0002
Check MTime0.00130.1236160.0001
Mysql Total
Database connection0.00080.076810.0008
Mysqli_queries1.032796.4513460.0225
Looping result0.00040.0401440.0000
Template Total1.035696.720.5178
Template load0.00250.229120.0012
Template processing1.033196.485820.5166
Template load and register function0.00020.020110.0002
states
state_id_array0.00160.150710.0016
state_identifier_array0.00120.109420.0006
Override
Cache load0.00200.1914100.0002
Sytem overhead
Fetch class attribute can translate value0.00070.063610.0007
Fetch class attribute name0.00110.106710.0011
XML
Image XML parsing0.00010.009310.0001
class_abstraction
Instantiating content class attribute0.00000.000410.0000
General
dbfile0.00050.0474100.0001
String conversion0.00000.000840.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 7
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs