We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Alright, time for a new alpha release for the team...and there are some big changes in this one:

    • 0.9.7 no longer recognizes the old MODx tag style. After many attempts to handle both old and new tag styles, I decided the best approach was providing tag translation utilities that can identify and/or automatically update old tags to new tags within database content and file content, even inside PHP scripts (with some exceptions where tag styles can get confused with valid PHP syntax). I will be posting more information on the initial release of the translation tool in a post to follow.
    • Ditto, Jot and other critical core components need to be re-converted from the latest versions to work with the new parser. These components do not currently work in 0.9.7 as distributed here. phX and chunkie features are being merged into the modParser class functionality, and phX is now broken into two classes that can be overridden by deployment, context, and/or individual tag element; modInputFilter and modOutputFilter. I need help making this work; the code is at this point completely untested and likely broken (it still references some phX functions that no longer exist and need to be converted to native MODx 0.9.7 API). Anyone with Ditto, Jot, and or phX knowledge and experience that wants to help get these functional, please contact me so we can collaborate on the efforts ASAP...

    Anyway, here is revision 2404...

    http://modxcms.com/testbuilds/modx-0.9.7-alpha-2404.zip

    Shaun (splittingred) has been working hard converting much of the manager interface to use the new xPDO core. I encourage all team members to start becoming familiar with the new core code ASAP, as we are days from releasing 0.9.6, at which point the MODx trunk will be switched to the 0.9.7 branch and all new features and bug fixes will be required to be implemented in 0.9.7 before being applied to 0.9.6 for any required patch releases.

    An introduction to the new modTranslator tool is next...
      • 25663 MODX Staff
      • 12,272 Posts
      Very cool work Jason and thanks for pouring so much into this for more than a year now. I’m incredibly excited to see where this goes!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        Ditto tongue

        I mean I most certainly am far away from grasping which amount of work lead to such a promising concept, and what it took to make this a reality.

        I think breaking with the old syntax was the way to go anyway. I was not so hot about co-existing syntaxes. Would have been a source of confusion and, possibly, a support nightmare rolleyes

        Anyway, at some point a news branch is bound to involve some work from everyone working with MODx. Components will have to be rewritten, but given the community’s dynamics and the way you’ve handled explaining the change process, I have no doubt this will go as smooth as possible.

        I have downloaded this rev, and will report any issue @install or config.
        It’s really nice to have the opportunity to follow up on 0.9.7 dev gradually !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 11975
          • 2,542 Posts
          Hi Jason,

          I’m facing weird issue with this alpha.

          First I can create module but not update them (I mean if I’m trying to modify the text area content, my changes cannot be saved)
          From the module code if I’m trying to get the site url and base_path the /manager is appended to the value, so I cannot load my files.
          Here are the config values from modx->config


          [base_url] => /~fredm/modx-0.9.7-2404/manager/
          [base_path] => /Users/fredm/Sites/modx-0.9.7-2404/
          [core_path] => /Users/fredm/Sites/modx-0.9.7-2404/core/
          [site_url] => http://fm.local/~fredm/modx-0.9.7-2404/manager/
          [manager_path] => /Users/fredm/Sites/modx-0.9.7-2404/manager/
          [manager_url] => /~fredm/modx-0.9.7-2404/manager/manager/
          [assets_path] => /Users/fredm/Sites/modx-0.9.7-2404/core/assets/
          [assets_url] => /~fredm/modx-0.9.7-2404/manager/assets/

          :-)

          OS: mac osx 10.4
          PHP Version : 5.2
          Apache : Apache/1.3.33 (Darwin)
          MySql: Client API version 5.0.24a
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 18397
            • 3,250 Posts
            I tried running Ditto under 0.9.7 but was unable to get past a blank white screen. What steps do I need to take to make it 0.9.7 compatible?
              • 11975
              • 2,542 Posts
              Hi Mark,

              I’ve made a few test and it seems that some of the modx->function does not workany more with the new core

              such as $cnt = @$modx->recordCount($result); in getDocument so the $cnt is ==  0

              :-)

              More about this:
              The regexp used to find [+placeholders+] will have to be changed to match the new [[+placeholder]] syntax.

              EDIT 2: I’ve got ditto working ! smiley
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 11975
                • 2,542 Posts
                So here are the changes I made in ditto

                in ditto.class.inc.php

                getDocuments Function
                <?php
                 $result= $modx->dbQuery($sql);
                	        $resourceArray= array ();	        
                	        $docs = $result->fetchAll(PDO_FETCH_ASSOC);//added this line
                	        //changed the following to replace getRecordCount
                			$cnt = count($docs);//@$modx->db->getRecordCount($result);
                //that's all 
                			$TVData = array();
                			$TVIDs = array();
                			for ($i= 0; $i < $cnt; $i++) {
                			
                	            $resource = $docs[$i];//$modx->fetchRow($result);
                				if($keywords) {
                					$resource = $this->appendKeywords($resource);
                				}
                				if ($this->prefetch == true && $this->sortOrder !== false) $resource["ditto_sort"] = $this->sortOrder[$resource["id"]];
                				$TVIDs[] = $resource["id"];
                				$resourceArray["#".$resource["id"]] = $resource;
                				if (count($this->prefetch["resource"]) > 0) {
                					$x = "#".$resource["id"];
                					$resourceArray[$x] = array_merge($resource,$this->prefetch["resource"][$x]);
                							// merge the prefetch array and the normal array
                				}
                	        }
                
                


                Same class appendTV function

                <?php
                		$rs = $modx->db->query($query);
                		$docs = $rs->fetchAll(PDO_FETCH_ASSOC);//changed here
                //the following line
                		$tot = count($docs);//$modx->db->getRecordCount($rs);
                		$resourceArray = array();		
                		
                		for($i=0;$i<$tot;$i++)  {
                //this one to
                			$row = $docs[$i];//@$modx->fetchRow($rs);
                
                


                In template class

                <?php
                	function findTemplateVars($tpl) {
                		//preg_match_all('~\[\+(.*?)\+\]~', $tpl, $matches);
                		preg_match_all('~\[\[\+(.*?)\]\]~', $tpl, $matches);
                
                


                I’ve not fully tested but ditto display the results listing smiley
                I’ve set PHx to 0
                Not yet tested with PHx enabled in ditto.

                Hope that helps

                :-)

                Edit: if PHx is enabled ditto doesn’t work any more.
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 6726
                  • 7,075 Posts
                  Great work Helio (again wink ) I guess Mark will be happy having part of the job done grin

                  I am just a "witness" of sorts here, but about PHx you might have missed this in Jason first post :

                  Quote from: OpenGeek at Feb 23, 2007, 03:09 PM
                  (...) phX and chunkie features are being merged into the modParser class functionality, and phX is now broken into two classes that can be overridden by deployment, context, and/or individual tag element; modInputFilter and modOutputFilter. I need help making this work; the code is at this point completely untested and likely broken (it still references some phX functions that no longer exist and need to be converted to native MODx 0.9.7 API).

                  Hope this helps...
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id
                    • 28215
                    • 4,149 Posts
                    Quote from: heliotrope at Feb 26, 2007, 03:07 AM

                    First I can create module but not update them (I mean if I’m trying to modify the text area content, my changes cannot be saved)

                    The code for save_module.processor.php is not yet converted - it’s still in 095 format - so I doubt it works yet.

                    Quote from: heliotrope at Feb 26, 2007, 03:07 AM

                    From the module code if I’m trying to get the site url and base_path the /manager is appended to the value, so I cannot load my files.
                    Here are the config values from modx->config


                    [base_url] => /~fredm/modx-0.9.7-2404/manager/
                    [base_path] => /Users/fredm/Sites/modx-0.9.7-2404/
                    [core_path] => /Users/fredm/Sites/modx-0.9.7-2404/core/
                    [site_url] => http://fm.local/~fredm/modx-0.9.7-2404/manager/
                    [manager_path] => /Users/fredm/Sites/modx-0.9.7-2404/manager/
                    [manager_url] => /~fredm/modx-0.9.7-2404/manager/manager/
                    [assets_path] => /Users/fredm/Sites/modx-0.9.7-2404/core/assets/
                    [assets_url] => /~fredm/modx-0.9.7-2404/manager/assets/

                    Just to confirm, I’m getting the same issue for the base_url/site_url stuff:

                     [base_url] => /modxdev/manager/
                     [base_path] => /Web_Server/modxdev/
                     [core_path] => /Web_Server/modxdev/core/
                     [site_url] => http://wwwtest.edb.utexas.edu/modxdev/manager/
                     [manager_path] => /Web_Server/modxdev/manager/
                     [manager_url] => /modxdev/manager/manager/
                     [assets_path] => /Web_Server/modxdev/core/assets/
                     [assets_url] => /modxdev/manager/assets/
                    
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                      • 11975
                      • 2,542 Posts
                      @david:

                      About PHx, ditto loads the phx files (its own instance)
                      I ve looked at the code but it’s out of my range skill grin
                      I’ll wait a more talented people find the solution

                      :-)
                        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l