logo       

cvs: pear /HTML_QuickForm QuickForm.php: msg#00601

php.cvs.pear

Subject: cvs: pear /HTML_QuickForm QuickForm.php

jrust Thu Sep 26 17:48:45 2002 EDT

Modified files:
/pear/HTML_QuickForm QuickForm.php
Log:
Added better errr checking in renderElement()


Index: pear/HTML_QuickForm/QuickForm.php
diff -u pear/HTML_QuickForm/QuickForm.php:1.35
pear/HTML_QuickForm/QuickForm.php:1.36
--- pear/HTML_QuickForm/QuickForm.php:1.35 Wed Sep 18 13:13:03 2002
+++ pear/HTML_QuickForm/QuickForm.php Thu Sep 26 17:48:45 2002
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@xxxxxxxxxxx> |
// +----------------------------------------------------------------------+
//
-// $Id: QuickForm.php,v 1.35 2002/09/18 17:13:03 jrust Exp $
+// $Id: QuickForm.php,v 1.36 2002/09/26 21:48:45 jrust Exp $

require_once("PEAR.php");
require_once("HTML/Common.php");
@@ -733,13 +733,16 @@
function renderElement($elementName, $remove = false, $removeRules = false)
{
$element = $this->getElement($elementName);
- if (is_null($element)) {
+ if (is_null($element) || PEAR::isError($element)) {
return PEAR::raiseError(null, QUICKFORM_NONEXIST_ELEMENT, null,
E_USER_WARNING, "Element '$elementName' does not exist in
HTML_QuickForm::renderElement()", 'HTML_QuickForm_Error', true);
}
+
$html = $this->_buildElement($element);
+
if ($remove) {
$this->removeElement($elementName, $removeRules);
}
+
return $html;
} // end func renderElement




--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise