We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4230
    • 28 Posts
    Hey Jason,
    I copied that from Jira, where I started a topic about MODx being consistent in using the getFullTableName() method instead of switching between that and using the global $database and $prefix strings.
    As far as I have seen the changes have been already implemented in the MODx Revolution 2.0.0-alpha-6 version.

    Thank you very much and may God bless you.
    Iasmin
      • 1611
      • 591 Posts
      Hey Iasmin. I’m working on the same functionality now, and I have some ideas to solve some issues.
      Before I start to examine Subsites HACK (not the MAD) to make it possible to work with 0963, could you share your solution. I’ll try it and together we make it better.

      By the way, does your solutions works with 0963 or only with earlier versions?
        • 4230
        • 28 Posts
        Hey Andrey,
        First of all, which functionality are you working on? Is it the Subsites hack or sharing documents in multiple domains?

        My hack solution has not been packaged yet and so changes would have to be made to any version, unless I port out the changes that I already made to MODx 0.9.6.1p2. The simplest way would probably be using SVN but I haven’t worked with it before. What has to take place is that all the connections that are made to the database using the global variables $database (or $dbase) or $prefix (or $table_prefix) have to be changed to use the $modx->getFullTableName() method.
        For example:
        ./manager/actions/mutate_content.dynamic.php:1012:    $sql .= "LEFT JOIN $dbase.`" . $table_prefix . "site_tmplvar_access` tva ON tva.tmplvarid=tv.id  ";

        Should be changed to:
        ./manager/actions/mutate_content.dynamic.php:1012:    $sql .= "LEFT JOIN " . $modx->getFullTableName('site_tmplvar_access') . " tva ON tva.tmplvarid=tv.id  ";


        So I’m not sure how we could go about making these changes automatically, but do let me know if you have any ideas. I know that the Revolution alpha version 2.0.0 has already made all these changes but 0.9.6.3 hasn’t.
        But for now it seems like the [HACK] Subsites would be the best option... I still haven’t tested it yet though.
          • 1611
          • 591 Posts
          I am making a website which consists from different domains. Some documents are shared between these domains.
          So, maybe, if you are not against, I take your solution, test it and suggest my ideas to implement.

          To use SVN you should download SVN-client like TortoiseSVN. Create local repositary from original 0961p2 version, checkout it to some folder and then you should copy edited version to this folder. Then TortoiseSVN shows you which files were changed. And then you’ll be able to make a patch.

          P.S. Sorry if my English not so bright, it isn’t my native language.
            • 4230
            • 28 Posts
            Hey Andrey,
            I sent you a patch. I hope that it works. It’s my first one... I only included changes for the manager/ folder since everything else, including the cache files from the assets/ folder, should be fine or be created automatically.
            Thank you and may God bless you,
            iasmin
              • 1611
              • 591 Posts
              Iasmin, sorry for delay, I really have no time to get view to your code. :-(
                • 4230
                • 28 Posts
                Hey Andrey,
                Sorry, I didn’t have time to redo that patch either. I’m going to have to look at it at another time. I hope I’ll get to because I’m leaving the country for a few months...
                Thank you anyway
                  • 16183
                  • 1,390 Posts
                  @Iasmin,

                  Have you had a look at this? http://modxcms.com/forums/index.php?topic=35543.0

                  /k
                    • 4230
                    • 28 Posts
                    Hey kongondo,
                    Thanks for that. It’s a good tutorial for sure and many will find it useful. It does have less problems than my solution.
                    There are only two things that it misses or doesn’t provide:
                    1. The configuration for each website can’t be, a far as I can see, customized for each website, like the title, etc. At least I haven’t come across such instructions. I guess that it can by another plugin or by manually changing things in the templates.
                    2. It still doesn’t provide a solution for sharing documents between multiple domains, easily. It does use the getField snippet for which you have to create a document in order to display the content of another document. When you have hundreds of documents to duplicate, it is a very inefficient feature.

                    I might look at trying to duplicate the multi-site, or multiple domain, feature that drupal has. The problem is that it would be really difficult to change our current site because of all the customized code... May the New MODx version will help.
                      • 4230
                      • 28 Posts
                      Hello there,
                      I think I might have found a way to share a document in multiple places without duplicating it, but I would need the help of the developers here. For the longest time I couldn’t figure out where the $modx->documentMap was created but now I found out that it is done in the siteCache.idx.php file. Jason Coward said this about it: "there is a map available as $modx->documentMap, which is an array of parent document id values keyed for every document in the system." That got me to check the documentMap array and understood that in this "[0] => 367" the key is the parent and the value is the child of that parent. All this is populated in the siteCache.idx.php file.
                      If I could find a way to make "[0] => 367" display again under a new parent (eg. "[30] => 367") then this could work. The only problem would arise depending on the snippets and modules that don’t use the documentMap variable to output the document tree. Unfortunately it seems like Wayfinder doesn’t use documentMap but Ditto does. In that case there would have to be a way to add the shared documents to the database or edit Wayfinder.
                      I could add new entries to the documentMap from another db table by editing the manager/processors/cache_sync.class.processor.php file starting with line 124. There would be a need for a separate module that would manage the shared documents, which would be stored in a separate db table. Then from there the documentMap file would be populated with the new entries.

                      I would really like it if any of the MODx developers could help me on this one. If there is a better way please let me know as I would really like to find a way.
                      Thank you so much and may God richly bless you.