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'] = ...

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 19 2025 04:29:07
Script start
Timing: Jan 19 2025 04:29:07
Module start 'layout'
Timing: Jan 19 2025 04:29:07
Module start 'content'
Timing: Jan 19 2025 04:29:08
Module end 'content'
Timing: Jan 19 2025 04:29:08
Script end

Main resources:

Total runtime0.9135 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.0060 589.0547152.6094
Module start 'layout' 0.00600.0031 741.664139.4141
Module start 'content' 0.00920.9029 781.0781503.4453
Module end 'content' 0.91200.0014 1,284.523412.8125
Script end 0.9134  1,297.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3810160.0002
Check MTime0.00160.1727160.0001
Mysql Total
Database connection0.00060.067310.0006
Mysqli_queries0.863594.5324630.0137
Looping result0.00060.0683610.0000
Template Total0.880696.420.4403
Template load0.00200.218620.0010
Template processing0.878696.182220.4393
Template load and register function0.00020.024110.0002
states
state_id_array0.00080.086110.0008
state_identifier_array0.00130.147720.0007
Override
Cache load0.00170.1822350.0000
Sytem overhead
Fetch class attribute can translate value0.00040.046520.0002
Fetch class attribute name0.00150.164350.0003
XML
Image XML parsing0.00020.026620.0001
class_abstraction
Instantiating content class attribute0.00000.001650.0000
General
dbfile0.00070.0757100.0001
String conversion0.00000.000940.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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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