Home » HTML » HTML_QuickForm » Bug #8305
PHP-Warning with empty hiddenselect
Details
| Submitted | 2006-07-27 07:37 UTC |
|---|---|
| From | arne dot bippes at brandao dot de |
| Assigned | avb |
| Status | Closed |
| Package | HTML_QuickForm |
| PHP Version | Irrelevant |
| OS | irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2006-07-27 07:37 UTC] arne dot bippes at brandao dot de
Description:
------------
HTML_QuickForm_hiddenselect throws a PHP-Warning in function toHtml()if $this->_values is empty. (e.g. not calling loadDbResult() with values )
A quick patch would be to check in hiddenselect.php if $this->_values is an array otherwise return empty string:
77: ...
78: $strHtml = '';
79:
80: /** Patch start */
81: if (! is_array($this->_values)) {
82: return $strHtml;
83: }
84: /** Patch end */
85:
86: foreach ($this->_values as $key => $val) {
...
Expected result:
----------------
No Warning
Actual result:
--------------
Warning: Invalid argument supplied for foreach() in /pear/HTML/QuickForm/hiddenselect.php on line 80