Anders G. Nordby

Lead Software Engineer at Sopra Steria

EPiServer 7.5: Problem with Updating PageTypes

For the site I’m working on, we’re creating a calculator for helping visitors select the right products. This kind of thing is very popular at the moment – I’m starting to wonder if there are any frameworks or domain specific languages for creating this kind of calculators? Well, anyway, we’re doing this the old-style way… So I have a pagetype called RoofCalculatorPage, because the site is about construction work. The calculator consists of several steps, and to make it easy for the editors (and us developers), I’ve created a blocktype for each step. As the blocktype is only used for grouping properties, I’ve created it like this (note the AvailableInEditMode = false to make sure it’s not possible for editors to create instances of this block):

        DisplayName = "RoofCalculatorStep1Block", 
        GUID = "8274e516-95b5-4e75-b80c-26d90f961297", 
        Description = "",
        AvailableInEditMode = false
    public class RoofCalculatorStep1Block : BlockData
        public virtual string Title { get; set; }

So I have many of these, and I then litter my RoofCalculatorPage with them. Since this is a copy paste job, and I’m working quickly on this, I end up making a common type of copy-paste-error:

        DisplayName = "RoofCalculator", 
        GUID = "19777f46-2d73-4977-8b51-8dbe83058ad0", 
        Description = "The roof calculator page"
    public class RoofCalculatorPage : SitePageData
            Name = "Step 1",
            GroupName = SystemTabNames.Content
        public virtual RoofCalculatorStep1Block Step1 { get; set; }

            Name = "Step 2",
            GroupName = SystemTabNames.Content
        public virtual RoofCalculatorStep1Block Step2 { get; set; }

            Name = "Step 3",
            GroupName = SystemTabNames.Content
        public virtual RoofCalculatorStep1Block Step3 { get; set; }

For those who don’t spot this immediately, notice that I’ve set all my steps to be of the type RoofCalculatorStep1Block. Now, this results in the following situation:

I spot this fairly quickly – oops, a glitch there – fix it, and rebuild. Now everything is fine, right? Wrong! The situation is still the same, the admin GUI looking exactly as before. A bit perplexed, I blink, and go back to my Visual Studio window. Yes, I did really build, the text “Build succeeded” is still visible at the bottom of the screen. I go to the browser, and hit Ctrl+F5. Same result. I rebuild, just for the heck of it, then refresh my browser again. Still the same.

For a while I fiddle around in the admin GUI, thinking there surely must be some way of telling EPiServer to refresh the properties, since what’s in the DB is obviously inconsistent with what’s in the code. Nope! I find no way of doing this from the GUI. The only way I could find to fix the situation, was to comment out (remove) the properties from code, rebuild, refresh browser – which of course removed all the properties – and then comment the properties back in again, rebuilding and refreshing once more.

This problem is actually quite serious. Why? Because, suppose another of the developers on my team decided to change a property from one type to another… Then I’ll not be able to see the update – and I might not even know about the fact that he’s just updated this particular type.


4 responses to “EPiServer 7.5: Problem with Updating PageTypes

  1. Johan Sven Petersson 2014-02-12 at 18:49

    I’ve noticed this as well. My properties already had values, so I couldn’t remove them and recompile. I changed the property types in the DB instead :/

  2. Anders G. Nordby 2014-02-13 at 17:30

    I could have posted this to the EPiForum, but I found that having it on the frontpage of EPiWorld would make more people see it – and be aware of it until there’s a fix for it.

  3. Pär Mikael Holten 2014-12-10 at 09:53

    I have the same problem with one of our solutions.

  4. Polina 2016-12-26 at 15:40

    I’ve found the magic button “revert to default” there (in admin => your page type => settings and go to the bottom), worked for me, hope will help someone)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: