Forums / General / Xajax not loading

Xajax not loading

Author Message

Massimo Sanna

Wednesday 02 April 2008 9:16:00 am

Hi there,
I'm working on a website which uses xajax to manage dynamic comments. In production it works fine, but then I moved it to development and it won't load the headers.

The website was a 3.8.6, which I just upgraded to 3.9.4, but the problem remains.
I updated xajax from 1.0 to 1.1, and I copied the standard xajax.ini in /settings (the root one).

Then I have an extension called ajax_comments which is supposed to post the new comments with AJAX, and in the settings folder of this extension there's another xajax.ini.append.php which declares the functions. This is its content:

<?php /* #?ini charset="iso-8859-1"?

[ExtensionSettings]
ExtensionDirectories[]=ajax_comments
AvailableFunctions[refresh_comments]=refreshComments
AvailableFunctions[add_comment]=addComment

*/ ?>

I don't get many clues from the debug output:

Warning: eZTemplate  	Apr 02 2008 16:59:48
Operator 'xajax_javascript' is not registered

Warning: eZTemplate 	Apr 02 2008 16:59:48
Operator 'ezstr_replace' is not registered

Warning: eZTemplate 	Apr 02 2008 16:59:48
Operator 'ezstr_replace' is not registered

Warning: eZTemplate 	Apr 02 2008 16:59:48
Operator 'ezstr_replace' is not registered

Warning: eZTemplate 	Apr 02 2008 16:59:48
Operator 'ezstr_replace' is not registered

As you can see also ezstr_replace is not loading properly for some reason. The rest of extensions is working fine instead.

This is site.ini.append.php in /settings/override:

[ExtensionSettings]
ActiveExtensions[]
ActiveExtensions[]=includer
ActiveExtensions[]=ezdhtml
ActiveExtensions[]=strip_tags
ActiveExtensions[]=str_replace
ActiveExtensions[]=ajax_comments
ActiveExtensions[]=xajax
ActiveExtensions[]=simpleselection
ActiveExtensions[]=formsonfly

I don't have any clue about what to look at.... any suggestions? :(

Thanks in advance
Max

Kristof Coomans

Thursday 03 April 2008 5:15:14 am

Hi

Had private talk with Massimo and he was able to solve the problem already.

The debug output says that it was unable to find the xajax_javascript operator. Apparently one of the other extensions or settings/override/site.ini.append.php had a setting that clears the array used for template function/operator autoload paths:

[TemplateSettings]
AutoloadPathList[]

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

Jorge estévez

Thursday 19 June 2008 7:58:45 am

Hi anyone
This is my problem....

I already have my site finished, but now I’m trying to plug it with xajax 1.1.
I have this PHP code (from the eZ forum):

function xxxx($object_id) {

// HTTP Response
$objResponse = new xajaxResponse();

// template init
$tpl =& templateInit();

// Add Variable to the template
$tpl->setVariable(’object_id’, $object_id);

// fetch template
$html = $tpl->fetch(
“extension/mod_myextension/design/standard/templates/foo/bar.tpl” );

$objResponse->addAssign(”mydiv”, “innerHTML”, $html);

// response
return $objResponse;
}

I need to know where to write this code, and how can I invoke this function from any of my links, given the objectID of the node which content will be shown.
Plase, any hints will be really appreciated because we are almost in deadline of our project.
thanks in advance,
Marcel

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Mickael Robin

Tuesday 25 November 2008 3:05:52 am

Another "tip" for ezxajax troobleshooting : don't forget to add the pagelayout code below in the head part of <b>every pagelayout.tpl you use</b> (ie. don't forget \design\admin\templates\pagelayout.tpl )

As explained in the doc, the code is :

{cache-block ignore_content_expiry expiry=0}
{xajax_javascript()}
{/cache-block}
<c/ode>