// in templates: add 'comments'-templatevar to all non-empty ITEM templates
$res = DB::getResult('SELECT * FROM '.sql_table('template').' WHERE tpartname=\'ITEM\'');
foreach ( $res as $row ) {
- if ( i18n::strpos($o->tcontent,'<%comments%>') === FALSE)
+ if ( i18n::strpos($o->tcontent,'<%comments%>') === FALSE ) {
$newval = $row['tcontent'] . '<%comments%>';
$query = 'UPDATE '.sql_table('template').' SET tcontent=\''. addslashes($newval).'\' WHERE tdesc=' . $row['tdesc'] . ' AND tpartname=\'ITEM\'';
upgrade_query('Updating ITEM part in template ' . $row['tdesc'], $query);