diff --git a/change_log.txt b/change_log.txt index e3487567..381aa8d7 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +27.09.2011 +- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34) + 26.09.2011 - bugfix repeated calls to same subtemplate did not make use of cached template object diff --git a/libs/sysplugins/smarty_internal_compile_section.php b/libs/sysplugins/smarty_internal_compile_section.php index fda307a3..ccb7673d 100644 --- a/libs/sysplugins/smarty_internal_compile_section.php +++ b/libs/sysplugins/smarty_internal_compile_section.php @@ -59,7 +59,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { $section_name = $_attr['name']; - $output .= "unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n"; + $output .= "if (isset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name])) unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n"; $section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]"; foreach ($_attr as $attr_name => $attr_value) {