We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48606
    • 3 Posts
    I just noticed that i cannot create a new chunk in 2 modx installations where 2.2.6 & 2.2.10 is installed.

    It gives an error "Chunk name is invalid" I tried many name options but no luck

    When i tried it on a newer installation of modx 2.2.14 it seems working

    But all the installations are located on the same server and even the old installations were working fine before.

    To my knowledge there weren't any updates on the server

    What could be the reason for this error?
      • 36551
      • 416 Posts
      I'm seeing this as well on a site that is under development. Modx ver 2.2.10. Yesterday it was working fine. Today, I'm unable to create template variables or chunks.

      We plan to upgrade to 2.2.14 hoping this will correct the problem, but this is worrisome.
        • 3749
        • 24,544 Posts
        I think this is due to a problem with the regular expression near the end of the core\model\modx\mysql\modchunk.map.inc.php file. It's usually due to a PHP update, which happens regularly at most hosts.


        'rule' => '/^(?!\\s)[a-zA-Z0-9\\x2d-\\x2f\\x7f-\\xff_-\\s]+(?!\\s)$/',



        The reported fix is to change it to this (the _- about two thirds of the way through is reversed to -_ which should fix it):

        'rule' => '/^(?!\\s)[a-zA-Z0-9\\x2d-\\x2f\\x7f-\\xff-_\\s]+(?!\\s)$/',


        The upgrade might well fix it. I know there was a pull request on this a while back.

        In any event, you should definitely upgrade MODX to at least 2.2.15. The versions you have are not secure and there have been a number of reports of those versions being hacked.

        http://modx.com/download/previous-releases/


          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
          • 36551
          • 416 Posts
          Bob

          This did the trick. Yes, we do plan to upgrade modx.

          Thanks
            • 48606
            • 3 Posts
            Hi BobRay

            Thanks for your feedback

            Unfortunately it did not work for me.

            I think i might need to go for an upgrade.

            I am bit in a doubt about the upgrade is will it have issues with the existing site after the upgrade

            Is there a way that you can go back to the previous version if the upgrade did not work


            Quote from: BobRay at Aug 18, 2014, 11:44 PM
            I think this is due to a problem with the regular expression near the end of the core\model\modx\mysql\modchunk.map.inc.php file. It's usually due to a PHP update, which happens regularly at most hosts.


            'rule' => '/^(?!\\s)[a-zA-Z0-9\\x2d-\\x2f\\x7f-\\xff_-\\s]+(?!\\s)$/',



            The reported fix is to change it to this (the _- about two thirds of the way through is reversed to -_ which should fix it):

            'rule' => '/^(?!\\s)[a-zA-Z0-9\\x2d-\\x2f\\x7f-\\xff-_\\s]+(?!\\s)$/',


            The upgrade might well fix it. I know there was a pull request on this a while back.

            In any event, you should definitely upgrade MODX to at least 2.2.15. The versions you have are not secure and there have been a number of reports of those versions being hacked.

            http://modx.com/download/previous-releases/


              • 3749
              • 24,544 Posts
              If you back up the site fully (both the files and the database), you can revert to the earlier version, but it's very likely that the upgrade will work for you.
                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