Coinsence / meta

General Info and Improvement Proposal repository
1 stars 0 forks source link

Some error on dev #333

Closed KarimChabrak closed 3 years ago

KarimChabrak commented 3 years ago

Setting here prod to virified creates an error https://dev.coinsence.org/space/voucher-marketplace/xcoin/marketplace/overview?marketplaceId=30

yii\base\UnknownPropertyException: Getting unknown property: humhub\modules\xcoin\models\Product::is_voucher_product in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Component.php:154 Stack trace:

0 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(296): yii\base\Component->__get('is_voucher_prod...')

1 /var/www/coinsence_dev/protected/modules/xcoin/models/Product.php(489): yii\db\BaseActiveRecord->__get('is_voucher_prod...')

2 /var/www/coinsence_dev/protected/modules/xcoin/models/Product.php(115): humhub\modules\xcoin\models\Product->isVoucherProduct()

3 [internal function]: humhub\modules\xcoin\models\Product->humhub\modules\xcoin\models{closure}(Object(humhub\modules\xcoin\models\Product), 'vouchers')

4 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/validators/Validator.php(266): call_user_func(Object(Closure), Object(humhub\modules\xcoin\models\Product), 'vouchers')

5 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(humhub\modules\xcoin\models\Product), Array)

6 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(614): yii\base\Model->validate(Array)

7 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(673): yii\db\ActiveRecord->update(true, NULL)

8 /var/www/coinsence_dev/protected/modules/xcoin/controllers/MarketplaceController.php(198): yii\db\BaseActiveRecord->save()

9 [internal function]: humhub\modules\xcoin\controllers\MarketplaceController->actionReviewProduct('47', '1')

10 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

11 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)

12 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('review-product', Array)

13 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('xcoin/marketpla...', Array)

14 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(humhub\components\Request))

15 /var/www/coinsence_dev/index.php(31): yii\base\Application->run()

16 {main}

Copy Stacktrace Search Stackoverflow Search Google Exception Unknown Property – yii\base\UnknownPropertyException Getting unknown property: humhub\modules\xcoin\models\Product::is_voucher_product

1. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Component.php at line 154
145146147148149150151152153154155156157158159160161162163

                                if ($behavior->canGetProperty($name)) {
                return $behavior->$name;
            }
        }

        if (method_exists($this, 'set' . $name)) {
            throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
        }

        throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
    }

    /**
     * Sets the value of a component property.
     *
     * This method will check in the following order and act accordingly:
     *
     *  - a property defined by a setter: set the property value
     *  - an event in the format of "on xyz": attach the handler to the event "xyz"

2. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php at line 296 – yii\base\Component::__get('is_voucher_product')
3. in /var/www/coinsence_dev/protected/modules/xcoin/models/Product.php at line 489 – yii\db\BaseActiveRecord::__get('is_voucher_product')
483484485486487488489490491492493494495

        $this->space_id = $space->id;
    }

    public function isVoucherProduct()
    {
        return $this->is_voucher_product;
    }

    public function retrieveOneReadyVoucher()
    {
        return $this
            ->getVouchers()

4. in /var/www/coinsence_dev/protected/modules/xcoin/models/Product.php at line 115 – humhub\modules\xcoin\models\Product::isVoucherProduct()
109110111112113114115116117118119120121

                                    return $model->offer_type == Product::OFFER_TOTAL_PRICE_IN_COINS;
            }],
            [['discount'], 'required', 'when' => function ($model) {
                return $model->offer_type == Product::OFFER_DISCOUNT_FOR_COINS;
            }],
            [['vouchers'], 'required', 'when' => function ($model) {
                return $model->isVoucherProduct();
            }],
            [['link'], 'required', 'when' => function ($model) {
                return $model->marketplace->shouldRedirectToLink() && !$model->isVoucherProduct();
            }],
            [['buy_message'], 'required', 'when' => function ($model) {
                return !$model->marketplace->shouldRedirectToLink() && !$model->isVoucherProduct();

5. humhub\modules\xcoin\models\Product::humhub\modules\xcoin\models\{closure}(humhub\modules\xcoin\models\Product, 'vouchers')
6. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/validators/Validator.php at line 266 – call_user_func(Closure, humhub\modules\xcoin\models\Product, 'vouchers')
7. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Model.php at line 367 – yii\validators\Validator::validateAttributes(humhub\modules\xcoin\models\Product, ['vouchers'])
8. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/ActiveRecord.php at line 614 – yii\base\Model::validate(['name', 'description', 'price', 'content', ...])
9. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php at line 673 – yii\db\ActiveRecord::update(true, null)
10. in /var/www/coinsence_dev/protected/modules/xcoin/controllers/MarketplaceController.php at line 198 – yii\db\BaseActiveRecord::save()
192193194195196197198199200201202203204

                                throw new HttpException(401);
        }

        $model->scenario = Product::SCENARIO_EDIT;
        $model->review_status = $status;

        $model->save();

        $this->view->saved();

        return $this->redirect($this->contentContainer->createUrl('/xcoin/marketplace/overview', [
            'container' => $this->contentContainer,
            'marketplaceId' => $model->marketplace->id

11. humhub\modules\xcoin\controllers\MarketplaceController::actionReviewProduct('47', '1')
12. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array([humhub\modules\xcoin\controllers\MarketplaceController, 'actionReviewProduct'], ['47', '1'])
13. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Controller.php at line 157 – yii\base\InlineAction::runWithParams(['id' => '47', 'status' => '1', 'cguid' => '8adac591-e709-47db-89b8-2cbad6ba...'])
14. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Module.php at line 528 – yii\base\Controller::runAction('review-product', ['id' => '47', 'status' => '1', 'cguid' => '8adac591-e709-47db-89b8-2cbad6ba...'])
15. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/web/Application.php at line 103 – yii\base\Module::runAction('xcoin/marketplace/review-product', ['id' => '47', 'status' => '1', 'cguid' => '8adac591-e709-47db-89b8-2cbad6ba...'])
16. in /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Application.php at line 386 – yii\web\Application::handleRequest(humhub\components\Request)
17. in /var/www/coinsence_dev/index.php at line 31 – yii\base\Application::run()
25262728293031

                        (is_readable(__DIR__ . '/protected/config/web.php')) ? require(__DIR__ . '/protected/config/web.php') : []
);

$dotenv = new Dotenv();
$dotenv->load(__DIR__.'/.env');

(new humhub\components\Application($config))->run();

$_GET = [ 'id' => '47', 'status' => '1', 'cguid' => '8adac591-e709-47db-89b8-2cbad6baf2c6', ];

$_COOKIE = [ 'pm_panel-activities' => 'expanded', 'pm_space-members-panel' => 'expanded', '_ga' => 'GA1.2.1964479201.1624187711', 'language' => '38a7c34947d89ba99d1ed97d05ca31a7e4ae6296e6c953abb8de5afafa08e633a:2:{i:0;s:8:"language";i:1;s:5:"en_gb";}', '_identity' => 'd10b88d65e027f1828a2db7e02a9ea276a521081bbdd504a35a93f8e9bef28fda:2:{i:0;s:9:"_identity";i:1;s:51:"[13,"050c9a18-3cc0-45a5-838b-3b20bf02da09",2592000]";}', 'PHPSESSID' => '0vro5rv1ov5t4ev0lq0uco81fq', '_csrf' => 'b31d3ffc226ff85af69ccf3afe8077295260237f62089587d239a08af350890aa:2:{i:0;s:5:"_csrf";i:1;s:32:"kZkbmH-iIVT4d53eGJF3CDkC4b7r9OCg";}', 'pm_new-spaces-panel' => 'expanded', 'pm_spaces-statistics-panel' => 'expanded', ];

$_SESSION = [ 'flash' => [], 'id' => 13, '__expire' => 1632403415, 'live.poll.lastQueryTime' => 1632402014, 'user.canSeeAdminSection' => true, ];

Yii Framework

2021-09-23, 14:00:15

Apache/2.4.29 (Ubuntu)

Yii Framework/2.0.15 Hidden Gallery ‹ › ×

Add image/file Upload

Add link Title Target

KarimChabrak commented 3 years ago

Creating products as well

{ "url": "/space/voucher-marketplace/xcoin/product/new?marketplaceId=30", "status": 500, "response": "

Exception (Unknown Property) 'yii\base\UnknownPropertyException' with message 'Getting unknown property: humhub\modules\xcoin\models\Product::is_voucher_product' \n\nin /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Component.php:154\n\nStack trace:\n#0 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(296): yii\base\Component->get('is_voucher_prod...')\n#1 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/helpers/BaseHtm...",
"textStatus": "error",
"xhr": {
"readyState": 4,
"responseText": "
Exception (Unknown Property) 'yii\base\UnknownPropertyException' with message 'Getting unknown property: humhub\modules\xcoin\models\Product::is_voucher_product' \n\nin /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Component.php:154\n\nStack trace:\n#0 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(296): yii\base\Component->__get('is_voucher_prod...')\n#1 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/helpers/BaseHtml.php(2193): yii\db\BaseActiveRecord->get('is_voucher_prod...')\n#2 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/helpers/BaseHtml.php(1556): yii\helpers\BaseHtml::getAttributeValue(Object(humhub\modules\xcoin\models\Product), 'is_voucher_prod...')\n#3 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/helpers/BaseHtml.php(1538): yii\helpers\BaseHtml::activeBooleanInput('checkbox', Object(humhub\modules\xcoin\models\Product), 'is_voucher_prod...', Array)\n#4 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/widgets/ActiveField.php(609): yii\helpers\BaseHtml::activeCheckbox(Object(humhub\modules\xcoin\models\Product), 'is_voucher_prod...', Array)\n#5 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2-bootstrap/src/ActiveField.php(212): yii\widgets\ActiveField->checkbox(Array, false)\n#6 /var/www/coinsence_dev/protected/modules/xcoin/views/product/details.php(153): yii\bootstrap\ActiveField->checkbox(Array)\n#7 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/View.php(336): require('/var/www/coinse...')\n#8 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/View.php(254): yii\base\View->renderPhpFile('/var/www/coinse...', Array)\n#9 /var/www/coinsence_dev/protected/humhub/modules/ui/view/components/View.php(111): yii\base\View->renderFile('/var/www/coinse...', Array, Object(humhub\modules\xcoin\controllers\ProductController))\n#10 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/web/Controller.php(49): humhub\modules\ui\view\components\View->renderAjax('../product/deta...', Array, Object(humhub\modules\xcoin\controllers\ProductController))\n#11 /var/www/coinsence_dev/protected/modules/xcoin/controllers/ProductController.php(101): yii\web\Controller->renderAjax('../product/deta...', Array)\n#12 [internal function]: humhub\modules\xcoin\controllers\ProductController->actionNew('30')\n#13 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)\n#14 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)\n#15 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('new', Array)\n#16 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('xcoin/product/n...', Array)\n#17 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(humhub\components\Request))\n#18 /var/www/coinsence_dev/index.php(31): yii\base\Application->run()\n#19 {main}
", "status": 500, "statusText": "Internal Server Error" }, "dataType": "html", "html": "
Exception (Unknown Property) 'yii\base\UnknownPropertyException' with message 'Getting unknown property: humhub\modules\xcoin\models\Product::is_voucher_product' \n\nin /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/base/Component.php:154\n\nStack trace:\n#0 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(296): yii\base\Component->__get('is_voucher_prod...')\n#1 /var/www/coinsence_dev/protected/vendor/yiisoft/yii2/helpers/BaseHtm...",
"error": {},
"errorThrown": "Internal Server Error",
"validationError": false
}