PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm_Renderer_Tableless » Bug #9811

generation of form tag is broken. Tag rendered looks like : <formarray></forma

Details

Submitted2007-01-12 12:30 UTC
Frommanfred dot ursprung at manfred-ursprung dot de
Assignedwiesemann
StatusBogus
PackageHTML_QuickForm_Renderer_Tableless
PHP Version4.4.4
OSLinux
Roadmaps(Not assigned)

Comments

[2007-01-12 12:30 UTC] manfred dot ursprung at manfred-ursprung dot de

Description:
------------
Versions:
HTML_QuickForm 3.2.7
HTML_QuickForm_Renderer_Tableless 0.4.3
HTML_Common 1.2.3

When I rendere the form with this version I got something like:
getAttributes(true), $this->_formTemplate);)
to :
$html = str_replace('{attributes}', $form->_getAttrString($form->_attributes), $this->_formTemplate);
and it works.

The method HTML_Common->getAttributes(true) makes an error. But if I call echo print_r($form->getAttributes(false))
I get an error as result.

Test script:
---------------
setElementTemplate("\n\t\t\t{label}*{error}{element}");
$renderer->setHeaderTemplate("\n\t\t{header}\n");
$renderer->setCloseFieldsetTemplate("\n\t");
$renderer->setRequiredNoteTemplate("\n\t\t\t {requiredNote}");
$renderer->setGroupTemplate("\n\t\t\t{label}*{error}{element}");
$renderer->setFormTemplate("\n\n\t\n{hidden}\t\n{content}\n</form>");
$form->accept($renderer);

<body onload="framchange()">
<?php print_r($personalData->getAttributes(false));
// echo $form->_getAttrString($form->_attributes);
echo "\nnun das Array als String mit getAttributes : " . $form->getAttributes(true);
echo "\nnun das Array als String mit _getAttrString : " . $form->_getAttrString($form->_attributes);

?>

</body>

<?php
function generateForm(){
//generate any form with form attributes
global $PHP_SELF;
$form =& new HTML_QuickForm(FORM_PERSONAL_DATA, 'post');
$form->removeAttribute('name');

$form->addElement('header', null, 'Persönliche Daten');
$form->addElement('hidden', 'action', ACTION_UPDATE_PERSONAL_DATA);
$form->addElement('hidden', CUSTOMER_ID, $_customer->id);
......

}
?>

Expected result:
----------------
Array ( [action] => /login/kunden/xx_Quickform.php [method] => post [id] => personalDataForm [onsubmit] => try { var myValidator = validate_personalDataForm; } catch(e) { return true; } return myValidator(this); )
nun das Array als String mit getAttributes : action="/login/kunden/xx_Quickform.php" method="post" id="personalDataForm" onsubmit="try { var myValidator = validate_personalDataForm; } catch(e) { return true; } return myValidator(this);"
nun das Array als String mit _getAttrString : action="/login/kunden/xx_Quickform.php" method="post" id="personalDataForm" onsubmit="try { var myValidator = validate_personalDataForm; } catch(e) { return true; } return myValidator(this);"

Actual result:
--------------
Array ( [action] => /login/kunden/xx_Quickform.php [method] => post [id] => personalDataForm [onsubmit] => try { var myValidator = validate_personalDataForm; } catch(e) { return true; } return myValidator(this); )
nun das Array als String mit getAttributes : Array
nun das Array als String mit _getAttrString : action="/login/kunden/xx_Quickform.php" method="post" id="personalDataForm" onsubmit="try { var myValidator = validate_personalDataForm; } catch(e) { return true; } return myValidator(this);"

[2007-01-12 16:21 UTC] manfred dot ursprung at manfred-ursprung dot de

I know that it is bad style and I'm not happy with it.
When I use command >pear list
i get a list of all installed PEAR packages and there it is said that HTML_Common is version 1.2.3
I have already uninstall and install it again, but the same result.

I got the fault also with the example contact.php from the docs directory.

[2007-01-16 06:46 UTC] manfred dot ursprung at manfred-ursprung dot de

Problem is solved!!
It was a wrong HTML_Common class.
I changed the include path so that the new HTML_Common version 1.2.3 is included and all went right.

Sorry that I didn't read the quickhelp earlier.
It's a nice function get_included_files.

Thanx for the support.

Regards

Manfred