Got the following call:
var templatePath = "/User Defined/Project/Common/Content Types/Links";
var template = TemplateManager.GetTemplate(templatePath, Context.Database);
This is always returning null. I have checked the template path and can confirm 100% it is correct, the database is also present. This issue is happening in 8.2 any ideas on what I might be missing?
Immediate Window Debug Information
Context.Database
{web}
Aliases: {Sitecore.Data.AliasResolver}
ArchiveNames: Count = 2
Archives: {Sitecore.Data.Archiving.DataArchives}
Branches: {Sitecore.Data.BranchRecords}
Caches: {Sitecore.Data.DatabaseCaches}
ConnectionStringName: "web"
DataManager: {Sitecore.Data.DataManager}
DataProviders: Count = 1
Engines: {Sitecore.Data.DatabaseEngines}
HasContentItem: true
Icon: "Images/database_web.png"
Items: {Sitecore.Data.ItemRecords}
Languages: {Sitecore.Globalization.Language[1]}
Masters: {Sitecore.Data.BranchRecords}
Name: "web"
NotificationProvider: null
Properties: {Sitecore.Data.DatabaseProperties}
Protected: false
ProxiesEnabled: false
ProxyDataProvider: {Sitecore.Data.SqlServer.SqlServerProxyDataProvider}
PublishVirtualItems: true
ReadOnly: false
RemoteEvents: {Sitecore.Data.Eventing.DatabaseRemoteEvents}
Resources: {Sitecore.Resources.ResourceItems}
SecurityEnabled: true
"sitecore": sitecore (en#1@web), id: {11111111-1111-1111-1111-111111111111}
Templates: {Sitecore.Data.TemplateRecords}
WorkflowProvider: null
TemplateManager.GetTemplate("/sitecore/Templates/User Defined/Project/Common/Content Types/Icon Links", Context.Database)
null
TemplateManager.GetTemplate("/sitecore/templates/User Defined/Project/Common/Content Types/Icon Links", Context.Database)
null
TemplateManager.GetTemplate("User Defined/Project/Common/Content Types/Icon Links", Context.Database)
null
Snip of item path, on web database.
Update
TemplateManager.GetTemplate("/sitecore/templates/System/Templates/Standard template", Context.Database)
null
Using immediate window to try and get standard template also fails.