Media Data does not implement ILocalizable, so cant have Language Specific versions. Are you doing something be-spoke which might be trying to retrieve language values and returning null as not supported ?
Might need to see more of the Stack Trace or even ths code to see where it could be going wrong.
Hi,
I am getting error in highlighted code.
[AllowedTypes(typeof(IStandardVttMedia))]
[Display(GroupName = ApplicationConstants.EditTabs.Content, Order = 1030, Name = "Tracks", Description = "List of video tracks: captions (for the deaf), chapter titles, descriptions (for the blind), subtitles (language translations), etc.")]
public virtual ContentArea Tracks { get; set; }
public Video CreateVideo(IStandardVideoMedia standardVideo)
{
var sources = standardVideo?.AdditionalSources?.GetFilteredItemsOfType<IStandardVideoMedia>(_contentLoader) ?? new List<IStandardVideoMedia>();
var tracks = standardVideo?.Tracks?.GetFilteredItemsOfType<IStandardVttMedia>(_contentLoader);
var video = new Video()
return video;
}
using EPiServer.Core;
public interface IStandardVttMedia : IContentMedia, ILocale
{
string Kind { get; set; }
string Label { get; set; }
}
Yes, we are using the same for GetFilteredItemsOfType.
Do you have a specific ContentType defined that implements IStandardVttMedia? I believe this content type should also implement IContentData for that Helper to work.
If you have a look at the base MediaData class you will see an example.
This seems to be a bug in CMS12 and I just (5 min ago) created a support ticket to EPi regarding this.
I have noticed that when getting a ContentArea property from a MediaData content type this sometimes will throw an ArgumentNullException in EPiServer.DataAbstraction.Internal.LanguageBranchRepository.Load(CultureInfo culture)
This bug is very tricky to reproduce, since it seems to be very dependant on how the content has been loaded. E.g. if the MediaData is loaded in edit mode or by ContentLoader.Get this bug does not occur. And also loading the MediaData "a way that works" refreshes the cache - making loading the MediaData "ways that does not work" to suddenly work.
I have been able to reliably reproduce the bug by:
What I believe (but havent 100% verified) is:
Hi,
I am using Opti CMS version 12.16.0 and getting issue as below:
value cannot be null. (Parameter 'culture')
When trying to get items of Content Area : - media.Tracks
Content Type is Media type for images
stack trace :
at EPiServer.DataAbstraction.Internal.LanguageBranchRepository.Load(CultureInfo culture)
at EPiServer.DataAccess.Internal.ContentDB.LoadList(PropertyData property, ContentReference contentLink, CultureInfo language, String propertyScopeName, Nullable`1 includedPropertyDefinitionId)
at EPiServer.DataAccess.Internal.ContentDB.<>c__DisplayClass99_0.<AssignDelayLoadedFactory>g__delayedLoader|0()
at EPiServer.Core.Internal.LazyValueInitializer.EnsureInitialized[TReference](TReference& reference, Func`1& lazyValueFactory, Func`2 init)
at EPiServer.SpecializedProperties.PropertyContentArea.get_ContentArea()