Creating Media Nodes Programatically -> NullReferenceException
Hi,
Following installation of Multiple Start Nodes, creation of media nodes programmatically using MediaService 'CreateMediaWithIdentity' gives rise to a NullReferenceException. Removing Multiple Start Nodes clears the problem.
No issues creating nodes using ContentService 'CreateContentWithIdentity'.
For example, logged in as administrator, existing target parent media node Id 14820...
IMediaService mediaService = ApplicationContext.Current.Services.MediaService;
IMedia extractedDocumentsFolder = mediaService.CreateMediaWithIdentity("New Node", 14820, "Folder");
[NullReferenceException: Object reference not set to an instance of an object.]
MultipleStartNodes.Events.UmbracoStartupEvent.MediaServiceSaving(IMediaService sender, SaveEventArgs`1 e) +27
Umbraco.Core.Events.TypedEventHandler`2.Invoke(TSender sender, TEventArgs e) +0
Umbraco.Core.Events.EventExtensions.IsRaisedEventCancelled(TypedEventHandler`2 eventHandler, TArgs args, TSender sender) +24
Umbraco.Core.Services.MediaService.CreateMediaWithIdentity(String name, Int32 parentId, String mediaTypeAlias, Int32 userId) +283
Creating Media Nodes Programatically -> NullReferenceException
Hi,
Following installation of Multiple Start Nodes, creation of media nodes programmatically using MediaService 'CreateMediaWithIdentity' gives rise to a NullReferenceException. Removing Multiple Start Nodes clears the problem.
No issues creating nodes using ContentService 'CreateContentWithIdentity'.
For example, logged in as administrator, existing target parent media node Id 14820...
A
Hi Angus,
What version of Umbraco are you running? I'll see what I can find.
Thanks for reporting.
Angus,
I found the issue and released a new version with the fix. Let me know if you still have any issues.
Thanks!
Hi Dan,
New version installed and working as expected (Umbraco v7.5.10). Impressive response!
Thanks,
Angus
is working on a reply...