We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    Regardless of the settings, it’s looking like the default content is installed. It overwrites any content there. This is a show stopper, but should be a quick fix. I’m thinking that the "installdata" is never really set and so take a look (in install folder), around:

    around line 270 of index.php:
    		echo "<h1>Demo Site</h1><br/>";
    		echo " <input type='checkbox' name='installdata' value='1' />Install Demo Site</span> - Please note that this will overwrite existing documents and resources.<hr size='1' style='border:1px dotted silver;' />";


    around line 14 of instprocessor.php:
    $installData = intval($_POST['installdata']);


    around line 127 of instprocessor.php:
    // install data
    if(installData && $moduleSQLDataFile) {
    	echo "<p>Installing demo site: ";
    	$sqlParser->process($moduleSQLDataFile);
    	// display database results
    	if ($sqlParser->installFailed==true) {
    		$errors += 1;
    		echo "<span class='notok'><b>Database Alerts!</span></p>";
    		echo "<p>MODx setup couldn't install/alter some tables inside the selected database.</p>";
    		echo "<p>The following errors had occurred during installation<br /><br />";
    		for($i=0;$i<count($sqlParser->mysqlErrors);$i++) {
    			echo "<em>".$sqlParser->mysqlErrors[$i]["error"]."</em> during the execution of SQL statement <span class='mono'>".strip_tags($sqlParser->mysqlErrors[$i]["sql"])."</span>.<hr />";
    		}
    		echo "</p>";
    		echo "<p>Some table were not updated. This might be due to previous modifications.</p>";
    		return;
    	}
    	else {
    		echo "<span class='ok'>OK!</span></p>";
    	}
    }


    Am I correct in thinking that it’s just missing the $ in front of the "installdata".
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 34162
      • 1 Posts
      For one thing it is a syntax error to not having a "$" in front of a variable.
        • 25663 MODX Staff
        • 12,272 Posts
        Quote from: chanh at Oct 25, 2005, 09:59 PM

        Here are the 3 instances that I found to produce "double slash"

        document.parser.class.inc.php:463: $basepath = $this->config["base_path"]."/assets/cache/";
        document.parser.class.inc.php:507: $basepath = $this->config["base_path"]."/assets/cache";
        document.parser.class.inc.php:523: $basepath = $this->config["base_path"]."/assets/cache";
        Also at line 571, 1278, 1338 1482 and 1623... fixed in rev414 coming up soon.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 25663 MODX Staff
          • 12,272 Posts
          Rev 414 now in the top post
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 25663 MODX Staff
            • 12,272 Posts
            Quote from: chanh at Oct 25, 2005, 10:35 PM

            Here is my proposal to handle cache file problem for a site that can not allow cache.  If the file is not there don’t even try to wrtie to the cache thus will prevent any error to show.

            document.parser.class.inc.php
            line 526: $fname=$basepath."/docid_".$this->documentIdentifier.".pageCache.php";
            line 527: If (file_exists($fname)) {
            line 538: }

            It seems to make sense to me... any chance you could test that? Also, wouldn’t the line 526 result in the same "//" error? wink
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 34162
              • 1 Posts
              I already tested and it works just fine!

              I also found out why the phpxref not able to pick up the include is the way the include statement is written.
              This way will be skip by phpxref:
              include_once $base_path."/manager/includes/document.parser.class.inc.php";

              This way will be pick up by phpxref:
              include_once($base_path."/manager/includes/document.parser.class.inc.php");

              Would it be possible to code in the later convention so that phpxref can pick up the right include?
                • 25663 MODX Staff
                • 12,272 Posts
                Very cool! What about the // created by the same $basepath variable as the others?

                FWIW, please go ahead and patch rev414 to include this and use that as the base for the demo if you don’t mind. I’m committing it pronto. Can be rolled out later if it causes issues.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Interesting re: phpxref, too...
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 34162
                    • 1 Posts
                    Done, the demo has no more error of this type.
                      • 32963
                      • 1,732 Posts
                      From what I’ve seen in PHP // does not affect the file path at all.

                      For example:

                      assets//images/test.gif is seen as assets/images/test.gif
                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.