Warning: Attempt to read property "value" on null
I'm using Framadate 1.1.19.
When in the admin mode, viewing an old poll shows this warning at the bottom:
Warning: Attempt to read property "value" on null in /home/user/public_html/framadate/tpl_c/d115c226b0501afc289dde584cfc52ee5f4bf799_0.file.comments_list.tpl.php on line 28
In line 27 of that file,
<form action="<?php if ((isset($_smarty_tpl->tpl_vars['admin']->value))) {
$_smarty_tpl->tpl_vars['admin']->value
is set (isset()
true), but it is empty for some reason (isset()
still true). It can be set to a falsy value, so it shouldn't be enough to just check if it is set. In line 28,
echo smarty_function_poll_url(array('id'=>$_smarty_tpl->tpl_vars['admin_poll_id']->value,'admin'=>true),$_smarty_tpl);
$_smarty_tpl->tpl_vars['admin_poll_id']
is not defined (null) and reading "value" on this null triggers the above warning.
Version 1.1.10
In version 1.1.10, line 27 was
<form action="<?php if ($_smarty_tpl->tpl_vars['admin']->value) {
so a set-but-empty $_smarty_tpl->tpl_vars['admin']->value
was false and $_smarty_tpl->tpl_vars['admin_poll_id']
was never evaluated.
Probably
Line 27 was meant to be
<form action="<?php if (isset($_smarty_tpl->tpl_vars['admin']->value) && $_smarty_tpl->tpl_vars['admin']->value) {
or even just like in version 1.1.10
<form action="<?php if ($_smarty_tpl->tpl_vars['admin']->value) {
Edited by Huidae Cho