Hi UNA I've found very useful Organizations module and I need to have other module with the same functionality but with other name and without losing Organizations module... how can we do it in a "easy way" ?
Comments
Hi UNA I've found very useful Organizations module and I need to have other module with the same functionality but with other name and without losing Organizations module... how can we do it in a "easy way" ?
Hello David Medina !
You may use the example from this thread https://una.io/page/view-discussion?id=2131
great, it looks clear, let me try it, thanks LeonidS !
Hi LeonidS, UNA .
I am trying to replicate and I've fixed all that is indcated in
https://una.io/page/view-discussion?id=2131
But I am getting this error when I try to install "mymodule"
2020/10/20 00:57:00 [error] 989#989: *278987 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class 'BxMyModuleInstaller' not found in /var/www/clients/client1/web4/web/studio/classes/BxDolStudioInstallerUtils.php:278
Stack trace:
#0 /var/www/clients/client1/web4/web/studio/classes/BxDolStudioStore.php(148): BxDolStudioInstallerUtils->perform('bx/mymodule/', 'install', Array)
#1 /var/www/clients/client1/web4/web/studio/template/scripts/BxBaseStudioStore.php(17): BxDolStudioStore->__construct('')
#2 /var/www/clients/client1/web4/web/modules/boonex/decorous/data/template/studio/scripts/BxTemplStudioStore.php(16): BxBaseStudioStore->__construct('')
#3 /var/www/clients/client1/web4/web/studio/store.php(21): BxTemplStudioStore->__construct('')
#4 {main}
thrown in /var/www/clients/client1/web4/web/studio/classes/BxDolStudioInstallerUtils.php on line 278" while reading response header from upstream, client: 100.111.222.333, server: myserver.com, request: "POST /studio/store.php HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/web4.sock:", host: "myserver.com", referrer: "https://xx.myserver.com/studio/store.php"
Any idea of this error?
Please shows the content of the install/installer.php file of your module.
Hi LeonidS, here is the content of install/installer.php of mymodule
I took Spaces as my initial module
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defdroup Spaces Spaces
* @indroup UnaModules
*
* @{
*/
class BxSpacesInstaller extends BxBaseModProfileInstaller
{
function __construct($aConfig)
{
parent::__construct($aConfig);
}
}
/** @} */
I'm confused if you still has this line
class BxSpacesInstaller
You didn't change it to your BxMyModuleInstaller or what?
Not yet... now I understand I need to change it in that file... I am following instructions in
https://una.io/page/view-discussion?id=2131
In what other files do I need to make changes?
Yes, David, you should replace all old prefixes in the copied module in any files there even the help.txt files :-)
Ok LeonidS, I've done it and now I have new errors... I attached "error.log"
BTW - If the original module is left to work on UNA site too then you need to make the unique URI for the pages in the records like:
INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES('new_page', '_new_title_system', '_new_title', 'module', 5, 2147483647, 1, 'new-uri', 'page.php?i=new-uri', '', '', '', 0, 1, 0, 'NewPrefixPageBrowse', 'modules/vendor/module/classes/NewPrefixPageBrowse.php');