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

    I have a strange problem since 2010.

    When i make a new document, the website will publish this correct, but when i update the document, changes are not shown on the site. The changes are saved in the database and in the backend the changes do appear. In the preview screen the changes don’t appear. It is not a cache problem because i refresh and clear cache like i should. It’s running on 0.9.6.3

    I hope anyone has an idea without needing an update.

    thanks
      • 33982 ☆ A M B ☆
      • 476 Posts
      Greetings sjeijk,

      Is this a ditto output or just a plain content on a page? When I run into this problem you’re mentioning, more often than not the problem is that I have the document set to cacheable (which is different than the browser caching) or ditto is called cached when it needs to be uncached, i.e. [[Ditto? ...]] vs. [!Ditto? ...]
        Precision Web Development ... SmashStack.com
        • 27437
        • 49 Posts
        Hi Flinx,

        I don’t use ditto on the site. It’s http://www.allfengshui.nl by the way.

        It’s normal content and also the title, long title etc. don’t change, but the alias changes like it should... :/

          • 33982 ☆ A M B ☆
          • 476 Posts
          And you’ve cleared the cache in MODx? I’m sure you probably have, but just wanted to ask to make sure ... On the Site tab, go to "Clear Cache". I know this probably another silly question, but you for sure have the proper placeholders in the Template (i.e. [*content*], [*pagetitle*], etc.)...in other words you didn’t accidentally hard code the HTML text in? Just thinking out loud on that question...
            Precision Web Development ... SmashStack.com
            • 27437
            • 49 Posts
            i cleared the cache like i should

            also clear my safari cache and also tried it in firefox without any result

            and placeholders FE

            <title>[(site_name)] | [*pagetitle*]</title>
            ...
            [*#content*]
            


            I really dont understand this, when i change the template, in the backend it shows the template but it will not change in the frontend. Also code changes in the templates dont go normal...

            If i press clear cache, it says

            0 documents were published.
            0 documents were unpublished.
            Cache: Found 0 files in cache directory and deleted 0 cache files.
            New cache files will be created when pages are requested.

            any chance the function ’clear cache’ is broken?

            sigh help is really appreciated
              • 27437
              • 49 Posts
              I figured out it has to do with the cache.. I manually cleared the documents in the folder assets/cache/ then the updates where visible again on the website.

              But still it’s a problem because somehow pressing the ’clear cache’ button should clear the cache but it doesn’t....

              Any ideas??
                • 27437
                • 49 Posts
                Solved it by commenting some code in cache_sync.class.processor.php

                and working ok again

                	function emptyCache() {
                		if(!isset($this->cachePath)) {
                			echo "Cache path not set.";
                			exit;
                		}
                		
                		
                		
                		$filesincache = 0;
                		$deletedfilesincache = 0;
                	
                // 		if (function_exists('glob')) {
                // 			// New and improved!
                // 			$files = glob(realpath($this->cachePath).'/*');
                // 			$filesincache = count($files);			
                // 			
                // 			$deletedfiles = array();
                // 			while ($file = array_shift($files)) {
                // 				$name = basename($file);
                // 				if (preg_match('/\.pageCache/',$name) && !in_array($name, $deletedfiles)) {
                // 					$deletedfilesincache++;
                // 					$deletedfiles[] = $name;
                // 					unlink($file);
                // 				}
                // 			}
                // 		} else {
                		
                		
                			// Old way of doing it (no glob function available)
                			if ($handle = opendir($this->cachePath)) {
                				// Initialize deleted per round counter
                				$deletedThisRound = 1;
                				while ($deletedThisRound){
                					if(!$handle) $handle = opendir($this->cachePath);
                					$deletedThisRound = 0;
                					while (false !== ($file = readdir($handle))) {
                						if ($file != "." && $file != "..") {
                							$filesincache += 1;
                							if ( preg_match("/\.pageCache/", $file) && (!is_array($deletedfiles) || !array_search($file,$deletedfiles)) ) {
                								$deletedfilesincache += 1;
                								$deletedThisRound++;
                								$deletedfiles[] = $file;
                								unlink($this->cachePath.$file);
                							} // End if
                						} // End if
                					} // End while
                					closedir($handle);
                					$handle = '';
                				} // End while ($deletedThisRound)
                			}
                		
                //		 }
                

                  • 3749
                  • 24,544 Posts
                  I think that problem is gone in newer versions of MODx. You might think about upgrading -- the newer versions are more secure.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 27437
                    • 49 Posts
                    Thanks i will!
                      • 19370
                      • 24 Posts
                      <title>[(site_name)] | [*pagetitle*]</title>
                      ...
                      [*#content*]


                      have you tried this?
                      <title>[(site_name)] | [*pagetitle*]</title>
                      ...
                      [*content*]