ZF-8767: Zend_Validate_NotEmpty reports self::INVALID for every type of validation error

Issue Type: Bug Created: 2010-01-10T12:32:08.000+0000 Last Updated: 2010-01-11T06:14:58.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Tomasz Sterna (smoku) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments: - Zend_Validate_NotEmpty.patch


self::INVALID is set to "Invalid type given, value should be float, string, array, boolean or integer", but it is reported for "" string, 0 integer, 0.0 float, array().

"" is an empty string, but it is a string. 0 is an integer etc. so the message is plainly wrong. It should be self::IS_EMPTY => "Value is required and can't be empty".


Posted by Tomasz Sterna (smoku) on 2010-01-10T12:33:53.000+0000

Here's a patch that fixes this.

Posted by Thomas Weidner (thomas) on 2010-01-10T14:48:08.000+0000

Fixed in trunk

Posted by Tomasz Sterna (smoku) on 2010-01-10T15:40:20.000+0000

User named 'thomas' already merged my patch in r20180 not mentioning this bug in the commit.

Was that you? If so, why don't you just admit that you merged my patch to SVN, instead of pretending, that the bug was "already fixed"?

$ svn log -c20180 library/Zend/

r20180 | thomas | 2010-01-10 21:43:25 +0100 (nie) | 3 linie

[GENERIC] Zend_Validate:

  • fixed wrong messages

$ svn diff -c20180 library/Zend/ | head -n 20

Index: library/Zend/Validate/NotEmpty.php


--- library/Zend/Validate/NotEmpty.php (wersja 20179)

+++ library/Zend/Validate/NotEmpty.php (wersja 20180)

@@ -164,7 +164,7 @@

     if ($type >= self::SPACE) {

         $type -= self::SPACE;

         if (is_string($value) && (preg_match('/^\s+$/s', $value))) {
  • $this->_error(self::INVALID);

  • $this->_error(self::IS_EMPTY);

           return false;


@@ -173,7 +173,7 @@

     if ($type >= self::NULL) {

         $type -= self::NULL;

         if (is_null($value)) {
  • $this->_error(self::INVALID);

  • $this->_error(self::IS_EMPTY);

           return false;


Posted by Thomas Weidner (thomas) on 2010-01-10T23:17:12.000+0000

I'm in several online forums.

Sometimes I fix things when they are mentioned within a forum without raising an issue myself. And sometimes it collidates with another user reporting the same issue.

As there is only one solution for this problem, by using the correct constant, I would not be too strict in the wording "my patch". Other people come to the same conclusion without looking into your patch.

You may also have noted that email delivery for issues is delayed. The time this issue was sent to me, the fix was already committed.

I'm sorry when such a situation is problematic for you. When you want I could wait some weeks in future before fixing things which are mentioned to me in a public discussion. :-)

Posted by Tomasz Sterna (smoku) on 2010-01-10T23:52:30.000+0000

Do you really expect me to believe that accidentally both two of my issues reported within an hour was "already fixed" with no other commits within a week, just these two just after the bug reports? And you are so busy, that you do not remember what exactly happened few hours ago and need to be speculative with "sometimes".

I do not really care about giving credit for a few-liner patch. What struck me is the bizarre attitude of not admitting "yes, there was a bug" and pretending that the reports were invalid in a first place.

You just lost more than one user - I will discourage every person asking my advice and reading my blog from using ZF, because your development methods are doubtful and not transparent. EOT

Posted by Thomas Weidner (thomas) on 2010-01-11T06:14:04.000+0000

There were 40 commits within the last week by me, not only 2. And yes I am busy in my sparetime on sunday at home.

No one said that this report is invalid. I just said "probably fixed in trunk". The issue itself is marked as "fixed" and not as "not an issue" or "incomplete". In my eyes "fixed" is the proper status.

And there is also a changeset connected to this issue which tests this behaviour.

Have you found an issue?

See the Overview section for more details.


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

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