Seems that there was a transaction scope around my code, and umbraco decided to swallow the SQL Exception that the transaction needed to be closed before making the second part of my updates.
Well, found the cause, so now I just need to figure out how to work around it. Thanks all.
Media MakeNew throws exception at root
I am trying to create a folder at the root level of the media section, and it throws a null reference exception. Code is:
This seems to throw a null reference inside the base CMSNode.MakeNew method somewhere, but I can't figure out why.
Anyone seen this, or know a workaround?
I am calling the code from an exposed webservice, so there is no currentPage or similar, but I don't see that this should be an issue?
Maybe this is a long shot, but I just thought of this one: http://forum.umbraco.org/yaf_postst7538_Error-when-trying-to-create-in-Media-v4.aspx
>Tommy
Well, I'm not using the UI at all, so I shouldn't need the UI xml file to do this.
Morten,
Been caught with this one before you need to do the following when creating at the root you need to do
Media[] root = Media.GetRootMedias();
thats how i got it to work.
Regards
Ismail
I actually do that earlier in my code. I am looking if a folder already exists in the root, and if not, I want to create it.
I can loop through the existing nodes just fine. But can't create a new one. How does your complete code look?
Morten,
Doing this in an actionhandler:
Argh. Found the problem.
Seems that there was a transaction scope around my code, and umbraco decided to swallow the SQL Exception that the transaction needed to be closed before making the second part of my updates.
Well, found the cause, so now I just need to figure out how to work around it. Thanks all.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.