Try our conversational search powered by Generative AI!

LanguageBranch instances are returned directly from cache and are not immutable or implementing IReadOnly

Fixed in

EPiServer.CMS.Core 10.0.1

(Or a related package)

Created

Aug 26, 2015

Updated

Oct 27, 2016

Area

CMS Core

State

Closed, Fixed and tested


Description

When requesting an individual or list of LanguageBranch, the instances are returned directly from the cache without any copy being created. As the LanguageBranch class is not immutable, this means that any changes affect other users, whether it saved or even valid. Even though most properties are immutable, ID, SortIndex and ACL are not.

Breaking changes

  • LanguageBranch now implements IReadOnly, and all instances retrieved from the LanguageBranchRepository are now returned as read-only. To get an editable LanguageBranch instance, call CreateWritableClone(). New instances are created as writable. Most properties now have set methods, and some constructors specifically made to populate all properties have been obsoleted.
  • LanguageBranch.URLSegment now returns the LanguageID if not set to a custom value. CurrentUrlSegment is therefore no longer needed and has been obsoleted.