We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I'm getting errors when I attempt to save certain templates (not sure why this crops up with some templates and not with others).

    Watching the JS console, I see the following:

    Failed to load resource: the server responded with a status of 403 (Forbidden) -- connectors/index.php
    Type Error: undefined is not a function (evaluating 'this.mask.addClass('fade-in')') -- modx.window.js:42
    


    I've turned off the JS compression settings thinking that may have had something to do with this, but no change. Anyone have other ideas of what I could try?

    MODX 2.3.3-pl
      • 3749
      • 24,544 Posts
      It doesn't fit very well with your error message, but by far the most common cause of intermittent failed template saves is mod_security.
        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
      • We're not running mod_security on this server... interestingly, I've narrowed the problem down to a certain bit of JS. When entered in either a Chunk or a template, this fails to save:

        <script src="[[++assets_url]]template/js/colorbox/jquery.colorbox-min.js"></script>
        
        <script type="text/javascript">
        
            $(function() {
                var bool = false;
                var count = 0;
        
                $(document).scroll(function(e){
                    var elem = $('.infographic');
                    var docViewTop = $(window).scrollTop();
                    var docViewBottom = docViewTop + $(window).height();
                    var elemTop = $(elem).offset().top;
                    var elemBottom = elemTop + $(elem).height();
        
                    bool = ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
                    if(bool) {
                        count++;
                        if(count==1)
                            $('.circle_wrapper').spinwheel();
                    }
                });
        
                //Examples of how to assign the ColorBox event to elements
                $(".group1").colorbox({rel:'group1'});
            });
        
        </script>
        


        Very odd. In fact, just including the JS file is enough to bomb out the manager request:

        <script src="[[++assets_url]]template/js/colorbox/jquery.colorbox-min.js"></script>
        [ed. note: Everettg_99 last edited this post 8 years, 9 months ago.]
        • I tracked this down to CloudFlare. any time ANY JS file was referenced, it would trigger the request through CloudFlare somehow (instead of requesting it locally), and that caused an error.
            • 32658
            • 38 Posts
            Quote from: Everettg_99 at Jun 10, 2015, 05:18 AM
            I tracked this down to CloudFlare. any time ANY JS file was referenced, it would trigger the request through CloudFlare somehow (instead of requesting it locally), and that caused an error.

            So, what was the solution?

            I am currently encountering the same error. I can't save a Template, I'm getting the Error 403.

            Any suggestions?