# What has changed in the Template system in 10.3?

Bug introduced in 10.3 and fixed in 11.0.0

There are couple of issues that are breaking my code after upgrading to 10.3.

I wasn't able to narrow all of them down but this is what I've found. Somethings is going wrong with evaluation:

Let's put TemplateSlot inside TemplateExpression, like above, give to the former a default value and try to generate an example. In 10.2 and 10.3:

gives:

Have I missed something? Which one is expected result? I'd say 10.2 works as expected. Is this the case on Mac and Linux too?

A support case with the identification [CASE:3522351] was created.

• Looks like TemplateExpression is not working right in 10.3 ... Too bad we did not get a chance to beta-test before releasing this version. – Rolf Mertig Oct 18 '15 at 9:40
• @Kuba Would you share the official response (three workdays have certainly elapsed...) to the support case -- or at least give the gist of it? – gwr Feb 9 '16 at 11:35
• @gwr Bug is confirmed but the workaround is offtopic in my opinion :) but I will edit it later, maybe I've missed something :) – Kuba Feb 9 '16 at 11:36

## 2 Answers

There seems to be an incompatible change to NotebookExpression. While I don't quite know how to fix your example, I went ahead and fixed my trouble, i.e. just some input cells which have to be evaluated and hidden. This can be achieved with the following button:

   Button["TemplateExpression Exorcist",
Module[{cell},
(* move from inside the cell to the visible cell bracket *)
Do[SelectionMove[SelectedNotebook[], All, Cell], {10}];
cell = (NotebookRead[SelectedNotebook[]] /.
Cell[BoxData[
FormBox[TemplateBox[boxes_,
"NotebookTemplateExpression"], _]]] :> boxes ) //.
BoxData[{b_, "General", BoxData}] :> BoxData[b];
NotebookWrite[SelectedNotebook[], cell]]] // CreatePalette


So a cell like this one (whichi works in a template in 10.2)

Cell[BoxData[Cell[BoxData[
FormBox[
TemplateBox[{RowBox[{
RowBox[{"myreport", "[",
RowBox[{
Cell[
BoxData[
FormBox[
TemplateBox[{"\"var\"", "\"t0\"", "Named", BoxData}, "NotebookTemplateSlot"],
TextForm]]], ",", "\"novar\""}], "]"}], " "}],"General",BoxData},
"NotebookTemplateExpression"], TextForm]]]], "Input",
CellFrameLabels->{{
Cell[
BoxData[
TemplateBox[{"EvaluateDeleteInput"}, "NotebookTemplateCellBehavior"]]], None}, {None, None}}]


is change to a working one (in 10.3)

Cell[BoxData[
RowBox[{
RowBox[{"myreport", "[",
RowBox[{Cell[BoxData[
FormBox[
TemplateBox[{"\"var\"","\"t0\"","Named",BoxData},
"NotebookTemplateSlot"], TextForm]]], ",", "\"\<novar\>\""}], "]"}], " "}]], "Input",
CellFrameLabels->{{
Cell[
BoxData[
TemplateBox[{"EvaluateDeleteInput"}, "NotebookTemplateCellBehavior"]]], None}, {None, None}}]


This bug was fixed with V11.0.0 release.