Forums / Extensions / eZ Find / Using ez find fetch in a new module

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