We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40375
    • 12 Posts
    I am working on a CMP and just started building it in the usual core and assets folders. Everything working fine but not so handy for version control so I moved everything into its own development folder (on a new install) and created the needed system settings for core and assets. I took my lead from the "Developing an Extra in MODX Revolution" tuorial.

    The "original" works as it should but the second development version us missing all lexicon strings in the EXT forms. The lexicon is loaded and cached as I can see it in lexicon manegement. Any messages from the processor come through to the console as well. For the rest the CMP operates OK so far...

    Somehow the lexicon is not getting through into javascript. Can anyone point me in the right direction here? I can't seem to find it myself.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Are you loading in the lexicon topics in your controllers?

      You may also need to update your addon its namespace (via System > Namespaces) to point to your development install instead of the main MODX core folder.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 40375
        • 12 Posts
        Yes I am loading the lexicon topics in controller.php as well as through my cmp class in its initialze method.,... actually I tried loading the lexicon topic from several places just because I was puzzled but that did not seem to make any difference.

        By the way you should be familiar with the code as my cmp is heavily borrowing from your importX. Besides rewriting startimport.php and csv.php for user import there are not that many changes to most files.

        As for the namespace... this is set to:
        ..../wamp/www/dev_revo/mbrimport/core/components/mbrimport/ and
        ..../wamp/www/dev_revo/mbrimport/assets/components/mbrimport/

        I also set a system setting mbrimport.core_path to the same above core path

        As far as I can see this should just work.... huh
          • 11055 ☆ A M B ☆
          • 3,112 Posts
          mind to share how your controller file looks like?
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 40375
            • 12 Posts
            Sure, anything to get this solved.. Thanks for the reply.

            mbrimport/assets/components/mbrimport/controller.php
            <?php
            require_once dirname(dirname(dirname(dirname(__FILE__)))).'/config.core.php';
            require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
            require_once MODX_CONNECTORS_PATH.'index.php';
             
            $corePath = $modx->getOption('mbrimport.core_path',null,$modx->getOption('core_path').'components/mbrimport/');
            require_once $corePath.'model/mbrimport/mbrimport.class.php';
            $modx->mbrimport = new mbrImport($modx);
             
            $modx->lexicon->load('mbrimport:default,user');
             
            
            $path = $modx->getOption('processorsPath',$modx->mbrimport->config,$corePath.'processors/');
            $modx->request->handleRequest(array(
                'processors_path' => $path,
                'location' => '',
            ));
            



            mbrimport/core/components/mbrimport/controllers/index.php

            <?php
            require_once dirname(dirname(__FILE__)).'/model/mbrimport/mbrimport.class.php';
            $mbrimport = new mbrImport($modx);
            $mbrimport->initialize('mgr');
            include 'header.php';
            $modx->regClientStartupScript($mbrimport->config['jsUrl'].'mgr/widget.home.panel.js');
            $modx->regClientStartupScript($mbrimport->config['jsUrl'].'mgr/widget.home.form.js');
            $modx->regClientStartupScript($mbrimport->config['jsUrl'].'mgr/section.index.js');
             
            return '<div id="mbrimport-panel-home-div"></div>';
            
              • 11055 ☆ A M B ☆
              • 3,112 Posts
              try this
              $modx->lexicon->load('mbrimport:default', 'user');
              
                Rico
                Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                MODx is great, but knowing how to use it well makes it perfect!

                www.virtudraft.com

                Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                Maintainter/contributor of Babel

                Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                • 40375
                • 12 Posts
                Sadly no difference... However I have just now made some progress in finding where it goes wrong...
                Here's an excerpt from actions.cache.php:
                <?php
                  array (
                    'id' => '80',
                    'namespace' => 'mbrimport',
                    'controller' => 'controllers/index',
                    'haslayout' => '1',
                    'lang_topics' => '',
                    'assets' => '',
                    'help_url' => '',
                    'namespace_name' => 'mbrimport',
                    'namespace_path' => 'C:/sysbin/wamp/www/dev_revo/mbrimport/core/components/mbrimport/',
                    'namespace_assets_path' => 'C:/sysbin/wamp/www/dev_revo/mbrimport/assets/components/mbrimport/',
                  ),
                


                As you can see the lang_topics is empty and looking in the modx_actions table its missing there too. After manually editing the table and deleting the whole cache my lexicon strings finally appear..

                Now I just have the question where I went wrong in the first place and how I could have solved it in the manager...
                  • 11055 ☆ A M B ☆
                  • 3,112 Posts
                  try this
                  $modx->lexicon->load('mbrimport:default', 'mbrimport:user');
                  


                  if that also doesn't work, try to check your folder structure:
                  core
                  + components
                  ++ mbrimport
                  +++ ...
                  +++ lexicon
                  ++++ en
                  +++++ default.inc.php
                  +++++ user.inc.php
                  +++ ...
                  ++ ..
                    Rico
                    Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                    MODx is great, but knowing how to use it well makes it perfect!

                    www.virtudraft.com

                    Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                    Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                    Maintainter/contributor of Babel

                    Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                    • 3749
                    • 24,544 Posts
                    I've been fighting the exact same problem for days -- finally found this thread.

                    Editing the modx_actions table and putting mycomponent:default in the lang_topics field, then manually deleting all files in the core/cache directory solved it.

                    I did not try Goldsky's second solution.

                    I suspect this code in the action/create processor:

                    'lang_topics' => '',


                    There's no code that sets that field in the processor, though it's set if you install the component via Package Manager.

                    The strange thing is that when I debugged the code of my CMP, I watched it load all my language strings into the lexicon and they persisted there. The code that implements the JS lexicon strings must iterate through the lang_topics when looking for a key, but I couldn't find it.

                    Bug filed: http://tracker.modx.com/issues/9843 [ed. note: BobRay last edited this post 13 years, 5 months ago.]
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 39448
                      • 8 Posts
                      Bob's solution worked for me too.