Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validierung - mehrere customfunction auf ein Value -> nur eine Fehlermeldung #1369

Closed
tbaddade opened this issue Feb 6, 2023 · 1 comment
Labels
Milestone

Comments

@tbaddade
Copy link
Member

tbaddade commented Feb 6, 2023

Ich habe auf ein Value 2 customfunction. Beide schlagen an, jedoch wird nur die Meldung der Letzten customfunction angezeigt.

Hier die beiden Methoden

<?php

namespace Project\YForm;

class Validator
{
    public static function max(string $fieldName, string $values, string $maxValue): bool
    {
        $values = explode(',', $values);
        if (count($values) <= (int)$maxValue) {
            return false;
        }
        return true;
    }

    public static function duplicate(string $fieldName, string $values): bool
    {
        $values = explode(',', $values);
        return count($values) !== count(array_unique($values));
    }
}

Hier die 2 validates

Bildschirm­foto 2023-02-06 um 12 54 54

Bildschirm­foto 2023-02-06 um 12 55 53

@tbaddade tbaddade added the bug label Feb 6, 2023
@dergel dergel added this to the 4.2 milestone Feb 16, 2023
@dergel
Copy link
Member

dergel commented Feb 24, 2023

weiter gehts hier #1380

@dergel dergel closed this as completed Feb 24, 2023
@dergel dergel modified the milestones: 4.2, 4.1 Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants