Trouble with multiple modules on one extension

Trouble with multiple modules on one extension

Thursday 11 February 2010 10:40:20 am - 4 replies

Author Message

Bruce Morrison

Thursday 11 February 2010 4:30:27 pm

Hi Erik

Try replacing your extension module.ini with the following:

[ModuleSettings]
ExtensionRepositories[]=mycompany
ModuleList[]=module1
ModuleList[]=module2

The ModuleList[] line clears any previous setting and in not required, thats why you have to include the kernel entries.

See if that fixes things. There may be a policy/permissions issue, so if you still have issues can you post module.php from module1 for comparison.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Erik Weinmaster

Friday 12 February 2010 6:53:45 am

Bruce,

Thanks for the first piece of advice of eliminating the ModuleList[] line. Worked great. However, I'm still having trouble with module2. I'll try to list the contents of module.php for both in this post, but they may get a little lengthy.

Anyway, here is what my extension/mycompany/modules/module1/module.php file looks like:

<?php
$Module = array( 'name' => 'Module 1',
'variable_params' => true );
$ViewList = array();
//*********** All items that deal with viewing data ***********
$ViewList['dart_local_content_view'] = array(
'functions' => array( 'public' ),
'script' => 'dart_local_content_view.php',
'ui_context' => 'view',
'default_navigation_part' => 'ezcontentnavigationpart',
'params' => array( 'node_id' ),
'unordered_params' => array( 'dart_id' => 'dart_id' ) );

//*********** All items that deal with processing data ***********

$ViewList['process_dart_local_content'] = array(
'functions' => array( 'public' ),
'script' => 'process_dart_local_content.php',
'params' => array( 'node_id', 'corporate_id' ) );

$FunctionList['public'] = array();
$FunctionList['private'] = array();
$FunctionList['admin'] = array();
?>

The process file just processes the results of the view file and returns back to the view file, which works fine.

Now for module2/module.php:

<?php
$Module = array( 'name' => 'Module 2',
'variable_params' => true );
$ViewList = array();
$ViewList['update_list_item_locations'] = array(
'function' => array( 'public' ),
'script' => 'update_list_item_locations.php',
'ui_context' => 'administration',
'default_navigation_part' => 'ezcontentnavigationpart',
'params' => array( 'node_id' ) );
$FunctionList['public'] = array();
$FunctionList['private'] = array();
$FunctionList['admin'] = array();
?>

The primary difference in how I access the modules is that module1 has a node that directly links over to the module. Thus there is a 'view' phase before the 'process' steps. As for module2, there is no 'view' phase so an overloaded template provides the 'process'.

Hope this is somewhat clear, and thanks for the help so far,

-erik

Erik Weinmaster

Friday 12 February 2010 7:17:22 am

Bruce,

Also, here is the debug output that I'm getting when I try to access module2

Debug: eZMySQLDB::query(0.000 ms) query number per page:0 Feb 12 2010 10:13:43
SET NAMES 'utf8'
Timing: Feb 12 2010 10:13:43
Module start 'module2'
Error: error/view.php Feb 12 2010 10:13:43
Error ocurred using URI: /cccms/index.php/manage/module2/update_list_item_locations/8703
Warning: Insufficient permissions Feb 12 2010 10:13:43
Function required:
 Module : module2
 Function : 
 ClassID : 
 MainNodeID : 
Policies that didn't match:
Timing: Feb 12 2010 10:13:43
Module end 'error'

Erik Weinmaster

Wednesday 17 February 2010 10:11:46 am

In case anyone gets this far on the thread (which I doubt), the answer to this problem is a little concept called 'proof read.' The module2/module.php file that is shown above has the error. The 'function' index for 'update_list_item_locations' view array is wrong, it should be 'functions'.

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.