We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23344
    • 31 Posts
    Twice now I have had a context disappear from the menu without infact going away.

    I forget how it happened the first time, but most recently I was trying to add a user to the context and the admin froze. After waiting a while I refreshed the page. The context disappeared. It does not appear on the context list either, but it is still there because the site continues to function in that context and I get an error if I try to re-create it.

    Error Log:
    [2011-03-03 14:48:19] (ERROR @ /connectors/context/index.php) modManagerLog: Attempt to set NOT NULL field item to NULL
    [2011-03-03 14:49:10] (ERROR @ /connectors/context/index.php) Error 23000 executing statement:
    INSERT INTO `modx_context` (`key`, `description`) VALUES (’jd’, ’’)
    Array
    (
    [0] => 23000
    [1] => 1062
    [2] => Duplicate entry ’jd’ for key 1
    )

    [2011-03-03 14:49:10] (ERROR @ /home/practica/public_html/core/model/modx/error/moderror.class.php : 88) Recoverable error: Argument 1 passed to modError::checkValidation() must be an array, object given, called in /home/practica/public_html/core/model/modx/processors/context/create.php on line 26 and defined

    Also, when I clear the site cache I get this before the usual stuff:
    Principal 1 does not have permission to load object of class modContext with primary key: jd

    So why can I not see my context that is still there anymore?

    System Details:
    MODx Revolution 2.0.7-pl (traditional)
    PHP: 5.2.14
    MySQL: 5.0.91-community
    Server OS: linux
    Browser: Firefox 3.6.14 (Windows)
      • 3749
      • 24,544 Posts
      Have you tried manually deleting the files in the core/cache directory?

      My only thought is that maybe you created the context but didn’t give the admin user access to that context via a Context Access ACL entry, but you don’t find out about it until you save something that clears the cache.

      BTW, there’s a bug with cache corruption that’s fixed in MODx 2.0.8. That may be related.
        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
        • 23344
        • 31 Posts
        Quote from: BobRay at Mar 03, 2011, 03:13 PM

        Have you tried manually deleting the files in the core/cache directory?

        Do I want to?

        Quote from: BobRay at Mar 03, 2011, 03:13 PM

        My only thought is that maybe you created the context but didn’t give the admin user access to that context via a Context Access ACL entry, but you don’t find out about it until you save something that clears the cache.

        I had been into that context several times, so at least at one point the admin had access. Is this something I can/should correct directly in the DB?
          • 3749
          • 24,544 Posts
          My guess is that it’s a corrupted file in the cache. Deleting the files in core/cache/ is harmless. Just log out of the Manager first, and be careful not to delete the core directory. wink

          You might want to clear your browser cache/cookies at the same time.
            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
            • 23344
            • 31 Posts
            Okay I tried that. No difference.

            I’m more and more suspecting that admin doesn’t have permission to view it. But like I was saying I’d have to go into the DB to fix that, but I don’t know what table/field I would be looking for.
              • 3749
              • 24,544 Posts
              Did you give any other users access to that context with a Context Access ACL entry? That would protect that context and hide it from the admin (who also might not be able to see that Context Access ACL entry any more -- not sure). Try adding the admin Super User to all user groups with an authority level (role) of admin Super User.
                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
                • 19302
                • 6 Posts
                better than clearing the cache is try tools -> flush permissions.

                we’ve spent the better half of a day working with contexts (2.0.8-pl), having all sorts of problems... including and not limited to, being completely locked out of the manager (because of a wigged out context), having pages on the front end disappear after clearing the cache (become visible again when refreshing the page if logged in as admin), losing entire context trees as you’ve mentioned.

                just quietly :

                There are bugs with: contexts, caching, and user permissions over more than one domain. The new context bugged when I was updating an access permission on it (threw a php error in the logs) and from there, because the administrator account needs permission to view a context (I have absolutely no idea why anyone would NOT want to have this permission on a Superuser - this check shouldn’t even be there) you can’t log into the manager. Clearing cache / cookies / whatever, nothing - then after about half an hour it started working again - which I suspect is to do with the session... That’s my rant for the day.

                Having said that, Revolution is bloody good, but there’s definately issues with the above, bugs that are pretty much impossible to report on. Want so desperately to work with contexts because they are perfect for what we are trying to do, but now, just very much afraid.