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

    Having had a good hunt through the forums I am still yet to find a solution to my problem, so I am starting a new topic.

    I have multiple users with multiple pages they are allowed to edit. I have switched on "Show Protected Pages" in the configuration tab of the Tools menu so that all pages are visible to any user, but they can only edit the pages I have specified. ALL pages in the document tree appear greyed-out to the user, including the pages they are allowed to edit. This makes it very difficult for a user to determine what they can, and can’t edit!

    Is there someway to set the documents a user can edit to a different colour in the document tree?

    Thanks in advance
      • 29298
      • 6 Posts
      Hi Modx community !

      i have just experienced the same bug.
      Here is the fix :

      in manager/frames/nodes.php line 98

      change the sql query to :

      $sql = "SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr,
      MAX(IF(1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? "":" OR dg.document_group IN ({$docgrp})") . ", 1, 0)) AS has_access
      FROM {$tblsc} AS sc
      LEFT JOIN {$tbldg} dg on dg.document = sc.id
      WHERE (parent={$parent})
      $access
      GROUP BY sc.id

      ORDER BY {$orderby}";

      the bug appears when several documents groups can access to the document, the sql group by make the has_access get the wrong value randomly

      i would like to report this bug, but cannot find the right place.




        • 25663 MODX Staff
        • 12,272 Posts
        Use the link in the top of the forums labelled "Bugs & Requests" (or in my signature): http://svn.modxcms.com/jira/ tongue

        And thank you for digging in and figuring this out and putting it in Jira where it won’t get lost! laugh
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 7231
          • 4,205 Posts
          I had noticed this before and never took the time to look into it (yes I feel guilty). This will make a few clients of mine really happy. Thanks. grin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 10487 MODX Staff
            • 1,535 Posts
            Garry Nutting Reply #5, 18 years ago
            $sql = "SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr,
            MAX(IF(1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? "":" OR dg.document_group IN ({$docgrp})") . ", 1, 0)) AS has_access
            FROM {$tblsc} AS sc
            LEFT JOIN {$tbldg} dg on dg.document = sc.id
            WHERE (parent={$parent})
            $access
            GROUP BY sc.id

            ORDER BY {$orderby}";
            Hi guys, I’ve been looking at this with a view to getting the fix committed but I’m really struggling to replicate the original bug - so, could someone with the bug (maybe the OP or dev_cw?) please let me know if it fixes their issue with this.

            If I can get a consensus that the suggested fix works for people experiencing the bug, then it can get committed.

            Cheers,
            Garry
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 7231
              • 4,205 Posts
              garryn: I was unable to replicate with the latest release on my test install. I no longer have live access to the site where I had this issue, I will see if I can load a local copy and test this out.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 29298
                • 6 Posts
                to replicate the bug, you can try to assign 3 documents groups to a sub document, switch the Show protected pages on, and log in successively with 3 differents group users. for some, the document will appear greyed-out.

                btw, i have reported the bug in jira. thanks rthrash wink