Issues

ZF-8143: Backwards compatability issue with _error() on Zend_Validate_Abstract

Description

Backwards compatability issue with method ->_error() on Zend_Validate_Abstract. The messageKey param in v1.9.4 is required but in 1.9.1 it's not.

ZF v1.9.1 lines 248-264


    /**
     * @param  string $messageKey OPTIONAL
     * @param  string $value      OPTIONAL
     * @return void
     */
    protected function _error($messageKey = null, $value = null)
    {
        if ($messageKey === null) {
            $keys = array_keys($this->_messageTemplates);
            $messageKey = current($keys);
        }
        if ($value === null) {
            $value = $this->_value;
        }
        $this->_errors[]              = $messageKey;
        $this->_messages[$messageKey] = $this->_createMessage($messageKey, $value);
    }

ZF v1.9.4 lines 253-269


    /**
     * @param  string $messageKey
     * @param  string $value      OPTIONAL
     * @return void
     */
    protected function _error($messageKey, $value = null)
    {
        if ($messageKey === null) {
            $keys = array_keys($this->_messageTemplates);
            $messageKey = current($keys);
        }
        if ($value === null) {
            $value = $this->_value;
        }
        $this->_errors[]              = $messageKey;
        $this->_messages[$messageKey] = $this->_createMessage($messageKey, $value);
    }

Comments

set component and auto re-assign.