Issues

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

Issue Type: Bug Created: 2009-10-24T17:13:53.000+0000 Last Updated: 2009-10-25T09:10:41.000+0000 Status: Resolved Fix version(s): - 1.9.5 (27/Oct/09)

Reporter: bullfrogblues (gerardroche) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments:

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

<pre class="highlight">
    /**
     * @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

<pre class="highlight">
    /**
     * @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

Posted by Satoru Yoshida (satoruyoshida) on 2009-10-25T01:54:53.000+0000

set component and auto re-assign.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts