We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30639
    • 22 Posts
    I downloaded 2.0.2 Ditto for an 0.9.5 Modx site and when I paste the Reflect 1.0.2 snippet in "new snippet" I receive a 404 error when I attempt to save and the code is not saved in manager. I have been able to create other snippets so I believe the problem to be with the PHP because I can create a blank snippet with title and description and category. When I add the php the 404 error occurs.

    Has anyone experienced this and if so, were you able to find a solution?

    Thanks for your help.

    -Greg
      • 18397
      • 3,250 Posts
      "Execute snippet after saving." was not checked correct?
        • 30639
        • 22 Posts
        Quote from: Mark at Apr 09, 2007, 12:29 PM

        "Execute snippet after saving." was not checked correct?

        I believe you are correct. I will check that and try again.

        Thank you very much for the quick response. I appreciate it.

        Regards,

        Greg
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          This could be the dreaded "mod_security" finding something in the snippet code objectionable. Usually it looks for any kind of mail code, but sometimes the oddest things can trigger it.

          One way to find out is to try saving just sections at a time, until it fails. Do a search in the forums for mod_security; there’s been a lot said about this.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30639
            • 22 Posts
            Thank you both for your responses.

            I attempted creation of the Reflect snippet again ensuring that "Execute snippet after saving" was selected. This had no effect.

            I then went through the code and pasted it into the snippet one section at a time. All was good until I reached the last section called:

            // ---------------------------------------------------
            // Reflect
            // ---------------------------------------------------

            When I posted the code of this section I received the 404 error.

            I performed the above failed test on a fresh install of 0.9.5 MODX to ensure that the issue was not with my installation.

            I hope this helps.

            Regards,

            Greg
              • 18397
              • 3,250 Posts
              Just the opposite, "Execute snippet after saving" should not be selected.

              Are you running mod_security?
                • 30639
                • 22 Posts
                "Execute snippet after saving" did not seem to effect either way.

                Examining server configuration I see that mod_security is installed. I will look up the forum posts as you suggested to see about the best course of action for this module.

                Thanks for the input!
                  • 30639
                  • 22 Posts
                  mod_security is causing this issue.

                  When I set

                  SecFilterEngine Off

                  In .htaccess I am then able to save the Ditto & Reflect snippets. This is not an ideal condition however. I have been going through the forums and wiki searching for solutions. I found this in the wiki:

                  http://wiki.modxcms.com/index.php/What_is_mod_security_and_how_does_it_affect_me

                  If I get a chance I’ll track down the line of code that is causing the issue and test above. If anyone already knows how to accomplish this before I do, please post.

                  Thanks!