We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15082
    • 195 Posts
    Ah - I see.
    Thanks anyway smiley

    greetz

    JUSI
      • 28436
      • 242 Posts
      hello

      using full cache-capabilities( e.g for Wayfinder) and webusers/webdocumentgroups at the same time is not possible.

      - home(1) default
      - only for customer(2) - docgroup(1)
      - page
      - page
      - only for supplier(3) - docgroup(2)
      - page
      - page

      1. A not logged in user create the "home" - cache-file, the nodes for 2 and 3 are not visible in the navigation.
      2. Now a supplier log in, but the "only for supplier" node is still invisible btw. not shown by the cached wayfinder/cache-file.
      3. clear cache and supplier refresh, the node is appear and the cache-file is written to the cache.
      4. supplier log out and the node "only for supplier" is still visible for all users.
      5. Now a customer log in and the node "only for customer" is not visible, the user see the "only for supplier" node instead.

      The reason is the nameing of the cache-file "docid_1.pageCache.php". There is no discriminability concerning the user-rights.

      A solution could be to create a "cache_id" which include the documentgroups on which the user have access eg. "docid_[docid]_[dgid].pageCache.php

      Example:

      1. All no logged in user read and write the default cache-file "docid_1.pageCache.php"
      2. A user with rights for viewing docgroup 1 read and write the cache-file "docid_1_1.pageCache.php"
      3. A user with rights for viewing docgroup 2 read and write the file "docid_1_2.pageCache.php"
      4. A user with rights for viewing both, docgrp 1 and docgrp 2 read and write "docid_1_1_2.pageCache.php"

      if iam right, the implementation is easy(at least as a quick hack)

      to check it out... and please, do it, change the document.parser by this way

      1. create a new function

      function getCacheId()
      {
          if( $this->isFrontend()
              && isset( $_SESSION['webDocgroups'] )
              && isset( $_SESSION['webValidated'] ) )
          {
              sort( $_SESSION['webDocgroups'], SORT_NUMERIC );
              return '_' . implode('_', $_SESSION['webDocgroups'] );
              
              //$cache_id = '_' . implode('_', $_SESSION['webDocgroups'] );
              //$this->cache_id = $cache_id
              //return null;
          }
          return null;
      }


      change the checkCache function to get the file
      function checkCache($id) {
              // cache_id
              // $this->cache_id;
              $cache_id = $id . $this->getCacheId();
              // new filename
              $cacheFile= "assets/cache/docid_" . $cache_id . ".pageCache.php";
              // $cacheFile= "assets/cache/docid_" . $id . ".pageCache.php";

      change postProcess to write the file
      $cache_id = $this->documentIdentifier . $this->getCacheId();
      
      //if ($fp= @ fopen($basepath . "/docid_" . $this->documentIdentifier . ".pageCache.php", "w")) {
      // $this->cache_id
      if ($fp= @ fopen($basepath . "/docid_" . $cache_id . ".pageCache.php", "w")) {


      Three small changes could be a huge improvement. The behavior of the cache is not disturbed by this changes

      ciao, Stefan
        • 28436
        • 242 Posts
        Another thing

        to replace the annoying alert-help with mootools tooltip its necessary to add a class and a title to the help images..
        without hacking the core-file you can use this plugin on "OnDocFormRender"
        $e = &$modx->Event;
        switch( $e->name )
        {
            case 'OnDocFormRender':
            echo <<<EOF
                <script type="text/javascript">
                if( !window.ie6 ) { // ie will crash.. no idea why
                    $$('img[src=media/style/MODxCarbon/images/icons/b02_trans.gif]').each(function(help_img) {
                            help_img.removeProperty('onclick');
                            help_img.removeProperty('onmouseover');
                            help_img.removeProperty('onmouseout');
                            help_img.setProperty('title', help_img.getProperty('alt') );
                            help_img.setProperty('class', 'tooltip' ); 
                    });
                    new Tips($$('.tooltip'),{className:'custom'} );
                }
                </script> 
        EOF;
                break;
            default:
                return;
                break;
        }


        ciao, stefan
          • 13094
          • 58 Posts
          Quote from: rthrash at Jul 26, 2009, 04:09 PM


          Grrr. That shouldn’t be happening, and is a new problem. If you’re committing to SVN, PLEASE make sure you have line endings set to unix line endings in your editors and do not put any whitespace or lines after closing ?>.

          iRolf, could you submit a bug to JIRA with the offending files, please.

          I added my first JIRA bug, Yipppehh! 1038
          (normally I’m addicted to bugzilla)

          rolf
            • 25663 MODX Staff
            • 12,272 Posts
            Hi stefan,

            Could you please file improvement issues in JIRA so that we can properly track these through the development process. Both suggestions sure seem like a awesome updates.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 17883
              • 1,039 Posts
              just another answer for the auto-reply-mechanism and totally off-topic but nevertheless important:

              STEFAN! you are back! Kind of... File it, man!

              @Ryan: He is the man! Really! He is the one who can get Xedit started sooner... he is a kind of QA for us, and also for RC3 as you can see.But he needs more pressure obviously grin
                • 33014 ☆ A M B ☆
                • 1,231 Posts
                  • 33014 ☆ A M B ☆
                  • 1,231 Posts
                    • 33014 ☆ A M B ☆
                    • 1,231 Posts


                    DatePicker UI, time input field is too long.
                      • 25663 MODX Staff
                      • 12,272 Posts
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me