Custom Module not lised in "Available modules"

Discuss about Group-Office development here

Moderator: Developers

GoAlways
Posts: 125
Joined: Mon Oct 11, 2010 4:41 am

Custom Module not lised in "Available modules"

Postby GoAlways » Fri Jan 10, 2014 1:04 am

Hi,

I have an issue where I uninstalled our custom module but when I went to re-install the module it is not listed in "Available modules".

What could cause the module not to be listed ?

Our custom module is in the modules folder, and has a "scripts.txt" file that points to the MainPanel.js file as per the instructions on Custom Modules
https://www.group-office.com/wiki/Creating_a_module

Code: Select all

For the main panel to be loaded when the module is active, we'll need to create a file called scripts.txt in our /modules/presidents/views/ExtJs3/ folder. 

scripts.txt: 
modules/presidents/views/Extjs3/MainPanel.js
The topic "I cannot apply my modifications" https://www.group-office.com/forum/viewtopic.php?t=5984 speaks about "minify", is "minify" still used in Group Office 5 ? I could not find any mention of its use on the following Group Office sites so I would have to believe it has been depreciated?
https://www.group-office.com/wiki/Setup ... dule_(CMS)
https://www.group-office.com/wiki/FAQ
https://www.group-office.com/wiki/Creating_a_module

If minify is still used, what is the URL for the Group Office instructions on how to downloand the minify and how and when to use it?
GoAlways
Posts: 125
Joined: Mon Oct 11, 2010 4:41 am

Re: Custom Module not lised in "Available modules"

Postby GoAlways » Fri Jan 10, 2014 3:01 am

I believe I have found my issue. Our modules were created some time ago and did not have the "[MODULENAME]Module.php" files as specified by
https://www.group-office.com/wiki/Creat ... pty_module
Creating an empty module

Now we will create the main module class.

A Group-Office module will extend the GO_Base_Module class.

Create the file module/presidents/PresidentsModule.php

PresidentsModule.php:

class GO_Presidents_PresidentsModule extends GO_Base_Module{

public function autoInstall() {
return true;
}

public function author() {
return 'Merijn Schering';
}

public function authorEmail() {
return 'mschering@intermesh.nl';
}
}
I noticed that some modules have "autoInstall" while others do not. What is the significance ?
And what would be the significance of "autoInstall" returning true or returning false ?
<?php

class GO_Demodata_DemodataModule extends GO_Base_Module {

public function author() {
return 'Merijn Schering';
}

public function authorEmail() {
return 'mschering@intermesh.nl';
}

public function autoInstall() {
return true;
}

}
==================================================================================
<?php

class GO_Defaultsite_DefaultsiteModule extends GO_Base_Module {

public function author() {
return 'Wesley Smits';
}

public function authorEmail() {
return 'wsmits@intermesh.nl';
}

public function adminModule() {
return false;
}

public function depends() {
return array('site');
}

public function install() {

if(GO::modules()->isInstalled('site')){
$alreadyExists = GO_Site_Model_Site::model()->findSingleByAttribute('module','defaultsite');

if(!$alreadyExists){

$siteProperties = array(
//'id'=>'', ID IS AUTO INCREMENT
'name'=>GO::t('name','defaultsite'),
'user_id'=>1,
//'mtime'=>'', AUTOMATIC
//'ctime'=>'', AUTOMATIC
'domain'=>'*',
'module'=>'defaultsite',
'ssl'=>'0',
'mod_rewrite'=>'0',
'mod_rewrite_base_path'=>'/',
'base_path'=>'',
// 'acl_id'=>'0', AUTOMATIC
'language'=>''
//'files_folder_id'=>'' NOT NEEDED AUTOGENERATED
);

$defaultSite = new GO_Site_Model_Site();
$defaultSite->setAttributes($siteProperties);

$defaultSite->save();
}
}

return parent::install();
}

}
==================================================================================
mschering
Site Admin
Site Admin
Posts: 8284
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Custom Module not lised in "Available modules"

Postby mschering » Fri Jan 10, 2014 3:35 pm

Yes that file is required indeed.
Best regards,

Merijn Schering
Intermesh

Who is online

Users browsing this forum: No registered users and 2 guests

cron