•  · 20 friends

Replicating Organizations module

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" ?

πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
  • 758
  • More
Replies (10)
    • Hello David Medina !

      You may use the example from this thread https://una.io/page/view-discussion?id=2131Β 

      πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
      • Β great, it looks clear, let me try it, thanks LeonidSΒ !

        πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
        • 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?

          πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
          • Please shows the content of the install/installer.php file of your module.

            πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
            • 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);

              Β  Β  }

              }

              /** @} */




              πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
              • I'm confused if you still has this line

                class BxSpacesInstaller

                You didn't change it to your BxMyModuleInstaller or what?Β 

                πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
                • 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?

                  πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
                  • Yes, David, you should replace all old prefixes in the copied module in any files there even the help.txt files :-)

                    πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
                    • Ok LeonidS, I've done it and now I have new errors... I attached "error.log"

                      πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
                      • 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');

                        πŸ’“0 πŸ˜†0 😲0 πŸ˜₯0 😠0 0
                        Not logged in users can't 'Comments Post'.
                        6
                        5
                        Labels:
                        Added:
                        Category:

                        UNA - Network Infrastructure for Communities

                        Close