Path

ez projects / ezjscore / forum / general / access to a kernel module v...


Access to a kernel module via index_ajax.php

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

Alexandre Bulté

Member since:
09 January 2008

Posts: 3

Tuesday 22 September 2009 1:30:43 pm

It seems that if you try to access a kernel module (not defined in extensions) during ajax processes that go through index_ajax.php, you won't be able to access that module.

Ex: I wan't to use fetch( 'content', 'country_list' ) in a template rendered in a custom module through an ajax request. My ajax request goes through index_ajax.php. It won't be possible because the system won't find the "content" module.

A possible patch that works for me (add the kernel as a source of possible modules):




Index: index_ajax.php


===================================================================


--- index_ajax.php      (revision 44)


+++ index_ajax.php      (working copy)


@@ -217,7 +217,7 @@


 

 // Get and set module repositories


 $moduleINI = eZINI::instance( 'module.ini' );


-$globalModuleRepositories = array( );


+$globalModuleRepositories = array( 'kernel' );


 $extensionRepositories = $moduleINI->variable( 'ModuleSettings', 'ExtensionRepositories' );


 foreach ( $extensionRepositories as $repo )


 {


Up

André R

Member since:
20 August 2005

Posts: 171

Tuesday 22 September 2009 3:46:35 pm

Thanks Alexandre, fixed it as of Rev. 45 using:



$globalModuleRepositories = $moduleINI->variable( 'ModuleSettings', 'ModuleRepositories' );


--
ar

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Tuesday 26 October 2010 9:14:57 pm

slightly offtopic, but using the ezwebservicesapi extension, you can directly invoke the fetch function via an ajax call - no module or template involved

Principal Consultant International Business
Member of the Community Project Board

Up

André R

Member since:
20 August 2005

Posts: 171

Wednesday 27 October 2010 9:42:56 am

sounds safe.

--
ar

Up

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