Try our conversational search powered by Generative AI!

Problem when upgrading custom property

Vote:
 

I have a custom property that is used to display a google map. In edit you can move around in the map and select what the property should show on the page.

It is rather complicated and uses an ascx to show the map. Maybe it would be better to write a new one but I have instead tried to upgrade it. After implementing the solution that is described in the link below I don´t get any errors.

http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2013/1/Getting-EPiServer-6-custom-properties-to-work-in-EPiServer-7-Cannot-create-and-populate-list-type/

The property seems to work fine. It opens up in a popup witch I understand is how it should be when upgrading a property. I can set a new value and save it and open it again and the value is correct. But when I publish the value is not saved to the database.

In my property class whitch inherit propertydata I can follow what happends in the metodes below. And it looks right. It sets the value that I have selected but when I am going to publish it seems that Episerver throws it away. Sometimes I also get "Offline, can´t save" error when page is trying to autosave after I changed my property.

/// <summary>
/// Inherited. Gets or sets the value of the String property.
/// </summary>
public override object Value
{
  get
  {
      return this.IsNull ? null : this.Settings;
  }
  set
  {
      base.ThrowIfReadOnly();
      base.SetPropertyValue(value,
      delegate { this.Settings = value.ToString(); });
  }
}

/// <summary>
/// Gets or sets the location value of this property.
/// </summary>
[System.Xml.Serialization.XmlIgnore]
protected virtual string Settings
{
  get { return this._settings; }
  set
  {
      base.ThrowIfReadOnly();
      if (PropertyData.QualifyAsNullString(value))
      {
          base.Clear();
      }
      else if ((this._settings != value) || this.IsNull)
     {
          this._settings = value;
          base.Modified();
     }
  }
}

#86737
May 29, 2014 11:26
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.