Datasource Location and Datasource Template fields should be stored as GUID types
The Datasource Location and Datasource Template fields on View Renderings, Controllers and Sublayouts are currently "Datasource" and "Internal Link" type fields currently, which is stored a string path and not a GUID.
This leads to issues if the folders are moved around or templates are re-organised after having set these values. It breaks functionality in the Experience Editor when adding a component and the Select Datasource wizard throws an error/does not open.
It's a lot of work to go through all the components and change these manually to the new location rather than these fields following best practice and using a guid.
Richard Cabral commented
I second Kamruz's comment, if you pick an Item, the stored value should be an ID, not a path. If you put XPath in the field, obviously store the XPath.
Kamruz Jaman commented
Just to be clear, I'm not stating that *only* ID's should be supported, but selecting a template using the field selector should store the ID. Same of data tokens. These all run through pipelines so nothing should break in these instances. The developers will still be able to manually enter queries/tokens/whatever. Not storing the ID when using the selector is different behaviour to other areas in Sitecore.
Andreas Gehrke commented
The Datasource Location field must support queries, so it can't just store ID.
Not sure about the Datasource Template. Some people might have implemented use of dynamic tokens in the path.