Path

ez projects / ezxajax / forum / general / problem: xajax_function is...


Problem: xajax_function is not defined

You need to be logged in to post messages in the forums. New users may register here.

Hakim Bouras

Member since:
12 August 2005

Posts: 11

Friday 11 April 2008 8:33:21 am

First I recall the post I wrongly posted in the general EZ developper forum.

Hi,

I created a small extension very similar to the hello_world example (with a one xajax function). Everything works fine in my development environment.

I tried to publish my new extension on my production server. I updated my extension list in the admin interface (and even regenerate the autoload - altough I am not sure it is necessary in this case).

When my template use the xajax call, I got the following error in my browser: "xajax_getResearchersByInstitute is not defined" .

Looking closer at the source of my page I find out that in the list of declaration on xajax function, the function that I added (with my extension) does not appear:

<script type='text/javascript' charset='UTF-8'>


/* <![CDATA[ */


xajax_viewfull = function() { return xajax.request( { xjxfun: 'viewfull' }, { parameters: arguments } ); };


/* ]]> */


</script>


I verify that I have my file xajax.ini file referencing my function...

Any idea about how to troubleshoot this problem ?

Thanks,
Hakim


and Kristof's answer:

Hi Hakim

Did you clear the template caches?

By the way, the ezxajax extension was moved to eZ Projects: http://projects.ez.no/ezxajax. It's better to use the dedicated forums there than the ones here. Thanks!

Kristof
Up

Hakim Bouras

Member since:
12 August 2005

Posts: 11

Friday 11 April 2008 8:44:16 am

Hi Kristof,

>>Did you clear the template caches?
Yes, I even did clear all the caches. But I still have the same problem. The access rights to the extension are also OK.

I am using the last svn version of ezXajax.

My server is running:
- ezPublish Version: 4.0.0 (4.0.0) SVN revision: 19785
- Apache / 2.2.3 (Debian)
- PHP / 5.2.0-8+etch10

Thanks for your help,
Hakim
Up

Kristof Coomans

Member since:
12 February 2004

Posts: 68

Tuesday 15 April 2008 11:15:08 pm

Hi Hakim

I suspect that another xajax.ini file is clearing the ExtensionDirectories[] or AvailableFunctions[] array setting. Do you have any other xajax extensions enabled?
If we're not able to solve the problem easily this way, I'm always happy to take a closer look if you can provide me access to your installation.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Up

Hakim Bouras

Member since:
12 August 2005

Posts: 11

Thursday 17 April 2008 11:22:43 am

Thanks to the help of Kristof...

The problem was because the name of the php file containing my xajax function had some upper case characters. To avoid the problem, only use lower case characters in the file name.

Long life to eZXajax !
Up

Kristof Coomans

Member since:
12 February 2004

Posts: 68

Thursday 17 April 2008 1:33:54 pm

I decided that we should not any longer lowercase the file name. File name specified in the ini file and the file name on the file system should now match exactly. Implemented in trunk revision 1655.

There will also be error messages in debug output now in case a certain file is not found.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Up

You need to be logged in to post messages in the forums. New users may register here.