LPS-33828 Fix error when adding layout templates or site templates