ZF-7672: Zend_Form_Element getTranslator function is MEGA slow (fix included)


Zend_Form_Element getTranslator function would sometimes get me a page load time of 20seconds (1500 calls when calling onValidate). I finally found a way to improve performance by 18 seconds:


and it's suddenly only 2 seconds total page load time.

public function getTranslator()
    if ($this->translatorIsDisabled()) {
        return null;

    if (null === $this->_translator) {

// require_once 'Zend/Form.php'; <---- // FIXED LINE return Zend_Form::getDefaultTranslator(); } return $this->_translator; } ```

Ofcource it can be added on top of the class instead.


Fixed with r18966