We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43957
    • 79 Posts
    I've still not managed to get to the bottom of the ImageTV not working in Newspublisher. I've tinkered a little more and removed
    &contexts=`web,mgr`
    from the snippet call. When I login from the front end it then present me with the manager login as expected.

    If I view the source on this page there is no minify in the path names for css or js. However, when I log in to the manager from that page then it still fails to load the resource browser. If I debug with Chrome these are the errors I get in the console:

    Failed to load resource: the server responded with a status of 400 (Bad Request) http://www.example.com/manager/min/?f=/manager/assets/ext3/adapter/e…ase.js,/manager/assets/ext3/ext-all.js,/manager/assets/modext/core/modx.js
    Uncaught ReferenceError: MODx is not defined lang.js.php:2
    Uncaught ReferenceError: Ext is not defined modx.config.js.php:1
    Uncaught ReferenceError: Ext is not defined modx.localization.js:1
    Uncaught ReferenceError: Ext is not defined utilities.js:1
    Uncaught ReferenceError: MODx is not defined modx.component.js:1
    Uncaught ReferenceError: Ext is not defined modx.panel.js:1
    Uncaught ReferenceError: MODx is not defined modx.tabs.js:1
    Uncaught ReferenceError: MODx is not defined modx.window.js:10
    Uncaught ReferenceError: Ext is not defined modx.tree.js:1
    Uncaught ReferenceError: Ext is not defined modx.combo.js:1
    Uncaught ReferenceError: Ext is not defined modx.grid.js:1
    Uncaught ReferenceError: MODx is not defined modx.console.js:1
    Uncaught ReferenceError: Ext is not defined modx.portal.js:1
    Uncaught ReferenceError: MODx is not defined modx.treedrop.js:1
    Uncaught ReferenceError: MODx is not defined windows.js:9
    Uncaught ReferenceError: MODx is not defined modx.tree.resource.js:9
    Uncaught ReferenceError: MODx is not defined modx.tree.element.js:9
    Uncaught ReferenceError: MODx is not defined modx.tree.directory.js:9
    Uncaught ReferenceError: MODx is not defined modx.view.js:10
    Uncaught ReferenceError: Ext is not defined modx.layout.js:9
    Uncaught ReferenceError: Ext is not defined index.php:30
    Uncaught ReferenceError: MODx is not defined modx.np.browser.js:2
    Uncaught ReferenceError: Ext is not defined index.php:46
    


    I still have minify turned off in MODX, so still can't figure this out. Can anyone else try this to see if they get minify occuring on the manager login with Newspublisher?

    I'm on a shared hosting with Godoody, is that likely to be a curse?

    Many thanks. [ed. note: dave-b last edited this post 13 years, 3 months ago.]
      • 3749
      • 24,544 Posts
      Is there anything in .htaccess or php.ini related to compression?

        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
        • 43957
        • 79 Posts
        Checked my htaccess and php.ini, but anything related to compression is commented out. :-(
          • 43957
          • 79 Posts
          I've been working on this issue again......

          I decided I was going to make the update from 2.2.6 to 2.2.8. I copied my site to a new folder on my hosting and copied the database.

          I sorted out the config.inc.php to point to the server folder location which has a different domain name to the actual website. eg. the original domain name: www.some-website.com so I was then accessing via www.other-website.com/folder/

          I re-ran setup with 2.2.6 and everything was fine with the site in this new location.

          On testing the Newspublisher imageTV it now works, so I thought great!!! I then upgraded to 2.2.8pl and the site is all wroking fine and the Newspublisher imageTV working too.

          I then updated my hosting to point the domain (www.some-website.com) at the new folder location and edited config.inc.php to also correct the paths.

          Now Newspublisher imageTV doesn't work again!

          I'm still scratching my head about this.... any ideas?

          Many thanks
            • 3749
            • 24,544 Posts
            The only things I can think of are

            1) 2.2.8 has the allow_tags_in_post System Setting off by default. This causes trouble in NewsPublisher, but I'm not sure it applies in your situation.

            2) the compression issue has come back for some reason, possibly due to an .htaccess file in a directory higher up, or the server configuration.



              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
              • 12066
              • 48 Posts
              Hi,

              came across the same problem and made a quickfix regarding the minify problem. You have to change /core/components/newspublisher/filebrowser/index_2_20.tpl:
              The commented lines are the original ones.

              <!-- <link rel="stylesheet" type="text/css" href="{$_config.manager_url}min/?f={$_config.manager_url}assets/ext3/resources/css/ext-all-notheme-min.css,{$_config.manager_url}templates/{$_config.manager_theme}/css/xtheme-modx.css,{$_config.manager_url}templates/{$_config.manager_theme}/css/index.css" /> -->
              <link rel="stylesheet" type="text/css" href="{$_config.manager_url}assets/ext3/resources/css/ext-all-notheme-min.css" />
              <link rel="stylesheet" type="text/css" href="{$_config.manager_url}templates/{$_config.manager_theme}/css/xtheme-modx.css" />
              <link rel="stylesheet" type="text/css" href="{$_config.manager_url}templates/{$_config.manager_theme}/css/index.css" />
              
              <script src="{$_config.manager_url}assets/ext3/adapter/ext/ext-base.js" type="text/javascript"></script>
              <script src="{$_config.manager_url}assets/ext3/ext-all.js" type="text/javascript"></script>
              <script src="{$_config.manager_url}assets/modext/core/modx.js" type="text/javascript"></script>
              <!-- <script src="{$_config.manager_url}min/?f={$_config.manager_url}assets/ext3/adapter/ext/ext-base.js,{$_config.manager_url}assets/ext3/ext-all.js,{$_config.manager_url}assets/modext/core/modx.js" type="text/javascript"></script> -->
              
                • 3749
                • 24,544 Posts
                @herooutoftime: Thanks!!! I had completely forgotten about that code.

                I'll include your changes in the next release.

                @dave-b: Here's the complete code for the core\components\newspublisher\filebrowser\index_2_20.tpl file. Let me know if it solves your problem.

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml" {if $_config.manager_direction EQ 'rtl'}dir="rtl"{/if} lang="{$_config.manager_lang_attribute}" xml:lang="{$_config.manager_lang_attribute}">
                <head>
                <title>MODX :: {$_lang.modx_resource_browser}</title>
                <meta http-equiv="Content-Type" content="text/html; charset={$_config.modx_charset}" />
                
                <link rel="stylesheet" type="text/css" href="{$_config.manager_url}assets/ext3/resources/css/ext-all-notheme-min.css"/>
                <link rel="stylesheet" type="text/css" href="{$_config.manager_url}templates/{$_config.manager_theme}/css/xtheme-modx.css"/>
                <link rel="stylesheet" type="text/css" href="{$_config.manager_url}templates/{$_config.manager_theme}/css/index.css"/>
                
                
                <script src="{$_config.manager_url}assets/ext3/adapter/ext/ext-base.js" type="text/javascript"></script>
                <script src="{$_config.manager_url}assets/ext3/ext-all.js" type="text/javascript"></script>
                <script src="{$_config.manager_url}assets/modext/core/modx.js" type="text/javascript"></script>
                
                
                <script src="{$_config.connectors_url}lang.js.php?ctx=mgr&topic=category,file,resource&action={$smarty.get.a|strip_tags}" type="text/javascript"></script>
                <script src="{$_config.connectors_url}layout/modx.config.js.php?action={$smarty.get.a|strip_tags}{if $wctx}&wctx={$wctx}{/if}" type="text/javascript"></script>
                
                {$maincssjs}
                
                {foreach from=$cssjs item=scr}
                {$scr}
                {/foreach}
                
                <!--[if IE]>
                <style type="text/css">body { behavior: url("{$_config.manager_url}templates/{$_config.manager_theme}/css/csshover3.htc"); }</style>
                <link rel="stylesheet" type="text/css" href="templates/{$_config.manager_theme}/css/ie.css" />
                <![endif]-->
                </head>
                <body>
                
                {literal}
                <script type="text/javascript">
                Ext.onReady(function() {
                    Ext.QuickTips.init();
                    Ext.BLANK_IMAGE_URL = MODx.config.manager_url+'assets/ext3/resources/images/default/s.gif';
                    browser = MODx.load({
                        xtype: 'modx-browser-np'
                        ,hideFiles: true
                        ,wctx: '{/literal}{$wctx}{literal}' || 'web'
                        ,source: '{/literal}{$source}{literal}'
                        ,openTo: '{/literal}{$openTo}{literal}' || ''
                        ,listeners: {
                            'hide': {fn:function() { window.close(); },scope:this}
                        }
                        ,onSelect: function(data) {
                            // add file url to text field
                            window.opener.browserPathInput.value = data.relativeUrl;
                            if (window.opener.browserPathInput.onchange) {
                                window.opener.browserPathInput.onchange();
                            }
                        }
                    });
                    browser.show(document.body);
                });
                </script>
                {/literal}
                </body>
                </html>
                
                [ed. note: BobRay last edited this post 13 years, 2 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
                  • 43957
                  • 79 Posts
                  Hi Guys,

                  Thanks for your suggestions however it's still not loading the file browser.

                  I have tried your tpl Bob and I get the following errors when viewing the console with Chrome:

                  Uncaught SyntaxError: Unexpected end of input index.php?a=81&field=storeCV:22
                  Uncaught TypeError: Cannot read property 'dom' of null ext-all.js:7
                  


                  When I view the sources it complains about:
                  /assets/components/newspublisher/js/widgets/modx.np.browser.js?v=228pl
                  uncaught syntax error: Unexpected end of input.

                  I have tried clearing my browser and the Modx site cache, but this doesn't help.

                  All the files paths are now reachable if I view source and click the hyperlinks, apart from:

                  src="/connectors/lang.js.php?ctx=mgr&topic=category,file,resource&action=81" type="text/javascript"></script>
                  <script src="/connectors/layout/modx.config.js.php?action=81&wctx=web" type="text/javascript"></script>


                  lang.js.php returns:

                  MODx.lang = {'access': "Access",'access_denied': "Access denied.",'action': "Action",'action_err_nfs': "No action with [[+id]] found.",'actions': 
                  , showing just the first line followed by a lot more.

                  modx.config.js.php returns:

                  Ext.namespace('MODx'); MODx.config = {"access_category_enabled":"1","access_context_enabled":"1","access_policies_version":"1.0","access_resource_group_enabled":"1","allow_forward_across_contexts":""
                  + more.

                  I tried several times cutty pasting the tpl and comparing with the original. I also tried herooutoftime's suggested mod, but that failed in a similar way.
                    • 3749
                    • 24,544 Posts
                    Does your /assets/components/newspublisher/js/widgets/modx.np.browser.js file end like this?

                    });
                    Ext.reg('modx-browser-np',MODx.browser.NP);



                    BTW, you probably figured this out, but the correct location of the file mentioned in the earlier post is:

                    core\components\newspublisher\filebrowser\index_2_20.tpl


                    I just tried an image TV in 2.2.8 with the new file contents and the image browser worked fine.

                    I wonder if your upgrade didn't work properly, or if you have a JavaScript conflict.

                    Have you tried in other browsers?

                    [ed. note: BobRay last edited this post 13 years, 2 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
                      • 43957
                      • 79 Posts
                      Hi Bob, yes my file ends with:

                      });
                      Ext.reg('modx-browser-np',MODx.browser.NP);


                      This isn't a problem with 2.2.8. I had the problem originally with 2.2.6.

                      I upgraded to 2.2.8 and the imageTV works fine with as long as I am on localhost or if I haven't got my hosting pointing the actual domain to the MODX folder. I'm not sure I'm very good a explaining the scenario....

                      I have a godaddy hosting so when I installed the site for testing it was at:

                      eg: /home/content/html/example/folder/mysite

                      At my hosting domain www.example.com, so I could access the site via www.example.com/folder/mysite

                      The image TV upload worked fine in this case and the file browser would show, however when I then changed my setting to point the actual domain to the folder it stopped working.

                      eg. the site is now accesses by www.myrealsite.com

                      I edited the config.inc.php to point to the correct locations for the domain:

                      Before when working (partial from config.inc.php):

                      
                      if (!defined('MODX_CONNECTORS_PATH')) {
                          $modx_connectors_path= '/home/content/html/example/folder/mysite/connectors/';
                          $modx_connectors_url= '/folder/mysite/connectors/';
                          define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                          define('MODX_CONNECTORS_URL', $modx_connectors_url);
                      
                      if (!defined('MODX_HTTP_HOST')) {
                          if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                              $http_host='www.example.com';
                      


                      After ImageTV not working, but rest of site is fine. (partial from config.inc.php):

                      if (!defined('MODX_CONNECTORS_PATH')) {
                          $modx_connectors_path= '/home/content/html/example/folder/mysite/connectors/';
                          $modx_connectors_url= '/connectors/';
                          define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                          define('MODX_CONNECTORS_URL', $modx_connectors_url);
                      
                      if (!defined('MODX_HTTP_HOST')) {
                          if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                              $http_host='www.myrealsite.com';
                      


                      and updated the .htaccess file, which I'd previously set the RewriteBase /folder/mysite
                      to just RewriteBase /

                      Everything else has been working fine for months and I don't have any other issues with the site relating to paths or minification. I just can't figure this one out, it's driving me insane.

                      ps. I've tried with Chrome, Firefox, Safari and on several other machines.