Jump to:

22996 Posts in 11620 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » CMS does not load updated sourcecode

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 881 Views
  • BartM
    Avatar
    Community Member
    9 Posts

    CMS does not load updated sourcecode Link to this post

    Hello all,

    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,

    Bart.

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: CMS does not load updated sourcecode Link to this post

    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.

  • BartM
    Avatar
    Community Member
    9 Posts

    Re: CMS does not load updated sourcecode Link to this post

    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.

    Sincerely,
    Bart

    881 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.