I'm having a weird problem with publishing nodes through the API all of the sudden.
I'm running a Umbraco 4.5.2 using the .NET 4 framework.
I'm using the code below to create and publish news item through the API. I'm sure that it has been working earlier on but yesterday I suddenly experience this weird behavior. The problem is the in the content section the node icon indicates that the node has been published but under properties in the link it just gets the "#" character instead of a published URL. (Which you can see on the image)
namespace mysite.usercontrols { public partial class OpretNyhed : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) {
//Update the XML cache umbraco.library.UpdateDocumentCache(nodeid);
//Reload the page Response.Redirect(umbraco.library.NiceUrl(currentPage.Id)); } } }
Any ideas why this is happening?
I'm using jquery ui datepicker to set the date and I'm using tinyMce on a multiple textform to make the editors able to format the text. I have tried disabling these features but the problem remains. I'm clueless here.
Looking forward to hear some suggestions. Thanks in advance.
Ah sorry i did not look at the image very well. You need to make sure the name does not contain reserved characters.
I have a string extension method to remove such characters this may not be the main problem but Umbaco will have difficulty with ? in the document name.
run the name through this function and see what happens
Got it solved now. I must have rewritten something at some point...I starred myself blind...for some reason I had set the id to update the document cache to "nodeid", which is completely wrong
umbraco.library.UpdateDocumentCache(nodeid);
Should of course be
umbraco.library.UpdateDocumentCache(d.Id);
Thanks for the help Billy, somehow it led to the solution in the end :-)
Problem publishing node using the API
Hi there guys
I'm having a weird problem with publishing nodes through the API all of the sudden.
I'm running a Umbraco 4.5.2 using the .NET 4 framework.
I'm using the code below to create and publish news item through the API. I'm sure that it has been working earlier on but yesterday I suddenly experience this weird behavior. The problem is the in the content section the node icon indicates that the node has been published but under properties in the link it just gets the "#" character instead of a published URL. (Which you can see on the image)
Any ideas why this is happening?
I'm using jquery ui datepicker to set the date and I'm using tinyMce on a multiple textform to make the editors able to format the text. I have tried disabling these features but the problem remains. I'm clueless here.
Looking forward to hear some suggestions. Thanks in advance.
/Jan
You may be missing:
Try adding it before publish() hopefully that will work.
Hi Billy
I have added the line now - but unfortunately still no luck :-/ - I'm really puzzled about this. Any other suggesions maybe?
/Jan
Ah sorry i did not look at the image very well. You need to make sure the name does not contain reserved characters.
I have a string extension method to remove such characters this may not be the main problem but Umbaco will have difficulty with ? in the document name.
run the name through this function and see what happens
Hi again
Got it solved now. I must have rewritten something at some point...I starred myself blind...for some reason I had set the id to update the document cache to "nodeid", which is completely wrong
Should of course be
Thanks for the help Billy, somehow it led to the solution in the end :-)
/Jan
Hi Billy
That's a nice function, which I will study later on - thans for trying to help me out :-)
/Jan
is working on a reply...