-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug? Creating default object from empty value #238
Comments
@uwetews I just saw another bug report in issue #239. Edit: I recognized it is an empty array as well, looping in the first run, which we catch with |
temporary fixed with @@ -209,14 +209,14 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo
$output .= "{$itemVar}->show = ({$itemVar}->total > 0);\n";
}
if (isset($itemAttr[ 'iteration' ])) {
$output .= "{$itemVar}->iteration = 0;\n";
}
+ $output .= "if (\$_from !== null) {\n";
if (isset($itemAttr[ 'index' ])) {
$output .= "{$itemVar}->index = -1;\n";
}
- $output .= "if (\$_from !== null) {\n";
$output .= "foreach (\$_from as {$keyTerm}{$itemVar}->value) {\n";
if (isset($attributes[ 'key' ]) && isset($itemAttr[ 'key' ])) {
$output .= "\$_smarty_tpl->tpl_vars['{$key}']->value = {$itemVar}->key;\n";
}
if (isset($itemAttr[ 'iteration' ])) {
|
uwetews
added a commit
that referenced
this issue
Jul 11, 2016
The fix is now in the master branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Smarty version 3.1.30-dev/72
(That was definitely working prior to some of the latest commits, Uwe.)
Fatal error: Uncaught exception 'ErrorException' with message 'Warning: Creating default object from empty value' in [... tpl files]\*_1.file.show_plugins.fnc.tpl.php:50 Stack trace: #0 [... tpl files]*_1.file.show_plugins.fnc.tpl.php(50): errorToExceptionHandler(2, 'Creating defaul...', '[... path]', 50, Array) #1 [... libs]\Smarty\libs\sysplugins\smarty_template_resource_base.php(128): content_5756722242d301_28010074(Object(Smarty_Internal_Template)) #2 [... libs]\Smarty\libs\sysplugins\smarty_template_compiled.php(162): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #3 [... libs]\Smarty\libs\sysplugins\smarty_internal_te in
Sadly (#3)-trace breaks here, while path strings were too long, I assume.
Edit: line 50 in the compiled file is
$_smarty_tpl->tpl_vars['plugin_data']->index = -1;
Edit2: temporary disable this line `#$_smarty_tpl->tpl_vars['plugin_data']->index = -1; helps!
Thanks, @uwetews
The text was updated successfully, but these errors were encountered: