Jump to content

Edit History

Waflu

Waflu

Dzień dobry,

po aktualizacji z 1.7.4.4 do 1.7.5.1 Presta ma problem z zapisem ilości produktów. Aktualizacja była przeprowadzona przez Installatron z Direct Admina, bo 1 Click Upgrade się wieszał. Niezależnie czy tworzę nowy produkt czy edytuję istniejący, po dodaniu ilości produktu i kliknięciu zapisz, mimo komunikatu o powodzeniu ilość nadal jest taka sama. Próbowałem czyścić cache sklepu i przeglądarki. Po włączeniu trybu debugowania otrzymuję taki błąd zaraz po wejściu w produkt:
 

Quote

Nieznana kolumna 'location' w field list<br /><br /><pre>SELECT location
FROM `pr_stock_available`
WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1</pre>

Quote

PrestaShopDatabaseException

in classes/db/Db.php (line 769)
  1.         if ($webservice_call && $errno) {
  2.             $dbg debug_backtrace();
  3.             WebserviceRequest::getInstance()->setError(500'[SQL Error] ' $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' $dbg[3]['function'] . '() Query was : ' $sql97);
  4.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
  5.             if ($sql) {
  6.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' $sql '</pre>');
  7.             }
  8.             throw new PrestaShopDatabaseException($this->getMsgError());
  9.         }
  10.     }
DbCore->displayError('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1')in classes/db/Db.php (line 385)
  1.                 $this->result $this->_query($sql);
  2.             }
  3.         }
  4.         if (_PS_DEBUG_SQL_) {
  5.             $this->displayError($sql);
  6.         }
  7.         return $this->result;
  8.     }
DbCore->query('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1')in classes/db/Db.php (line 663)
  1.                 return $result;
  2.             }
  3.         }
  4.         $this->result $this->query($sql);
  5.         if (!$this->result) {
  6.             $result false;
  7.         } else {
  8.             $result $this->nextRow($this->result);
  9.         }
DbCore->getRow('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1', true)in classes/db/Db.php (line 697)
  1.     {
  2.         if ($sql instanceof DbQuery) {
  3.             $sql $sql->build();
  4.         }
  5.         if (!$result $this->getRow($sql$use_cache)) {
  6.             return false;
  7.         }
  8.         return array_shift($result);
  9.     }
DbCore->getValue('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0)')in classes/stock/StockAvailable.php (line 782)
  1.         $query->where('id_product = ' $id_product);
  2.         $query->where('id_product_attribute = ' $id_product_attribute);
  3.         $query StockAvailable::addSqlShopRestriction($query$id_shop);
  4.         return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
  5.     }
  6.     /**
  7.      * Add an sql restriction for shops fields - specific to StockAvailable.
  8.      *
StockAvailableCore::getLocation(560)in classes/Product.php (line 6522)
  1.         // Default product quantity is available quantity to sell in current shop
  2.         $this->quantity StockAvailable::getQuantityAvailableByProduct($this->id0);
  3.         $this->out_of_stock StockAvailable::outOfStock($this->id);
  4.         $this->depends_on_stock StockAvailable::dependsOnStock($this->id);
  5.         $this->location StockAvailable::getLocation($this->id);
  6.         if (Context::getContext()->shop->getContext() == Shop::CONTEXT_GROUP && Context::getContext()->shop->getContextShopGroup()->share_stock == 1) {
  7.             $this->advanced_stock_management $this->useAdvancedStockManagement();
  8.         }
  9.     }
ProductCore->loadStockData()in src/PrestaShopBundle/Model/Product/AdminModelAdapter.php (line 443)
  1.      *
  2.      * @return array Transformed model data to form attempt
  3.      */
  4.     public function getFormData(Product $product)
  5.     {
  6.         $product->loadStockData();
  7.         $this->productPricePriority $this->adminProductWrapper->getPricePriority($product->id);
  8.         $this->formData['id_product'] = $product->id;
  9.         $this->formData['step1'] = $this->mapStep1FromData($product);
  10.         $this->formData['step2'] = $this->mapStep2FormData($product);
AdminModelAdapter->getFormData(object(Product))in src/PrestaShopBundle/Controller/Admin/ProductController.php (line 661)
  1.      * @throws \Symfony\Component\Process\Exception\LogicException
  2.      */
  3.     private function createProductForm(Product $productAdminModelAdapter $modelMapper)
  4.     {
  5.         $formBuilder $this->createFormBuilder(
  6.             $modelMapper->getFormData($product),
  7.             ['allow_extra_fields' => true]
  8.         )
  9.             ->add('id_product'HiddenType::class)
  10.             ->add('step1'ProductInformation::class)
  11.             ->add('step2'ProductPrice::class, ['id_product' => $product->id])
ProductController->createProductForm(object(Product), object(AdminModelAdapter))in src/PrestaShopBundle/Controller/Admin/ProductController.php (line 452)
  1.         $isMultiShopContext count($shopContext->getContextListShopID()) > 1;
  2.         $modelMapper $this->get('prestashop.adapter.admin.model.product');
  3.         $adminProductWrapper $this->get('prestashop.adapter.admin.wrapper.product');
  4.         $form $this->createProductForm($product$modelMapper);
  5.         $formBulkCombinations $this->createForm(
  6.             ProductCombinationBulk::class,
  7.             null,
  8.             [
ProductController->formAction('560', object(Request))in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)
  1.         $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response = \call_user_func_array($controller$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch(KernelEvents::VIEW$event);
HttpKernel->handleRaw(object(Request), 1)in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level'ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
HttpKernel->handle(object(Request), 1, false)in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 200)
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle(object(Request), 1, false)in adrespaneluadmina/index.php (line 88)
  1. $request Request::createFromGlobals();
  2. Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL);
  3. try {
  4.     require_once __DIR__.'/../autoload.php';
  5.     $response $kernel->handle($requestHttpKernelInterface::MASTER_REQUESTfalse);
  6.     $response->send();
  7.     $kernel->terminate($request$response);
  8. } catch (NotFoundHttpException $exception) {
  9.     define('ADMIN_LEGACY_CONTEXT'true);
  10.     // correct Apache charset (except if it's too late)

Ma ktoś pomysł jak to naprawić bez przywracania poprzedniej wersji? Na tej już mam paru nowych klientów i zamówień i nie chciałbym musieć robić backupu :)

Waflu

Waflu

Dzień dobry,

po aktualizacji z 1.7.4.1 do 1.7.5.1 Presta ma problem z zapisem ilości produktów. Aktualizacja była przeprowadzona przez Installatron z Direct Admina, bo 1 Click Upgrade się wieszał. Niezależnie czy tworzę nowy produkt czy edytuję istniejący, po dodaniu ilości produktu i kliknięciu zapisz, mimo komunikatu o powodzeniu ilość nadal jest taka sama. Próbowałem czyścić cache sklepu i przeglądarki. Po włączeniu trybu debugowania otrzymuję taki błąd zaraz po wejściu w produkt:
 

Quote

Nieznana kolumna 'location' w field list<br /><br /><pre>SELECT location
FROM `pr_stock_available`
WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1</pre>

Quote

PrestaShopDatabaseException

in classes/db/Db.php (line 769)
  1.         if ($webservice_call && $errno) {
  2.             $dbg debug_backtrace();
  3.             WebserviceRequest::getInstance()->setError(500'[SQL Error] ' $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' $dbg[3]['function'] . '() Query was : ' $sql97);
  4.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
  5.             if ($sql) {
  6.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' $sql '</pre>');
  7.             }
  8.             throw new PrestaShopDatabaseException($this->getMsgError());
  9.         }
  10.     }
DbCore->displayError('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1')in classes/db/Db.php (line 385)
  1.                 $this->result $this->_query($sql);
  2.             }
  3.         }
  4.         if (_PS_DEBUG_SQL_) {
  5.             $this->displayError($sql);
  6.         }
  7.         return $this->result;
  8.     }
DbCore->query('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1')in classes/db/Db.php (line 663)
  1.                 return $result;
  2.             }
  3.         }
  4.         $this->result $this->query($sql);
  5.         if (!$this->result) {
  6.             $result false;
  7.         } else {
  8.             $result $this->nextRow($this->result);
  9.         }
DbCore->getRow('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1', true)in classes/db/Db.php (line 697)
  1.     {
  2.         if ($sql instanceof DbQuery) {
  3.             $sql $sql->build();
  4.         }
  5.         if (!$result $this->getRow($sql$use_cache)) {
  6.             return false;
  7.         }
  8.         return array_shift($result);
  9.     }
DbCore->getValue('SELECT locationFROM `pr_stock_available`WHERE (id_product = 560) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0)')in classes/stock/StockAvailable.php (line 782)
  1.         $query->where('id_product = ' $id_product);
  2.         $query->where('id_product_attribute = ' $id_product_attribute);
  3.         $query StockAvailable::addSqlShopRestriction($query$id_shop);
  4.         return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
  5.     }
  6.     /**
  7.      * Add an sql restriction for shops fields - specific to StockAvailable.
  8.      *
StockAvailableCore::getLocation(560)in classes/Product.php (line 6522)
  1.         // Default product quantity is available quantity to sell in current shop
  2.         $this->quantity StockAvailable::getQuantityAvailableByProduct($this->id0);
  3.         $this->out_of_stock StockAvailable::outOfStock($this->id);
  4.         $this->depends_on_stock StockAvailable::dependsOnStock($this->id);
  5.         $this->location StockAvailable::getLocation($this->id);
  6.         if (Context::getContext()->shop->getContext() == Shop::CONTEXT_GROUP && Context::getContext()->shop->getContextShopGroup()->share_stock == 1) {
  7.             $this->advanced_stock_management $this->useAdvancedStockManagement();
  8.         }
  9.     }
ProductCore->loadStockData()in src/PrestaShopBundle/Model/Product/AdminModelAdapter.php (line 443)
  1.      *
  2.      * @return array Transformed model data to form attempt
  3.      */
  4.     public function getFormData(Product $product)
  5.     {
  6.         $product->loadStockData();
  7.         $this->productPricePriority $this->adminProductWrapper->getPricePriority($product->id);
  8.         $this->formData['id_product'] = $product->id;
  9.         $this->formData['step1'] = $this->mapStep1FromData($product);
  10.         $this->formData['step2'] = $this->mapStep2FormData($product);
AdminModelAdapter->getFormData(object(Product))in src/PrestaShopBundle/Controller/Admin/ProductController.php (line 661)
  1.      * @throws \Symfony\Component\Process\Exception\LogicException
  2.      */
  3.     private function createProductForm(Product $productAdminModelAdapter $modelMapper)
  4.     {
  5.         $formBuilder $this->createFormBuilder(
  6.             $modelMapper->getFormData($product),
  7.             ['allow_extra_fields' => true]
  8.         )
  9.             ->add('id_product'HiddenType::class)
  10.             ->add('step1'ProductInformation::class)
  11.             ->add('step2'ProductPrice::class, ['id_product' => $product->id])
ProductController->createProductForm(object(Product), object(AdminModelAdapter))in src/PrestaShopBundle/Controller/Admin/ProductController.php (line 452)
  1.         $isMultiShopContext count($shopContext->getContextListShopID()) > 1;
  2.         $modelMapper $this->get('prestashop.adapter.admin.model.product');
  3.         $adminProductWrapper $this->get('prestashop.adapter.admin.wrapper.product');
  4.         $form $this->createProductForm($product$modelMapper);
  5.         $formBulkCombinations $this->createForm(
  6.             ProductCombinationBulk::class,
  7.             null,
  8.             [
ProductController->formAction('560', object(Request))in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)
  1.         $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response = \call_user_func_array($controller$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch(KernelEvents::VIEW$event);
HttpKernel->handleRaw(object(Request), 1)in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level'ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
HttpKernel->handle(object(Request), 1, false)in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 200)
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle(object(Request), 1, false)in adrespaneluadmina/index.php (line 88)
  1. $request Request::createFromGlobals();
  2. Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL);
  3. try {
  4.     require_once __DIR__.'/../autoload.php';
  5.     $response $kernel->handle($requestHttpKernelInterface::MASTER_REQUESTfalse);
  6.     $response->send();
  7.     $kernel->terminate($request$response);
  8. } catch (NotFoundHttpException $exception) {
  9.     define('ADMIN_LEGACY_CONTEXT'true);
  10.     // correct Apache charset (except if it's too late)

Ma ktoś pomysł jak to naprawić bez przywracania poprzedniej wersji? Na tej już mam paru nowych klientów i zamówień i nie chciałbym musieć robić backupu :) 

×
×
  • Create New...