We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30598
    • 14 Posts
    Hi Everyone.

    I’m getting an error every time I try to create a Category for my site. I’m using MODx for multiple projects right now and this is the only time I’ve run into the issue. I right-click on Categories, Click New Category, the dialogue box comes up, I put a name in, hit save and I keep getting a Error pop up saying "An error occurred while trying to create the category."

    Any thought’s or ideas?

    Thank you!

    MODx Revolution 2.0.8-pl (traditional), unfortunately I’m not sure of the rest. Site hosted at Network Solutions Shared Server, PHP Version 5.2.13, mysql client version 5.0.89, pdo_mysql installed, Chrome v.10.0.648.127
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Anything in the Error log? (Reports -> Error log, or core/cache/logs/error.log on the filesystem)
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 30598
        • 14 Posts
        Hi. I have not checked my Error log - however I now have a BIGGER issue....the index page is not loading at all. I’m fairly new to MOOx and this is the first time I’ve tried creating a user other than an admin as well. I’ve gone back to what I thought were default settings, removing all other users, checked another site I’ve only a admin on and mimicked that users settings on my index.php file. To no avail. This is a site that is launched and I’m having these issues and it’s really got me frustrated. Below is a laundry list of my errors. Not quite sure what to make of them tho, however I will be looking in more detail after I post this. Please let me know if you’ve any insight....desperate....


        [2011-03-07 11:54:47] (ERROR @ /index.php) Could not load context:
        [2011-03-08 13:24:18] (ERROR @ /connectors/security/user.php) Could not get table name for class: modAccess
        [2011-03-08 13:24:18] (ERROR @ /connectors/security/user.php) Error 42000 executing statement:
        Array
        (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’AS `modAccess` WHERE `modAccess`.`principal` = 2’ at line 1
        )

        [2011-03-08 18:08:28] (ERROR @ /connectors/system/index.php) Could not cache context settings for mgr.
        [2011-03-08 18:08:28] (ERROR @ /connectors/system/index.php) Could not cache context settings for mgr.
        [2011-03-08 18:55:39] (ERROR @ /index.php) Could not load context:
        [2011-03-08 19:41:45] (ERROR @ /connectors/element/category.php) Error 23000 executing statement:
        INSERT INTO `modx_categories` (`parent`, `category`) VALUES (0, ’JobListings’)
        Array
        (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry ’JobListings’ for key 2
        )

        [2011-03-08 19:41:45] (ERROR @ /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/processors/element/category/create.php on line 26 and defined
        [2011-03-08 19:41:56] (ERROR @ /connectors/element/category.php) Error 23000 executing statement:
        INSERT INTO `modx_categories` (`parent`, `category`) VALUES (0, ’JobListings’)
        Array
        (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry ’JobListings’ for key 2
        )

        [2011-03-08 19:41:56] (ERROR @ /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/processors/element/category/create.php on line 26 and defined
        [2011-03-08 19:42:55] (ERROR @ /connectors/element/category.php) Error 23000 executing statement:
        INSERT INTO `modx_categories` (`parent`, `category`) VALUES (0, ’Jobs’)
        Array
        (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry ’Jobs’ for key 2
        )

        [2011-03-08 19:42:55] (ERROR @ /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/processors/element/category/create.php on line 26 and defined
        [2011-03-08 19:45:30] (ERROR @ /connectors/element/category.php) Error 23000 executing statement:
        INSERT INTO `modx_categories` (`parent`, `category`) VALUES (0, ’Jobs’)
        Array
        (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry ’Jobs’ for key 2
        )

        [2011-03-08 19:45:30] (ERROR @ /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/processors/element/category/create.php on line 26 and defined
        [2011-03-08 19:49:21] (ERROR @ /connectors/element/category.php) Error 23000 executing statement:
        INSERT INTO `modx_categories` (`parent`, `category`) VALUES (0, ’JobListings’)
        Array
        (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry ’JobListings’ for key 2
        )

        [2011-03-08 19:49:21] (ERROR @ /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/processors/element/category/create.php on line 26 and defined
        [2011-03-08 20:51:57] (ERROR @ /connectors/element/category.php) Error 23000 executing statement:
        INSERT INTO `modx_categories` (`parent`, `category`) VALUES (0, ’JobListings’)
        Array
        (
        [0] => 23000
        [1] => 1062
        [2] => Duplicate entry ’JobListings’ for key 2
        )

        [2011-03-08 20:51:57] (ERROR @ /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /data/26/2/14/86/2503086/user/2741551/htdocs/core/model/modx/processors/element/category/create.php on line 26 and defined
        [2011-03-09 18:52:04] (ERROR @ /connectors/security/user.php) Could not get table name for class: modAccess
        [2011-03-09 18:52:04] (ERROR @ /connectors/security/user.php) Error 42000 executing statement:
        Array
        (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’AS `modAccess` WHERE `modAccess`.`principal` = 4’ at line 1
        )

        [2011-03-09 18:52:04] (ERROR @ /connectors/security/user.php) Could not get table name for class: modAccess
        [2011-03-09 18:52:04] (ERROR @ /connectors/security/user.php) Error 42000 executing statement:
        Array
        (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’AS `modAccess` WHERE `modAccess`.`principal` = 3’ at line 1
        )
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Did you do anything with contexts?

          There’s a few duplicate errors in there. Looks like you’ve been trying to make a category jobListings that already existed.

          There’s also some errors related to missing table names for classes, you may be able of fixing this by uploading the files again - something may have been corrupted during upload.

          Also, what have you been doing with the index.php file?
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 3749
            • 24,544 Posts
            Are you logging in as the admin Super User?

            Have you created any contexts other than mgr or web?

            In trying to go back to the defaults, you may have deleted the necessary Context Access ACL entries for the admin Super User. There should be two, one for the mgr context and one for the web context -- both with an authority level of 0 and a policy of Administrator.

            Also, make sure all the permissions are checked on the Administrator policy.
              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
              • 30598
              • 14 Posts
              I do seem to recall trying to follow instructions re: context and user’s from the manual and/or the video on Security posted on Vimeo. If I were to re-upload files, which ones should I upload? [sorry for being newb]. I’ve not done anything with the index file except in desperation configuring the read/write/execute permissions in attempt to get it to show. I changed them to reflect another install of MODx I have’s index permissions...
                • 30598
                • 14 Posts
                Quote from: BobRay at Mar 09, 2011, 06:16 PM

                Are you logging in as the admin Super User? Yes

                Have you created any contexts other than mgr or web? No, at least not that I’m aware of

                In trying to go back to the defaults, you may have deleted the necessary Context Access ACL entries for the admin Super User. There should be two, one for the mgr context and one for the web context -- both with an authority level of 0 and a policy of Administrator. Both of those are in the User Group Administrator just as you mention.

                Also, make sure all the permissions are checked on the Administrator policy. Not sure where to find the Administrator Policy - oh wait, 126 of 126 of the permissions are active.
                  • 30598
                  • 14 Posts
                  Quote from: Mark at Mar 09, 2011, 06:13 PM

                  Did you do anything with contexts?

                  There’s a few duplicate errors in there. Looks like you’ve been trying to make a category jobListings that already existed. Yes, I did try to create this category a number of times. Even dragging a chunk into the folder. The icon next to the name would do the thinking spin, then just show an empty folder. I did try this on another install I have and the Category was created just fine. So confused...

                  There’s also some errors related to missing table names for classes, you may be able of fixing this by uploading the files again - something may have been corrupted during upload. Would definately try this if I knew what file to re-up. Perhaps a re-install..? Or would that blow up all my work so far?

                  Also, what have you been doing with the index.php file?
                    • 18373 ☆ A M B ☆
                    • 3,141 Posts
                    As I’m not sure what file would be missing you should probably just try all files - this wont break anything but will make sure everything exists.
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                      • 30598
                      • 14 Posts
                      Quote from: Mark at Mar 09, 2011, 06:49 PM

                      As I’m not sure what file would be missing you should probably just try all files - this wont break anything but will make sure everything exists.

                      Thanks Mark. I’ve gone back to basics [by scouring a different install on another server] and the site is at least live again - thank goodness!

                      When you refer to all files, just so I’m *crystal* clear - you mean all the files in the modx-2.0.8-pl folder [config.core.php, connectors folder, core folder, index.php and manager] right...?

                      Thanks again! I really do hope I can get the Categories to work properly as I need this to function in order to give client access to a certain chunk. I sure don’t want to screw things up again when I attempt to create a user just capable of editing certain things....

                      BTW, as a new MODx developer - is there a way to, when creating/setting up a user - for them to see and edit the Resource Content without seeing the markup?