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