Forums / Setup & design / Error with Module

Error with Module

Author Message

Daniel Guerrier

Wednesday 17 August 2005 1:14:56 pm

I'm trying to create a module and a test run gives this message.

Error: eZModuleFunctionInfo::execute  	Aug 17 2005 16:10:04

No such function 'getDownloadCount' in module 's2htopten'

I defined a module.php with this:

<?php

$Module = array( "name" => "s2htopten" );

$ViewList = array();

?>

my function_definition.php has

<?php
$FunctionList = array();

$FunctionList['s2htopten'] = array('name' => 's2htopten',
								'operation_types' => array('read'),
								'call_method' => array('include_file' => 'extension/s2htopten/modules/s2htopten/s2htopten.php',
													   'class' => 's2htopten',
													   'method' => 'getDownloadCount' ),
                                 'parameter_type' => 'standard',
                                 'parameters' => array( array( 'name' => 'id',
                                                               'type' => 'integer',
                                                               'required' => true ) ) );

?>

I have a class file called s2htopten with this:

<?php
class s2htopten
{
	function s2htopten(){}
	
	function &getDownloadCount($id)

	{
		return array('result' => 'This better work');
	}

}


?>

When I perform a test using this code I get the message seen above:

{let testingplease=fetch( 's2htopten', 'getDownloadCount', hash( 'id', 119) )}
I hope This freakin thing works : {$testingplease}
{/let}

added the following to my site.ini:

ActiveAccessExtensions[]=s2htopten

Is there something that I am missing.
I've been going in circles and hope another set of eyes can quickly pick up the issue.

Thanks

Daniel Guerrier

Thursday 18 August 2005 7:21:05 am

anyone have an idea what might be the problem?
I started from scratch and came to the same point.

Daniel Guerrier

Friday 19 August 2005 10:38:27 am

Does anyone have an idea of what is wrong?

Daniel Guerrier

Saturday 20 August 2005 12:33:09 pm

I guess I should assume I'm on my own with this one?

Bertrand Dunogier

Sunday 28 August 2005 11:13:56 am

Err Daniel, somethins is wrong with your definition (you may have guessed that already ^^):

$Module = array( "name" => "s2htopten" );

Your module name is s2htopten, okay.$

$FunctionList['s2htopten']

You define a function named like the module (?!)

{let testingplease=fetch( 's2htopten', 'getDownloadCount', hash( 'id', 119) )}

you try to call the getDownloadCount function of the s2htopten module... and it has never been defined.

What you need is probably

$FunctionList['getDownloadCount'] = ...

eZ debug

Timing: Jan 19 2025 01:03:37
Script start
Timing: Jan 19 2025 01:03:37
Module start 'content'
Timing: Jan 19 2025 01:03:38
Module end 'content'
Timing: Jan 19 2025 01:03:38
Script end

Main resources:

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

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.8516180.8438
Module start 'content' 0.00560.6129 769.6953508.5078
Module end 'content' 0.61850.1356 1,278.2031338.7500
Script end 0.7541  1,616.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5053210.0002
Check MTime0.00140.1883210.0001
Mysql Total
Database connection0.00100.134110.0010
Mysqli_queries0.679590.09962000.0034
Looping result0.00210.27601980.0000
Template Total0.728696.620.3643
Template load0.00200.260320.0010
Template processing0.726696.356720.3633
Template load and register function0.00030.044710.0003
states
state_id_array0.00070.096410.0007
state_identifier_array0.00070.095120.0004
Override
Cache load0.00170.2227350.0000
Sytem overhead
Fetch class attribute can translate value0.00210.279830.0007
Fetch class attribute name0.00210.278150.0004
XML
Image XML parsing0.00060.078130.0002
class_abstraction
Instantiating content class attribute0.00000.001650.0000
General
dbfile0.00250.3257210.0001
String conversion0.00000.000530.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs