November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
var serviceLocationHelper = ServiceLocator.Current.GetInstance<ServiceLocationHelper>();
var contentRepository = serviceLocationHelper.ContentRepository();
contentRepository.Save(personPage, SaveAction.Publish, AccessLevel.NoAccess);
Ok. then it should not be a cache-problem since that repository updates the cache also.
Are the sites load balanced?
Nope, regular single server setup. Able to recreate the error on my developing machine as well.
Ok. Then it is very strange. I guess that phone is a string and that should be able to be null.
If you can recreate it in development, activate debug-logging and see if you can see anything in the logs.
How property is defined on the page type? Can you paste code? Is it just ordinary property or some override?
The properties are regular virtual properties
[Editable(true)]
[Display(
Name = "FullName",
Description = "",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual String FullName { get; set; }
[Editable(true)]
[Display(
Name = "Email",
Description = "",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual String Email { get; set; }
[Editable(true)]
[Display(
Name = "Phone",
Description = "",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual String Phone { get; set; }
[Editable(true)]
[Display(
Name = "Mobile",
Description = "",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual String Mobile { get; set; }
[Editable(true)]
[Display(
Name = "Title",
Description = "",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual String Title { get; set; }
Had to change the way I updated the value since empty strings caused this behaviour as well
personPage.Phone = null;
personPage.Phone = string.IsNullOrEmpty(person.WorkPhone) ? " " : person.WorkPhone;
We have a scheduled task that reads data from a database and creates/updates pages in EPiServer. The weird part of this that if a property on a page has had a value, for instance a phonenumber and this value is deleted from the database.
The first time after this when the task executes the value of the page gets emptied as expected. But the second time the task executes the value gets reset to the previous value even though the value from the database still is empty/null.
And then it continues with this set/reset of the value on each execution of the task...
On update I create a writableClone of the page and sets all the properties like this:
When debugging I can see that the WorkPhone of the EF object person is null and the personPage just before the saveAction.Publish has null on the Phone but when I reload the updated page the Phone contains the previous value.
Have tried setting all values to null before seting the value, like so:
But that doesnt work either and why would it since Workphone is null. The only thing thats keepeing the previous value to reappear between executions is to set the value to a string with a space, like this:
Why this strange behaviour?