**Describe the bug** Undefined variable '$template_fields'. I guess it should be $data_template_fields For some fix-able(by me) issues, I'll summarize and log another ticket with diff