U4-2457 - Umbraco 6.0.7 - Umbraco adds a number (1) to Document Name on Save / Publish in backoffice

Created by Enrico Recknagel 03 Jul 2013, 10:19:16 Updated by Morten Christensen 05 Jul 2013, 08:56:37

Relates to: U4-2458

If I edit a content node in Umbraco, the System adds (1) to the node name on Save, but the node name is unique. This just happens in one installation of umbraco, some others are fine. I mentioned this behavior after upgrading from 6.0.5 to 6.0.7.

2 Attachments

Download rhcsw_umbraco_bak.zip

Download Backup.zip


Enrico Recknagel 03 Jul 2013, 10:28:03

If I set "ensureUniqueNaming" to false, it works again. But content names are unique.

Morten Christensen 03 Jul 2013, 11:09:23

Sounds like the same issue as Bo described here: http://our.umbraco.org/forum/getting-started/installing-umbraco/42721-Possible-bug-in-612-regarding-locales-and-hostnames

I haven't tested with 6.0.7, but should be the same with 6.1.2 and I couldn't reproduce on a fresh install so I suspect that you have one or more items that has multiple versions set as Newest. I'll try and create a sql statement to verify whether this is the case.

Enrico Recknagel 03 Jul 2013, 11:20:05

Yepp, that's the issue. I tried it with different installations of umbraco only 1 out of 6 is affected.

Morten Christensen 03 Jul 2013, 11:47:40

Try running this query against your database to see if it returns any results

SELECT id, COUNT(id) as nodeCount FROM umbracoNode INNER JOIN cmsDocument ON cmsDocument.nodeId = umbracoNode.id WHERE cmsDocument.newest = '1' GROUP BY id HAVING COUNT(id) > 1

Enrico Recknagel 03 Jul 2013, 11:56:18

this statement return 0 rows :(

Morten Christensen 03 Jul 2013, 12:06:28

Would it be possible for you to upload a copy of the database? If you attach it to this issue and set "Visible to" HQ it will be hidden for everyone else but us.

Enrico Recknagel 03 Jul 2013, 12:21:55

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!

Morten Christensen 03 Jul 2013, 12:26:41

Which version of sql server is the backup from?

Morten Christensen 03 Jul 2013, 12:29:56

I'm getting an error when trying to restore the db, so assuming its a newer version then I have installed. Could I trouble you to script the database instead? From the "Generate Scripts" context menu and select both schema and data. That would be great!

Morten Christensen 03 Jul 2013, 13:35:35

Okay, I got the database up and running but I can't reproduce the issue. Did this problem only occur on specific items or? Can you give me an example of nodes where you saw this issue occur?

Morten Christensen 03 Jul 2013, 14:05:07

Okay, managed to reproduce the issue. But it looks like there actually is two "Abiturjahrgang 2010/2011 - Abschlusszeugnisse der Beruflichen Gymnasien mit PRIME LINE 4" items in the database. One with id 1559 and another with id 1483. The latter doesn't show up in the tree because it has no entry in the cmsDocument table, which is a bit odd. Has a node with the same name been deleted before? Also, could you try and search through the log file for 1483 to see what has happend to it if anything is logged.

Morten Christensen 03 Jul 2013, 14:15:24

Actually, it looks like everything under "Downloads" has been duplicated. Try running this query against your db and you will see duplicates of all nodes: SELECT [id] ,[trashed] ,[parentID] ,[nodeUser] ,[level] ,[path] ,[sortOrder] ,[uniqueID] ,[text] ,[nodeObjectType] ,[createDate] FROM [rhcsw_umbraco_bak].[dbo].[umbracoNode] WHERE parentID = '1171' ORDER BY text

So the question is how this happened. Has the Downloads-node been moved or copied?

Enrico Recknagel 03 Jul 2013, 14:16:09

It is possible that a item with same name was deleted. Maybe that's the fault. Is it possible to delete all nodes of this type that have no entry in cmsDocument? PS: The items in this section where produced and deleted via API in version 4.x - maybe some where not "fully" deleted.

Enrico Recknagel 03 Jul 2013, 14:17:02

Oops, thank you for the sql-statemant - I will check!

Enrico Recknagel 03 Jul 2013, 14:20:54

Ok. It's definitely how you described the problem. Is something like this possible?

DELETE FROM [rhcsw_umbraco_bak].[dbo].[umbracoNode]
WHERE parentID = '1171'
AND id not in (select nodeId from cmsDocument)

Morten Christensen 03 Jul 2013, 14:22:28

It could look like that is the case. If the nodes aren't properly deleted then you are likely to end up with orphan type nodes. I do seem to remember something about an issue with delete in v4 and I have heard other accounts of orphan nodes, but nothing specific or a specific issue.

Morten Christensen 03 Jul 2013, 14:24:36

You have to go through the cmsContentVersion and cmsContent tables before running that query against the umbracoNode table because of foreign key constraints, but I believe that query would work for all 3 tables. But do please make sure to create a backup of your database before running that query ;)

Mads Krohn 03 Jul 2013, 15:11:14

It seems to be, that if you name a document the same a the alias of a document type, you get the (1) rename. At least, I can consistently reproduce the error that way.

Enrico Recknagel 03 Jul 2013, 15:19:29

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. I think we can close this issue. Thank you all for that great help!

Morten Christensen 03 Jul 2013, 15:40:46

Great! Glad we got it resolved.

I'll create another issue for the bug that Mads mentioned. Its an easy fix and will only occur if both document and doc type has parent id -1, so will be in place for 6.1.3.

Moshe Kariti 05 Jul 2013, 08:31:28

Hi there, Got the same problem on 6.1.2. I have 2 websites - 1 fresh installation and 1 upgrade from 6.0.0 and both exhibit this issue. Any fix coming out? Cheers mkariti

Morten Christensen 05 Jul 2013, 08:56:37

Nightly build incl. this fix is available here: http://nightly.umbraco.org/umbraco%206.1.3/UmbracoCms.6.1.3-build.4.zip

Priority: Normal

Type: Bug

State: Closed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 6.0.7

Due in version:


Story Points: