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

problem save #91

Open
dimaxz opened this issue Feb 20, 2022 · 0 comments
Open

problem save #91

dimaxz opened this issue Feb 20, 2022 · 0 comments

Comments

@dimaxz
Copy link

dimaxz commented Feb 20, 2022

error display: strcmp() expects parameter 2 to be string, object given
file in /app/vendor/yiisoft/yii2/helpers/BaseHtml.php line 1913
POST value = "1"

//vendor/pheme/yii2-settings/models/BaseSetting.php

        if ($type !== null) {
            $model->type = $type;
        } else {
            $t = gettype($value);
            if ($t == 'string') {//t = "string" - this is correct
                $error = false;
                try {
                    Json::decode($value);//value "1" decode in 1
                } catch (InvalidParamException $e) {
                    $error = true;
                }
                if (!$error) {//if success decode and $t = "object" - wtf!!!???
                    $t = 'object';
                }
            }
            $model->type = $t;
        }

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