Giter Site home page Giter Site logo

findMessages() broken about validation HOT 18 CLOSED

respect avatar respect commented on May 21, 2024
findMessages() broken

from validation.

Comments (18)

nickl- avatar nickl- commented on May 21, 2024

Ahh I've seen that one before, please try the development branch it was fixed @b3aaa8c0a37ef90552f88474ce58ab41b2fac4be or don't use findMessage() since that's where the problem is and getMessage() does not suffer the same.

@ed100 Well done now you've gone the full circle so I am keen to see your improvements next. If you don't feel you want to contribute code that is also fine. You obviously have a talent for finding everything possible thing may go wrong and your explanations are very concise and easy to follow. We desperately need a good tester like yourself to comb through the other projects as well if you would be so kind, much obliged.

I was also thinking that we should probably transfer what's been said on #84 to the documentation or start a FAQ to help the next person that comes around. Would you be keen to give us a hand?

No matter how small the contribution we always appreciate it. I cannot start to explain what a huge benefit it's been for us to go through the motions with you and reach a successful resolve.

Thank you very much! Keep up the good work...

from validation.

ed100 avatar ed100 commented on May 21, 2024

I will try the dev branch. I would be glad to help as soon as I finish
working on my site. Getting fairly close to having it done. I am not
much of a coder, but can read and write and break things.

On my second try I got the error:
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in
/usr/websites/www/validationpage.html on line 11

that does not seem caused by findMessage.

On 08/16/2012 03:01 PM, Nick Lombard wrote:

Ahh I've seen that one before, please try the development branch it was fixed @b3aaa8c0a37ef90552f88474ce58ab41b2fac4be or don't use findMessage() since that's where the problem is and getMessage() does not suffer the same.

@ed100 Well done now you've gone the full circle so I am keen to see your improvements next. If you don't feel you want to contribute code that is also fine. You obviously have a talent for finding everything possible thing may go wrong and your explanations are very concise and easy to follow. We desperately need a good tester like yourself to comb through the other projects as well if you would be so kind, much obliged.

I was also thinking that we should probably transfer what's been said on #84 to the documentation or start a FAQ to help the next person that comes around. Would you be keen to give us a hand?

No matter how small the contribution we always appreciate it. I cannot start to explain what a huge benefit it's been for us to go through the motions with you and reach a successful resolve.

Thank you very much! Keep up the good work...


Reply to this email directly or view it on GitHub:
#85 (comment)

from validation.

nickl- avatar nickl- commented on May 21, 2024

Then break things it is! =) Always nice to know someone has your back. Glad to have you on board!

Let me know if that also fixes findMessages() for you, please.

from validation.

ed100 avatar ed100 commented on May 21, 2024

all I need is just the one file from dev branch:
AbstractNestedException.php

On 08/16/2012 03:54 PM, Nick Lombard wrote:

Then break things it is! =) Always nice to know someone has your back. Glad to have you on board!

Let me know if that also fixes findMessages() for you, please.


Reply to this email directly or view it on GitHub:
#85 (comment)

from validation.

nickl- avatar nickl- commented on May 21, 2024

I would just replace everything if I were you... just overwrite what is in the pear folder that should do the trick.

from validation.

ed100 avatar ed100 commented on May 21, 2024

replace it all with the files from
Respect-Validation-0.4.4-21-g0580308.tar.gz

tried:

try {
$usernameValidator->assert('really messed up screen#name');
} catch(\InvalidArgumentException $e) {
var_dump($e->findMessages('alnum', 'length', 'noWhitespace'));
}

Catchable fatal error: Argument 1 passed to
Respect\Validation\Exceptions\AbstractNestedException::findMessages()
must be of the type array, string given, called in
/usr/websites/www/validationpage.html on line 69 and defined in
/usr/local/share/pear/Respect/Validation/Exceptions/AbstractNestedException.php
on line 22

Now what should I do?

On 08/16/2012 04:10 PM, Nick Lombard wrote:

I would just replace everything if I were you... just overwrite what is in the pear folder that should do the trick.


Reply to this email directly or view it on GitHub:
#85 (comment)

from validation.

nickl- avatar nickl- commented on May 21, 2024

Give this one a go:

<?php
try {
    $usernameValidator->assert('really messed up screen#name');
} catch(\InvalidArgumentException $e) {
    var_dump($e->findMessages(array('alnum', 'length', 'noWhitespace')));
}

I am making this leap because findMessages has a type hint array see

<?php
    public function findMessages(array $paths)
    {
    ///
    }

If that doesn't work then I will need to see what you are doing from declaring $usernameValidator up and until the end of the catch please.

from validation.

augustohp avatar augustohp commented on May 21, 2024

Made the needed corrections on README.md, thanks for point that out @ed100.

from validation.

ed100 avatar ed100 commented on May 21, 2024

That does not give a parse error,

The var_dump is:
array(3) { ["alnum"]=> string(79) ""really messed up screen#name" must
contain only letters (a-z) and digits (0-9)" ["length"]=> string(66)
""really messed up screen#name" must have a length between 1 and 15"
["noWhitespace"]=> string(58) ""really messed up screen#name" must not
contain whitespace" }

I looked at the findMessges, and didn't understand what the $paths
meant. I don't remember seeing a function showing parameters as they
are in findMessages(array $paths) thought it was usually more like
findMessages(array,$paths) so I am just confused. I keep showing I an
not a coder.

What I am aiming for is displaying my error message to the use depending
on what is being validated and what the error is.

Then I will have code to end the page so they can fix their error.

On 08/16/2012 06:26 PM, Nick Lombard wrote:

Give this one a go:

<?php
try {
    $usernameValidator->assert('really messed up screen#name');
} catch(\InvalidArgumentException $e) {
    var_dump($e->findMessages(array('alnum', 'length', 'noWhitespace')));
}

I am making this leap because findMessages has a type hint array see

<?php
    public function findMessages(array $paths)
    {
    ///
    }

If that doesn't work then I will need to see what you are doing from declaring $usernameValidator up and until the end of the catch please.


Reply to this email directly or view it on GitHub:
#85 (comment)

from validation.

nickl- avatar nickl- commented on May 21, 2024

You can try getFullMessag() or just getMessage() the latter will only have the last error and the first one will return a string with all errors =)

You are a coder after all =) just patience and more confidence it will come.

from validation.

nickl- avatar nickl- commented on May 21, 2024

@ed100 What's happening did you have success?

from validation.

ed100 avatar ed100 commented on May 21, 2024

not have time to work on it -- was very busy doing a few other things.
over the weekend will be time to work on it.

On 08/17/2012 02:44 PM, Nick Lombard wrote:

@ed100 What's happening did you have success?


Reply to this email directly or view it on GitHub:
#85 (comment)

from validation.

nickl- avatar nickl- commented on May 21, 2024

=)

from validation.

alganet avatar alganet commented on May 21, 2024

Hey @ed100, any news on this? Did that worked for you? Please let us know if you're having any problems =)

from validation.

alganet avatar alganet commented on May 21, 2024

findMessages() uses arrays!

        $usernameValidator = Validator::alnum('_')->length(1,15)->noWhitespace();
        try {
            $usernameValidator->assert('really messed up screen#name');
        } catch(\InvalidArgumentException $e) {
            var_dump($e->findMessages(array('alnum', 'length', 'noWhitespace')));
        }

Try this ;)

from validation.

augustohp avatar augustohp commented on May 21, 2024

Does this issue still valid? Can we close this?

from validation.

ed100 avatar ed100 commented on May 21, 2024

you can close it

Thanks for you help

On 12/18/2012 07:06 AM, Augusto Pascutti wrote:

Does this issue still valid? Can we close this?


Reply to this email directly or view it on GitHub:
#85 (comment)

from validation.

augustohp avatar augustohp commented on May 21, 2024

@ed100 Thank you for you feedback man! =D

from validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.