Vulnerability in EPiServer.Forms
Why can't I remove the expire date on a product or variant? I can set any date but when pushing the button "Remove expiration date", the field is cleard and it looks ok, but when I refresh the product or variant the date comes back?Why is this? I'm sure that the expiration date could be empty before and the StopPublish is a nullable DateTime so I should work or maybe I'm missing something?
I get the same behaviour in Foundation.
When creating commerce creation the content is automatically set to have an expiration date 10 years in the future when the expiration was left blank. Further editing content to remove the expiration shows the same results.
This is actually intended functionality within the commerce items. The way that the commerce data layer is designed will require an expiration date. If this expiration is not specifically set at any point the system will have the content expire in 10 years to replicate the behavior of omitting an expiration date.
Late to the party, but the way the catalog system was designed, the stop publish date ("End Date") was not null, so it is always required. Removing that is a breaking change and we decided to stick with it.
Ok, so now it accepts null but if you set null Commerce sets a date 10 years a head meaning it will never be null?
Yes. The Stop Publish is a CMS concept, which allows null. End Date (the underlying Commerce concept) does not, so you can set StopPublish to null, but EndDate will always be auto-set.
Ok, thanks Quan.