← ~/changelog / 2026-09-01
uSync: template content now comes from the template service, and the compiled-views fallback actually works
Repo: KevinJump/uSync
- Template import now asks Umbraco's
ITemplateServicefor the file content first, before falling back to the view filesystem and then to a placeholder when the views are compiled into the site - Fixed the check on that new call:
GetFileContentStreamAsyncnever returns null, it hands backStream.Nullfor a missing file - so we always took the "found it" branch, read an empty string, and made both fallbacks below it unreachable. A missing template file was being imported as an empty template instead of failing - Fixed the placeholder we give Umbraco for a compiled view:
TemplateContentParserServiceneeds a trailing semi-colon to parse theLayoutvalue, so{ Layout = "master" }never matched and the master template was never set. Now written as valid razor, withLayout = null;for root templates - Aligned
ViewPath(and the handler's copy) with how Umbraco actually names the view file - the alias verbatim, perTemplateRepository.SetVirtualPath- instead of stripping spaces, so we don't look for or delete the wrong file - Dropped the
CleanseNodeoverride: it removed aContentelement but the element isContents, so it had never done anything.TemplateTrackertracks/Contentsexplicitly, so making it work would have put the change hash and the tracker in disagreement - Tidied the same files - unused
_shortStringHelper, dead null checks on injected services,GetContentFromFilemade private, content fetch moved into the create branch so updates stop paying for a read they discard - Added tests for creating a template with no file on disk, asserting the placeholder parses back to the parent alias using Umbraco's own
TemplateContentParserService; verified they fail against the pre-fix code - Merged via PR #1059