The QuickForm.php file that I want to override is located in civicrm/packages/HTML/Quickform. I set my override directory to [civicrm.files]/override_php and put a copy of the originale file in override directory/packages/HTML/Quickform.
- Is the location correct?
This file define the class HTML_QuickForm and I added a new method call getElements(). The class HTML_QuickForm_Page extend this class which is then extended again to define CRM_Core_Form. 2. Is my modified HTML_QuickForm class going to be use to extend the descending class or do I need to override (have a copy in my override directory) every descending down to CRM_Core_Form to make it happen. 3. Should I just override CRM_Core_Form even if the method does not make much sense in the context of CRM_Core_Form?
Here are my modifications:
function &getElements()
{
if (isset($this->_elements)) {
return $this->_elements[];
} else {
$error = PEAR::raiseError(null, QUICKFORM_NONEXIST_ELEMENT, null, E_USER_WARNING, "Element '$elements' does not exist in HTML_QuickForm::getElements()", 'HTML_QuickForm_Error', true);
return $error;
}
}
Current error message is : undefined method getElements when I try to get the elements array in a buildForm hook.
Thank for your help