1
If you create a XoopsFormElement with no name such as:
$f1_field = new XoopsFormText("", "foo",15,15,$foo);
Then you get the following warning:
Warning: Undefined property: _name in /var/www/html/class/xoopsform/formelement.php on line 122
This is a warning from the method getName as below:
function getName($encode=true) {
if (false != $encode) {
return str_replace("&", "&", str_replace("'","'",htmlspecialchars($this->_name)));
}
return $this->_name;
}
When I am using form elements inside a tray then I often don't need a name displayed alongside the actual form field. So I suggest that the following code is amended so that it says:
function getName($encode=true) {
if (!isset($this->_name)) {
return "";
}
if (false != $encode) {
return str_replace("&", "&", str_replace("'","'",htmlspecialchars($this->_name)));
}
return $this->_name;
}
Does that sound reasonable?
Also, this is my first bug report. Is this the correct way to report things?
Cheers,
Andy Mayer