Creating a page with faulty data source references
Every once in a while a content editor walks up to me to tell me that a new page does not show the content as expected. When a content editor copies an item to create a new page this usually means the layout references the data sources of the original. When you copy a page, the page is copied together with all underlying item, but the copied item still references the data sources as defined in the source item.
Correcting the data source references when copying a page
Fortunately there is an easy solution to this problem. Jan Hebnes mentions a LayoutDataSourceReferenceUpdater in a blog post some years ago (http://www.sitecore.net/sv-se/learn/blogs/best-practice-blogs/jan-hebnes/posts/2012/09/unsharing-the-layout-field-in-sitecore.aspx).
This piece of code is registered as an item:saved event. When you copy an item all references in the layout field that point to a data source that is a descendant of the item copied are updated to point to the equivalent item under the copied item. I have modified Jan’s gist (https://gist.github.com/janhebnes/3550920) to also support the final layout field.
If you have content editors that sometimes work in the content editor, this might save them (and yourself) a lot of work.
Check out the modified source here: https://github.com/martywoods/Sc.Modules.Events.LayoutDataSourceReferenceUpdater
Available on NuGet: http://www.nuget.org/packages/Sc.Modules.Events.LayoutDataSourceReferenceUpdater/