Zend Framework

Backwards compatability issue with _error() on Zend_Validate_Abstract

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.5
  • Component/s: Zend_Validate
  • Labels:
    None

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);
    }

Activity

Hide
Satoru Yoshida added a comment -

set component and auto re-assign.

Show
Satoru Yoshida added a comment - set component and auto re-assign.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: