If you have hacked the template file, see if you have this query:
PHP Code:
$templates=$DB_site->query("SELECT t1.title,t2.templateid,t2.title,NOT ISNULL(t2.templateid) AS found".iif(isset($searchstring),",INSTR(t1.template,'".addslashes($searchstring)."') AS globalcontain,INSTR(t2.template,'".addslashes($searchstring)."') AS localcontain","")." FROM template AS t1 LEFT JOIN template AS t2 ON (t1.title=t2.title AND t2.templatesetid=$templateset[templatesetid]) WHERE t1.templatesetid=-1 AND t1.title<>'options' ORDER BY t1.title");
If you do, replace it with this one:
PHP Code:
$templates=$DB_site->query("SELECT t1.title AS title,t2.templateid, NOT ISNULL(t2.templateid) AS found" . iif(isset($searchstring), ",INSTR(t1.template,'".addslashes($searchstring)."') AS globalcontain,INSTR(t2.template,'".addslashes($searchstring)."') AS localcontain","")."
FROM template AS t1
LEFT JOIN template AS t2 ON (t1.title=t2.title AND t2.templatesetid=$templateset[templatesetid])
WHERE t1.templatesetid=-1 AND t1.title<>'options'
ORDER BY t1.title");
I ran into the same problem when I copied a hack into the upgrad file. That fixed it. Of course, you may have a completely different issue.