21490 Posts in 5783 Topics by 2622 members
|Go to End|
12 May 2011 at 3:49am
After making some changes to my site's code base, and doing some testing locally, I uploaded the contents of the mysite/code folder to the test environment. After rebuilding the database, I expected to see the new fields I had added to my pages show up in the CMS. (Added entries to 'has_one' in Page.php, and added the nescessary CMS fields to getCMSFields().)
However, there was no change to the CMS pages content. Even after several /?flush=1, /?flush=all and database rebuilds (In random order), no change. Using the /dev/viewcode page I checked the source code that was on the server. To my surprise, I found myself looking at an old version.
Double-checking, the files on the server really had been updated. On top of that, I also changed some template code, and all those changes showed up fine on the site.
It almost seems as if SS keeps the old version in a cache somewhere.
Is there anyone who can shed some light on this issue?
Many thanks in advance,
12 May 2011 at 10:39am
Which version are you using?
I have often thought "why hasn't this changed" and it usually comes back to my error. I do however sometimes need to create a silverstripe-cache folder (to override the default cache folder, the php temp folder) so that I can delete it's entire contents to force the complete flush.
12 May 2011 at 7:03pm
It turns out that SS was indeed using an old version of my code.... that I had left on the server myself. Before copying my new sources I had made a copy of the mysite folder and left it in the root of the SS installation. Removing the backup solved the problem, so it appears that SS loads all folders in its root, overwriting the new classes with the old ones in its memory.
Thanks for the info on the SS cache folder. It comes in handy.
|Go to Top|