Hi Jan and thank you for the fast response. We use MS SQL Server 2012 Express.
the documents were initialy created by the API, but last year.
if i edit "per hand" in backoffice or with the api in both cases - umbraco adds (1), i can remove it, if i save again, the (1) will be added again, so i can't remove
Hmm ok, can you show some of the code you use to interact with the API? I think this might be an issue to report on the issue tracker but perhaps the answer lies in the code if someting has changed in the API (Can't remember if it has though - but let's have a look).
umbraco.cms.businesslogic.web.Document d = new umbraco.cms.businesslogic.web.Document(n.Id); var p = d.getProperty("date"); if (p != null) { p.Value = DateTime.Now; d.SaveAndPublish(new umbraco.BusinessLogic.User("umbracoExtensions.rhcsw")); umbraco.library.UpdateDocumentCache(d.Id); }
Think that you should perhaps place a issue on the issue tracker about this - missed the "Happens when I create using the backoffice" part before - you find the issue tracker here http://issues.umbraco.org
Hi, i will change the code, but what should i do with the existing content. The content was created by api one year ago and if i edit it in backoffice the (1) will be added.
Ok, seems like a bug to me - I think the best thing you can do now is to report it as an issue on the aforementioned issue tracker. However I don't think anything is done to the database during the upgrade form 6.0.5 to 6.0.7 though.
But if it is a problem in Umbraco then the core team will have a look at it.
Thank you very much. I set "ensureUniqueNaming" to false, so it works for me now. But I never changed this setting and all content names are unique. I posted an issiue. Thank you very much!
with the great help of the core team we found the reason!
The nodes were duplicated and had no entry in cmsDocument, so i removed them in the database. Now everything works just fine - as it schould. It is no Problem with 6.0.7, but maybe it was a problem in 4.xxx, when some nodes were deleted and recreated under same name. Now, because "ensureUniqueNaming" is woring correct, it looks like an error.
Super glad you managed to find the solution and thank you very much for sharing the link and how you solved it. That's the way things should be - #H5yr! - If you're thinking...wat? Then have a look at http://www.h5yr.com :)
Umbraco 6.0.7 - Umbraco adds number (1) to Document Name on Save / Publish
If I edit a document an save it or publish it, umbraco adds automaticly a (1) to the document name. (The document name is unique).
Hi Enny and welcome to our :)
Does this happen to every document hat you create?
I suppose the documents are created from within the Umbraco backoffice - not using the API or doing some API interaction on document creation somehow?
Feel free to post a screendump as well - btw what database are you using?
Looking forward to hearing from you.
/Jan
Hi Jan and thank you for the fast response. We use MS SQL Server 2012 Express.
Thanks for your help!
Image: http://www.rhc-software.de/transfer?f=&i=scrimg_umbr.png
/Enny
Hi Enny
Hmm ok, can you show some of the code you use to interact with the API? I think this might be an issue to report on the issue tracker but perhaps the answer lies in the code if someting has changed in the API (Can't remember if it has though - but let's have a look).
/Jan
The code I used is the folowing:
umbraco.cms.businesslogic.web.Document d = new umbraco.cms.businesslogic.web.Document(n.Id);
var p = d.getProperty("date");
if (p != null)
{
p.Value = DateTime.Now;
d.SaveAndPublish(new umbraco.BusinessLogic.User("umbracoExtensions.rhcsw"));
umbraco.library.UpdateDocumentCache(d.Id);
}
But it happens now, even if I use the backoffice.
Thanks!
Hi Enny
Ok, one reason for this might be that the above code is based on the old API, which still works but is deprecated.
You can read more about the new API's in v6 here http://our.umbraco.org/documentation/Reference/Management-v6/
I think I have an example on how to create documents using the new API somewhere...I'll try to see if I can find it and then post an example in here.
/Jan
Hi Enny
Think that you should perhaps place a issue on the issue tracker about this - missed the "Happens when I create using the backoffice" part before - you find the issue tracker here http://issues.umbraco.org
/Jan
Thank you Jan,
Hi, i will change the code, but what should i do with the existing content. The content was created by api one year ago and if i edit it in backoffice the (1) will be added.
do you hav any idea?
How many nodes are we talking about?
/Jan
151 nodes.
But now i have a bigger problem. I opened the sort window for the parent node and clicked SAVE. Now every childnode has the (1) and i can't change.
I have to restore a backup....
/Enny
Hi Enny
Hmm, ok that's really weird. I'm sorry I don't have any clue about what is going on.
But perhaps you should disable the API interaction and see if the problem still persists?
/Jan
Hi! Restored the backup, no interaction with API only backoffice, the problem persits.
I tried this with an other installation, and ther it works.Problem seems to bin in database.
Hi Enny
Ok, seems like a bug to me - I think the best thing you can do now is to report it as an issue on the aforementioned issue tracker. However I don't think anything is done to the database during the upgrade form 6.0.5 to 6.0.7 though.
But if it is a problem in Umbraco then the core team will have a look at it.
Cheers,
Jan
Thank you very much. I set "ensureUniqueNaming" to false, so it works for me now. But I never changed this setting and all content names are unique. I posted an issiue. Thank you very much!
Hi Enny
Yeah, sounds like a weird issue. Glad you figured out a workaround for now :)
/Jan
Posted an Issue: http://issues.umbraco.org/issue/U4-2457
with the great help of the core team we found the reason!
The nodes were duplicated and had no entry in cmsDocument, so i removed them in the database. Now everything works just fine - as it schould. It is no Problem with 6.0.7, but maybe it was a problem in 4.xxx, when some nodes were deleted and recreated under same name.
Now, because "ensureUniqueNaming" is woring correct, it looks like an error.
Thank you all for that great help!
Hi Enny
Super glad you managed to find the solution and thank you very much for sharing the link and how you solved it. That's the way things should be - #H5yr! - If you're thinking...wat? Then have a look at http://www.h5yr.com :)
/Jan
is working on a reply...