Advertisement
pmtpenza22

Untitled

Feb 18th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.89 KB | None | 0 0
  1.  
  2. yii\base\UnknownPropertyException: Getting unknown property: backend\models\Product::images in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Component.php:154
  3. Stack trace:
  4. #0 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\db\BaseActiveRecord.php(298): yii\base\Component->__get('images')
  5. #1 C:\xampp\htdocs\mobile-go\backend\models\Product.php(126): yii\db\BaseActiveRecord->__get('images')
  6. #2 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Component.php(139): backend\models\Product->getImagesLinks()
  7. #3 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\db\BaseActiveRecord.php(298): yii\base\Component->__get('imagesLinks')
  8. #4 C:\xampp\htdocs\mobile-go\backend\views\product\_form.php(48): yii\db\BaseActiveRecord->__get('imagesLinks')
  9. #5 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php(348): require('C:\\xampp\\htdocs...')
  10. #6 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('C:\\xampp\\htdocs...', Array)
  11. #7 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php(156): yii\base\View->renderFile('C:\\xampp\\htdocs...', Array, NULL)
  12. #8 C:\xampp\htdocs\mobile-go\backend\views\product\update.php(18): yii\base\View->render('_form', Array)
  13. #9 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php(348): require('C:\\xampp\\htdocs...')
  14. #10 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('C:\\xampp\\htdocs...', Array)
  15. #11 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php(156): yii\base\View->renderFile('C:\\xampp\\htdocs...', Array, Object(backend\controllers\ProductController))
  16. #12 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Controller.php(384): yii\base\View->render('update', Array, Object(backend\controllers\ProductController))
  17. #13 C:\xampp\htdocs\mobile-go\backend\controllers\ProductController.php(106): yii\base\Controller->render('update', Array)
  18. #14 [internal function]: backend\controllers\ProductController->actionUpdate('10')
  19. #15 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
  20. #16 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
  21. #17 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('update', Array)
  22. #18 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\web\Application.php(103): yii\base\Module->runAction('product/update', Array)
  23. #19 C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
  24. #20 C:\xampp\htdocs\mobile-go\backend\web\index.php(17): yii\base\Application->run()
  25. #21 {main}
  26. Copy Stacktrace Search Stackoverflow Search Google Exception
  27. Unknown Property – yii\base\UnknownPropertyException
  28. Getting unknown property: backend\models\Product::images
  29. 1. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Component.php at line 154
  30. 145146147148149150151152153154155156157158159160161162163 if ($behavior->canGetProperty($name)) {
  31. return $behavior->$name;
  32. }
  33. }
  34.  
  35. if (method_exists($this, 'set' . $name)) {
  36. throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
  37. }
  38.  
  39. throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
  40. }
  41.  
  42. /**
  43. * Sets the value of a component property.
  44. *
  45. * This method will check in the following order and act accordingly:
  46. *
  47. * - a property defined by a setter: set the property value
  48. * - an event in the format of "on xyz": attach the handler to the event "xyz"
  49.  
  50. 2. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\db\BaseActiveRecord.php at line 298 – yii\base\Component::__get('images')
  51. 3. in C:\xampp\htdocs\mobile-go\backend\models\Product.php at line 126 – yii\db\BaseActiveRecord::__get('images')
  52. 120121122123124125126127128129130131132 {
  53. return $this->hasOne(ImagesManager::className(), ['product_id' => 'id'])->orderBy(['sort'=>SORT_DESC]);
  54. }
  55.  
  56. public function getImagesLinks()
  57. {
  58. return ArrayHelper::getColumn($this->images, 'imageUrl');
  59. }
  60.  
  61. public function getImagesLinksData ()
  62. {
  63. $arr = ArrayHelper::toArray($this->images,[
  64. ImagesManager::className()=>[
  65.  
  66. 4. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Component.php at line 139 – backend\models\Product::getImagesLinks()
  67. 5. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\db\BaseActiveRecord.php at line 298 – yii\base\Component::__get('imagesLinks')
  68. 6. in C:\xampp\htdocs\mobile-go\backend\views\product\_form.php at line 48 – yii\db\BaseActiveRecord::__get('imagesLinks')
  69. 42434445464748495051525354 'name' => 'ImagesManager[attachment]',
  70. 'options'=>[
  71. 'multiple'=>true
  72. ],
  73. 'pluginOptions' => [
  74. 'deleteUrl'=>'http://localhost/mobile-go/backend/web/index.php?r=product/delete-image',
  75. 'initialPreview'=> $model->imagesLinks,
  76. 'initialPreviewAsData'=>true,
  77. 'overwriteInitial'=>false,
  78. 'initialPreviewConfig'=>$model->imagesLinksData,
  79. 'uploadUrl' => 'http://localhost/mobile-go/backend/web/index.php?r=site/save-img',
  80. 'uploadExtraData' => [
  81. 'ImagesManager[class]' => $model->formName(),
  82.  
  83. 7. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php at line 348 – require('C:\xampp\htdocs\mobile-go\backen...')
  84. 8. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php at line 257 – yii\base\View::renderPhpFile('C:\xampp\htdocs\mobile-go\backen...', ['model' => backend\models\Product, 'images' => []])
  85. 9. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php at line 156 – yii\base\View::renderFile('C:\xampp\htdocs\mobile-go\backen...', ['model' => backend\models\Product, 'images' => []], null)
  86. 10. in C:\xampp\htdocs\mobile-go\backend\views\product\update.php at line 18 – yii\base\View::render('_form', ['model' => backend\models\Product, 'images' => []])
  87. 12131415161718192021 $this->params['breadcrumbs'][] = 'Редактирование';
  88. ?>
  89. <div class="product-update">
  90.  
  91. <?php echo $this->render('_form', [
  92. 'model' => $model,
  93. 'images' => $images,
  94. ]) ?>
  95.  
  96. </div>
  97.  
  98. 11. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php at line 348 – require('C:\xampp\htdocs\mobile-go\backen...')
  99. 12. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php at line 257 – yii\base\View::renderPhpFile('C:\xampp\htdocs\mobile-go\backen...', ['model' => backend\models\Product, 'images' => []])
  100. 13. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\View.php at line 156 – yii\base\View::renderFile('C:\xampp\htdocs\mobile-go\backen...', ['model' => backend\models\Product, 'images' => []], backend\controllers\ProductController)
  101. 14. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Controller.php at line 384 – yii\base\View::render('update', ['model' => backend\models\Product, 'images' => []], backend\controllers\ProductController)
  102. 15. in C:\xampp\htdocs\mobile-go\backend\controllers\ProductController.php at line 106 – yii\base\Controller::render('update', ['model' => backend\models\Product, 'images' => []])
  103. 100101102103104105106107108109110111112
  104. if ($model->load(Yii::$app->request->post()) && $model->save()) {
  105. return $this->redirect(['view', 'id' => $model->id]);
  106. }
  107. return $this->render('update', [
  108. 'model' => $model,
  109. 'images' => ImagesManager::find()->where(['product_id' => $id])->all(),
  110. ]);
  111. }
  112.  
  113. /**
  114. * Deletes an existing Product model.
  115. * If deletion is successful, the browser will be redirected to the 'index' page.
  116.  
  117. 16. backend\controllers\ProductController::actionUpdate('10')
  118. 17. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([backend\controllers\ProductController, 'actionUpdate'], ['10'])
  119. 18. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Controller.php at line 157 – yii\base\InlineAction::runWithParams(['r' => 'product/update', 'id' => '10'])
  120. 19. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Module.php at line 528 – yii\base\Controller::runAction('update', ['r' => 'product/update', 'id' => '10'])
  121. 20. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\web\Application.php at line 103 – yii\base\Module::runAction('product/update', ['r' => 'product/update', 'id' => '10'])
  122. 21. in C:\xampp\htdocs\mobile-go\vendor\yiisoft\yii2\base\Application.php at line 386 – yii\web\Application::handleRequest(yii\web\Request)
  123. 22. in C:\xampp\htdocs\mobile-go\backend\web\index.php at line 17 – yii\base\Application::run()
  124. 11121314151617 require __DIR__ . '/../../common/config/main.php',
  125. require __DIR__ . '/../../common/config/main-local.php',
  126. require __DIR__ . '/../config/main.php',
  127. require __DIR__ . '/../config/main-local.php'
  128. );
  129.  
  130. (new yii\web\Application($config))->run();
  131.  
  132. $_GET = [
  133. 'r' => 'product/update',
  134. 'id' => '10',
  135. ];
  136.  
  137. $_COOKIE = [
  138. '_identity-backend' => 'b92aae0c070d481d9777dfedcbedeca4c3e5e90c3d1abb2f4b7aff07d1dc9798a:2:{i:0;s:17:"_identity-backend";i:1;s:15:"[11,"",2592000]";}',
  139. 'advanced-backend' => 'jod3s30mp59ckenru49sfc58e9',
  140. '_csrf-backend' => '0c35033b6c8e50915fdcd017b0c38f6e8891df4fefb45374e62b46f684eddcf7a:2:{i:0;s:13:"_csrf-backend";i:1;s:32:"4ArS7Ho5C3xF-GC__udTYf36VDZfhvAj";}',
  141. ];
  142.  
  143. $_SESSION = [
  144. '__flash' => [],
  145. '__id' => 11,
  146. 'w0-nodesel' => null,
  147. ];
  148. Yii Framework
  149. 2019-02-18, 18:41:24
  150.  
  151. Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5
  152.  
  153. Yii Framework/2.0.16
  154.  
  155. Yii 2.0.16 PHP 7.2.5 Status 500 Route product/update Log 48 1 Time 179 ms Memory 6.997 MB DB 11 11 ms Events 61 Asset Bundles 3 User 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement