Umbraco duplicate nodenames with (1)
# help-with-umbraco
s
Hello! Question about ContentSavingNotification in umbraco 10.6.2: We notice that sometimes pages with same nodeName automatically are renamed to nodeName (1). We would like to fully disable this feature and cancel the save and/or publish of this node. Anyone got experience with this? Thanks in avance!
s
This used to be a config setting but we don't allow non-unique node names any more. All the methods responsible for adding the suffix also seem to be internal so it can't be overridden. But according to your requirements I think you can hook into
ContentPublishingNotification
(https://docs.umbraco.com/umbraco-cms/reference/notifications/contentservice-notifications) and cancel the publish if the URL contains a
(1)
suffix. Although it might require
ContentPublishedNotification
because only during publishing the URL gets generated I believe, so you won't know the end result until the item has been published. At that point you could choose to unpublish it based on the generated suffix on the URL.
s
Hey @Sebastiaan, I've indeed tried this already and that's a possible solution. However we would like to cancel it a bit earlier if possible before the node is saved OR published in the contentSavingNotification. Any idea if that is possible?
s
No idea, from what I could glance from the source code it doesn't seem possible.
s
Ok, that's unfortunate 😕 Thanks anyways @Sebastiaan !