We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13232
    • 15 Posts
    Hello,

    I’ve got a big problem with publishing/unpublishing resources:

    All resources on my site are accessible for public, even if they’re set ’unpublished’.
    I’m quite sure there is some kind of general setting for this, but I couldn’t find any in the system settings or any hints in other forums.
    I’m using Revolution 2.0.0-pl.

    Can anybody help me out?

    Thanks,
    ivan
      • 26931
      • 2,314 Posts
      i guess you’re just still logged-in when testing
        • 13232
        • 15 Posts
        Hello,

        thank you for your answer.
        That was my first thought, I’m not logged in and I cleared the cache...
          • 3749
          • 24,544 Posts
          Try from another browser after clearing the browser cache and cookies.
            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
            • 13232
            • 15 Posts
            Hi Bob,

            thanks for your advice.
            I actually tried with another browser after clearing the cache and the cookies.
            I even tried from another computer without loggin in: The unpublished resources are still accessible.

            It’s really strange, especially as noone else seems to have this problem.
              • 3749
              • 24,544 Posts
              Try deleting all the files in core/cache except for index.php.

              Have you tried this with more than one unpublished doc?

              Have you looked in the DB to make sure that the "published" field for those docs in the modx_site_content table is set to 0?

                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
                • 13232
                • 15 Posts
                Hello,

                I tried all your suggestions, unfortunately it still doesn’t work.
                I’ve now written a plugin that checks if the resource is published or not

                if(!$modx->documentObject['published'])


                I use the plugin on event OnLoadWebDocument.

                But I’m not really happy with that solution (although it works), as it shouldn’t be necessary.
                  • 3749
                  • 24,544 Posts
                  Quote from: ivan23 at Sep 16, 2010, 09:56 PM

                  Hello,

                  I tried all your suggestions, unfortunately it still doesn’t work.
                  I’ve now written a plugin that checks if the resource is published or not

                  if(!$modx->documentObject['published'])


                  I use the plugin on event OnLoadWebDocument.

                  But I’m not really happy with that solution (although it works), as it shouldn’t be necessary.

                  Try this snippet (uncached) in one or more of the unpublished documents:

                  [[!ViewUnpublished]]



                  <?php
                  /* ViewUnpublished snippet */
                  if ($modx->hasPermission('view_unpublished')) {
                  
                  return 'YES -- User has view_unpublished permission';
                  
                  } else {
                    return 'NO -- User does not have view_unpublished permission';
                  }
                  ?>


                  If it returns YES, it may mean that you’ve somehow given "members" that permission, which is part of the standard 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
                    • 23819
                    • 37 Posts
                    Hey,
                    have you found a solution huh

                    I have the same problem, I am making a multi-lingual site.

                    I duplicated my web context in order to make a version in a new language and when I unpublish documents in the new context they are still visible to everyone on the web (not logged-in web users or manager users).

                    I tried taking my whole new context offline by adding a site_status context setting, but that did not work either

                    Help would be much appreciated.

                    Robin
                      • 12958
                      • 9 Posts
                      Hello Bob,

                      we have the same problem (unpublished resources being visible even if we are logged out).
                      I installed the ViewUnpublished-Snippet, but it gives the following error-message:

                      Fatal error: Call to undefined method modUser_mysql::hasPermission() in ...modsnippet/242.include.cache.php on line 9
                      Fatal error: Undefined class constant ’LOG_LEVEL_ERROR’ in ...error/moderrorhandler.class.php on line 108
                      .

                      Is there anything I still have to consider to be able to use the snippet?
                      We use MODx Revolution 2.0.8-pl traditional, the unpublished-problem occurs since several weeks, unfortunately we don’t know if it started with the last update.

                      We would be very glad to receive further helpful hints!

                      Thanks,
                      Inka