Using ez find fetch in a new module

Author Message

Saad Tazi

Monday 17 August 2009 7:29:31 am

Hi,
I'm new to eZ Publish, so this is probably a really stupid question, but I can't figure out how to solve my problem...

I'm trying to develop a new extension (one simple module), and I want to use the ez find fetch function.
So I tried to follow this tutorial (http://ez.no/developer/articles/an_introduction_to_developing_ez_publish_extensions) which helped me a lot for the module creation. The problem is that when I call the ezfinc fetch function, I got that error in the ez Debug logs:

parser error @ extension/twsearch/design/standard/templates/page/recipesearch.tpl:7
($) expected at [{def $recipes = fetch( ezfind , search ,  hash ('query', 'banana'))})]

I tried "regular" fetch functions ("content") in the same template, it works.

Here is my template:


test template filter:{$filter} -  keyword: {$keyword}!! <-- this works

{def $recipes = fetch( ezfind , search ,  hash ('query', 'banana'))}

Here is my module.php file:

<?php
 
// Introduction in the development of eZ Publish extensions
 
$Module = array( 'name' => 'Recipe Search' ); 
$ViewList = array();
 
// new View list with 2 fixed parameters and 
// 2 parameters in order 
// http://.../modul1/list/ $Params['ParamOne'] /
// $Params['ParamTwo']/ param4/$Params['4Param'] /param3/$Params['3Param'] 
 
 
$ViewList['result'] = array( 'script' => 'result.php', 
                           'functions' => array( 'read' ), 
                           'params' => array(),
                           'unordered_params' => array('filter' => 'filter',
                                                       'keyword' => 'keyword') );
 
// The entries in the user rights 
// are used in the View definition, to assign rights to own View functions 
// in the user roles
 
$FunctionList = array(); 
$FunctionList['read'] = array(); 
 
?>

site.ini.append.php:

[ExtensionSettings]
ActiveExtensions[]

ActiveExtensions[]=twsearch
ActiveExtensions[]=ezfind

I probably need to include the functions from ezfind, but I don't know how...

Thanks in advance,

Saad

Saad Tazi

Wednesday 19 August 2009 6:15:07 am

Oops, sorry, my bad: it works now...
What I did: I followed the new jacextension source code for 4.x (downloaded here: http://projects.ez.no/jacextension), cleared my cache (again), regenerate the autoload array (again)...
It was probably because of the autoload and a cachething... or maybe just a typo issue...

Thanks

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

Main resources:

Total runtime0.4484 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.1953152.6406
Module start 'layout' 0.00530.0043 741.835939.4766
Module start 'content' 0.00960.4371 781.3125437.2422
Module end 'content' 0.44670.0016 1,218.554712.1328
Script end 0.4483  1,230.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.8020160.0002
Check MTime0.00160.3510160.0001
Mysql Total
Database connection0.00080.187810.0008
Mysqli_queries0.402789.8180540.0075
Looping result0.00050.1219520.0000
Template Total0.414792.520.2073
Template load0.00250.565220.0013
Template processing0.412191.917620.2061
Template load and register function0.00040.080110.0004
states
state_id_array0.00090.209510.0009
state_identifier_array0.00070.160620.0004
Override
Cache load0.00200.4458230.0001
Sytem overhead
Fetch class attribute can translate value0.00060.135110.0006
Fetch class attribute name0.00240.527920.0012
XML
Image XML parsing0.00020.033510.0002
class_abstraction
Instantiating content class attribute0.00000.002520.0000
General
dbfile0.00070.1588100.0001
String conversion0.00000.001840.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/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: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs