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

Wie meldet man sich nach der Installation an? #328

Open
Rillke opened this issue Jun 27, 2021 · 2 comments
Open

Wie meldet man sich nach der Installation an? #328

Rillke opened this issue Jun 27, 2021 · 2 comments

Comments

@Rillke
Copy link

Rillke commented Jun 27, 2021

Nach dem Aufruf von / wird man auf /UI/Login.php?back=index.php weiter geleitet. Dort gibt dann die Parametervalidierung für den POST $key back (der dieser Anfrage ja fehlt) folgende Meldung:

Fatal error: Uncaught exception 'Exception' with message 'Validation rule 'Validation_Set::validate_set_default', missing parameter.' in /var/www/html/Assistants/vendor/Validation/validator/Validation_Set.php:30 Stack trace:
#0 [internal function]: Validation_Set::validate_set_default('back', Array, Array, NULL)
#1 /var/www/html/Assistants/vendor/Validation/Validation.php(650): call_user_func('Validation_Set:...', 'back', Array, Array, NULL) #2 /var/www/html/Assistants/vendor/Validation/Validation.php(752): Validation->isValid()
#3 /var/www/html/UI/Login.php(57): Validation->validate() #4 {main} thrown in /var/www/html/Assistants/vendor/Validation/validator/Validation_Set.php on line 30

Sieht so aus, als ob die Regel set_default => null des Regelsets: UI/Login.php:38

  ->addSet('back',
           array('valid_url_query',
                 'set_default'=>null,
                 'on_error'=>array('type'=>'error',
                                   'text'=>Language::Get('main',Language::Get('main','invalidBackURL', $langTemplate), $langTemplate))))

das Verhalten auslöst.

@Rillke Rillke changed the title Wie meldet man sich dan der Installation an? Wie meldet man sich nach der Installation an? Jun 27, 2021
@Rillke
Copy link
Author

Rillke commented Jun 27, 2021

The code in Assistants/vendor/Validation/validator/Validation_Set.php:29 looks like it doesn't accept "null" defaults.

        if (!isset($param)) {
            throw new Exception('Validation rule \''.__METHOD__.'\', missing parameter.');
        }

A variable whose value is null will be reported not to be set by isset().

Determine if a variable is considered set, this means if a variable is declared and is different than null.

@Rillke
Copy link
Author

Rillke commented Jun 27, 2021

Sollte https://github.com/ostepu/ostepu-validation/blob/master/validator/Validation_Set.php#L29 lauten:

if (!isset($param) && !is_null($param)) {

Rillke added a commit to Rillke/ostepu-validation that referenced this issue Jun 27, 2021
Null defaults are used by /UI/Login.php for the POST back URL param for instance.

More discussion on ostepu/ostepu-core#328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant