We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37286
    • 160 Posts
    This is driving me crazy. I have a new install of Revo 2.3.3. I took several files from an addon I started over a year ago and placed them into this new development environment. After several modifications the grid renders and everything looks like it's supposed to, except I have an "Access denied." across the middle of my grid. I have a combo box that is populated by one of my processors, but it returns a popup window that states:
    Code: 200 OK
    {"success":false,"message":"Access denied.","total":0,"data":[],"object":{"code":401}}

    I found this post discussing a similar issue, but I'm not sure if it applies here, or if it does how I could apply it: https://github.com/modxcms/revolution/issues/831

    I do know that the connector.php file is getting triggered by echoing back a result in my firebug, but when I place code in the processor itself to place a line in my error log, I get no results. This leads me to believe that I'm not getting past the handleRequest and I can't work out why?

    /* handle request */
    $path = $modx->getOption('processorsPath',$modx->mp->config,$corePath.'processors/');
    $modx->request->handleRequest(array(
        'processors_path' => $path,
        'location' => '',
    ));


    This question has been answered by insomnix. See the first response.

      • 3749
      • 24,544 Posts
      If this is an extra that runs in the front end, you'll need to log in through the Login snippet in the front end before any of the processors will work.
        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
        • 37286
        • 160 Posts
        Right now I'm just trying to get the CMP pages working. Currently no front end.
          • 3749
          • 24,544 Posts
          How is your action specified?

          What are you using for the URL?
            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
            • 37286
            • 160 Posts
            Shortened the code to make it easier to read. URL is passed and it's triggering the connector.php, it just isn't triggering the processors.
            MP.grid.Entities = function(config) {
                config = config || {};
                Ext.applyIf(config,{
                    id: 'mp-grid-entities'
                    ,url: MP.config.connectorUrl
                    ,baseParams: { action: 'mgr/entities/getlist' }
                    ,fields: ['entity_id','menu']
                    ,paging: true
                    ,remoteSort: true
                    ,anchor: '97%'
                    ,columns: []
                    ,tbar:[]
                });
                MP.grid.Entities.superclass.constructor.call(this,config)
            };
            Ext.extend(MP.grid.Entities,MODx.grid.Grid);
            Ext.reg('mp-grid-entities',MP.grid.Entities);
            
              • 3749
              • 24,544 Posts
              I don't see anything obvious that would cause trouble. The popup's contents suggest that a processor is running (otherwise, you wouldn't have a JSON response). Try commenting out any permissions checks in the processor.
                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
                • 37286
                • 160 Posts
                One of my combo boxes has the same error, and it's processor is about as simple as it gets. I am retrieving a list of snippets from a specific category.
                $start= $modx->getOption('start', $scriptProperties, 0);
                $limit= $modx->getOption('limit', $scriptProperties, 20);
                $sort= $modx->getOption('sort', $scriptProperties, 'name');
                $dir= $modx->getOption('dir', $scriptProperties, 'ASC');
                $search= $modx->getOption('query', $scriptProperties,'');
                $id= $modx->getOption('id', $scriptProperties, false);
                
                $query= $modx->newQuery('modSnippet');
                $query->innerJoin('modCategory','modCategory',array('`modCategory`.`id` = `modSnippet`.`category`'));
                $query->where(array('`modCategory`.`category`'=>'mp'));
                
                $count= $modx->getCount('modSnippet',$query);
                //$query->sortby($sort, $dir);
                $query->limit($limit, $start);
                
                $snippets= $modx->getCollection('modSnippet', $query);
                
                $list= array();
                foreach($snippets as $snippet) {
                	$list[]= $snippet->toArray();
                }
                return $this->outputArray($list, $count);

                The rest of the processors currently call the standard modObjectGetListProcessor.

                Might my folder structure come into play? It looks something like:
                -dev_folder
                --my_test_site
                ---core
                ---assets
                ---(etc)
                --my_new_addon
                ---core
                ---assets
                ---config.core.php
                ---(etc)

                config.core.php:
                define('MODX_CORE_PATH', dirname(__DIR__).'/my_test_site/core/');

                with the default MODX_CONFIG_KEY

                Grasping at straws here...
                  • 3749
                  • 24,544 Posts
                  If you're running it as a CMP, the namespace path for your CMP is critical in newer versions of MODX.
                    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
                  • discuss.answer
                    • 37286
                    • 160 Posts
                    Namespace looks good, grid wouldn't render at all otherwise. Is their something new I need to pass to the connector or maybe a permissions check that needs to be done in the connector that didn't exist before 2.3.3?
                      • 3749
                      • 24,544 Posts
                      There are permissions checks in the all processors, but AFAIK, not in the connector.
                        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