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:
09 January 2008

Posts: 9

Thursday 10 April 2008 11:33:21 pm

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'>














































Up

Hakim Bouras

Member since:
09 January 2008

Posts: 9

Thursday 10 April 2008 11:44:16 pm

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:
09 January 2008

Posts: 66

Tuesday 15 April 2008 2: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:
09 January 2008

Posts: 9

Thursday 17 April 2008 2: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:
09 January 2008

Posts: 66

Thursday 17 April 2008 4:33:54 am

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.