We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38846
    • 30 Posts
    I keep getting multiple errors, can someone point me in a direction? I am running 2.2.4 revo on apache through mamp.

    Notice: Undefined index: /../../../security/forms/set/update.class.php on line 96

    Notice: Undefined index: /../../../security/forms/set/update.class.php on line 95 [ed. note: darwin last edited this post 14 years, 2 months ago.]
      • 3749
      • 24,544 Posts
      They're not errors, but notices. If you turn off E_NOTICE in your php.ini it should prevent them from showing up. Add something like this in php.ini:

      error_reporting = E_ALL & ~E_NOTICE


      BTW, I think the problem may be with this line in that file (though there are some other lines that might be causing it):


       if (!empty($field['label'])) {


      Should be:

       if (isset($field['label']) && !empty($field['label'])) {



      Could you file that as a bug here: http://bugs.modx.com


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 38846
        • 30 Posts
        Sorry for the wrong label on the "Notices" and thank you for your help. I managed to temporarily hide them with Fire Bug so I could make the needed changes but turning them off will be my first thing to do Monday morning.
          • 3749
          • 24,544 Posts
          I should also have mentioned that the even with the notices, the code should still work fine, It's just missing some checks to keep the E_NOTICE inspection quiet. smiley



          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            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
            • 38846
            • 30 Posts
            Just as an update I dropped
            error_reporting = E_ALL & ~E_NOTICE
            in the php.ini this morning and restarted the server but the errors are still reporting.

            I filed this as a bug. But like I said I managed to work around it to get what I needed done. I am reaching the end of my form customizations so I more than likely won't run into this again unless I am testing for it.

            Thanks for your help.
              • 3749
              • 24,544 Posts
              That's odd. I don't think MODX resets the error_reporting level. Are you sure you put that in the right php.ini file and that there's no other php.ini further down.

              In System->System Information, there's a link (view) that will run phpinfo(). That will tell you the location of the php.ini file being used.


              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                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
                • 38846
                • 30 Posts
                Yea I am not sure what is going on, I added it in both the loaded and the configuration file and the notices are still showing up.

                Oh well, like I said no big deal I will work around it for now.
                  • 3749
                  • 24,544 Posts
                  I'm seeing a lot of E_NOTICE bugs in 2.2.4 myself. I fix the code as they come up, so I haven't tried to turn the notices off.


                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  MODX info for everyone: http://bobsguides.com/modx.html
                    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
                    • 38846
                    • 30 Posts
                    I don't have your knowledge of the code yet so I will have to wait for the next release to see the fixes. Thank you for your help though.
                      • 3749
                      • 24,544 Posts
                      Be sure to report the bugs at http://bugs.modx.com or on the Issues tab of the GitHub page for the extra, if the error is in an extra -- and paste the notice because the line number will help the author find it.


                      The fix is usually pretty simple (though not always). It's usually a line like this:

                      if ($arrayName[something]) {


                      that should be:

                      if (isset($arrayName[something]) && $arrayName[something]) {



                      or a line like this:

                      if ($arrayName[something] == something-else) {


                      That should be:

                      if (isset($arrayName[something]) && $arrayName[something] == something-else) {



                      If E_NOTICE is on, newer versions of PHP will complain if you refer to a non-existent array member. The isset() test makes sure that if the variable is not set, the second test never executes.

                      If it's a negative test:

                      if (! $arrayName[something]) {


                      or:

                      if (empty($arrayName[something])) {


                      You have to change the logic to use || (OR) instead of && (AND):

                      if (! isset ($arrayName[something]) || ! $arrayName[something]) {


                      or:

                      if (! isset ($arrayName[something]) || empty($arrayName[something]) {


                      If you're not comfortable messing with stuff like that, you should definitely wait for an upgrade and/or turn off E_NOTICE.



                      ------------------------------------------------------------------------------------------
                      PLEASE, PLEASE specify the version of MODX you are using.
                      MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 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