Zadejte hledaný výraz...

PS 1.7 při editaci popisu produktů error 500

Jirka
verified
rating uzivatele
(6 hodnocení)
2. 8. 2018 14:52:59
Dobrý den,
prosím o pomoc, při editaci popisu produktů to po jejich uložení háže 500 Internal Server Error v administraci Presty (v. 1.7.4.2), ostatní záložky v menu v adminovi fungují, jen se nelze dostat zpět do produktů.
Měl jsem otevřený jeden produkt v jedné záložce a v druhé záložce druhý produkt a z jednoho jsem kopíroval údaje do druhého, po stisknutím na Uložit to uložilo, ale při kliknutí na Katalog-Produkty se již začala zobrazovat chyba 500.
V ladícím režimu se to rozběhne, tak jsem v něm tyto dva poslední produkty vymazal, chyba ale přetrvává.
V logu z PS je jako poslední operace toto: Product catalog filters stored.
Po smazání těch dvou produktů se nedá nyní dostat ani do toho katalogu z adminu a píše to výpis erroru ze Symphony, poradí prosím někdo co s tím, děkuji:
Uncaught Warning: include_once(/domena.cz/modules/groupinc/classes/GroupincConfiguration.php): failed to open stream: No such file or directory
Show context Hide trace
{▼
/mnt/data/accounts/m/marketing/data/www/domena.cz/override/classes/Product.php:34 {▼
› if (Module::isEnabled('groupinc')) {
› include_once(_PS_MODULE_DIR_.'groupinc/classes/GroupincConfiguration.php');
› $groupinc = new GroupincConfiguration();
}
/domena.cz/classes/Product.php:3164 {▶}
/domena.cz/src/Adapter/Product/AdminProductDataProvider.php:351 {▶}
/domena.cz/src/PrestaShopBundle/Controller/Admin/ProductController.php:181 {▶}
/domena.cz/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151 {▶}
/domena.cz/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▶}
/domena.cz/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200 {▶}
/domena.cz/admin650t0p4kv/index.php:88 {▶}
}
CRITICAL
14:47:43
request Uncaught PHP Exception SymfonyComponentDebugExceptionContextErrorException: "Warning: include_once(/domena.cz/modules/groupinc/classes/GroupincConfiguration.php): failed to open stream: No such file or directory" at /domena.cz/override/classes/Product.php line 34
Show context Hide trace
{▼
/domena.cz/override/classes/Product.php:34 {▼
› if (Module::isEnabled('groupinc')) {
› include_once(_PS_MODULE_DIR_.'groupinc/classes/GroupincConfiguration.php');
› $groupinc = new GroupincConfiguration();
}
/domena.cz/classes/Product.php:3164 {▶}
/domena.cz/src/Adapter/Product/AdminProductDataProvider.php:351 {▶}
/domena.cz/src/PrestaShopBundle/Controller/Admin/ProductController.php:181 {▶}
/domena.cz/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151 {▶}
/domena.cz/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▶}
/domena.cz/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200 {▶}
/domena.cz/admin650t0p4kv/index.php:88 {▶}
}
****************************************
Problém byl identifikován v: domena.cz/override/classes/Product.php
-kde v té samé době, kdy se error 500 zobrazil, přibyl tento kód odkazující na neexistující modul v adresáři:
/*
* module: groupinc
* date: 2018-08-02 11:55:58
* version: 1.3.8
*/
public static function priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $zipcode, $id_currency,
$id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, &$specific_price, $use_group_reduction,
$id_customer = 0, $use_customer_price = true, $id_cart = 0, $real_quantity = 0, $id_customization = 0)
{
static $address = null;
static $context = null;
if ($address === null) {
$address = new Address();
}
if ($context == null) {
$context = Context::getContext()->cloneContext();
}
if ($id_shop !== null && $context->shop->id != (int)$id_shop) {
$context->shop = new Shop((int)$id_shop);
}
if (!$use_customer_price) {
$id_customer = 0;
}
if ($id_product_attribute === null) {
$id_product_attribute = Product::getDefaultAttribute($id_product);
}
$configs_without_taxes = array();
$configs_with_taxes = array();
$configs_with_discounts = array();
if (Module::isEnabled('groupinc')) {
include_once(_PS_MODULE_DIR_.'groupinc/classes/GroupincConfiguration.php');
$groupinc = new GroupincConfiguration();
if (in_array($context->controller->controller_type, array('admin'))) {
$configs_with_taxes = $groupinc->getAdminGIconfigurations($id_shop);
} else {
$taxes = false;
$configs_without_taxes = $groupinc->getGIConfigurations($id_shop, $id_product, $id_customer, $id_country, $id_state, $id_currency, $context->language->id, $taxes);
$taxes = true;
$configs_with_taxes = $groupinc->getGIConfigurations($id_shop, $id_product, $id_customer, $id_country, $id_state, $id_currency, $context->language->id, $taxes);
$configs_with_discounts = $groupinc->getGIConfigurations($id_shop, $id_product, $id_customer, $id_country, $id_state, $id_currency, $context->language->id, $taxes, true);
}
}
if (!Module::isEnabled('groupinc') || (!isset($configs_with_taxes) && count($configs_with_taxes) == 0) ||
(!isset($configs_without_taxes) && count($configs_without_taxes) == 0) ||
(!isset($configs_with_discounts) && count($configs_with_discounts) == 0)) {
return parent::priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $zipcode, $id_currency,
$id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, $specific_price, $use_group_reduction,
$id_customer, $use_customer_price, $id_cart, $real_quantity, $id_customization);
}
$cache_id = (int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.$id_state.'-'.$zipcode.'-'.(int)$id_group.
'-'.(int)$quantity.'-'.(int)$id_product_attribute.'-'.(int)$id_customization.
'-'.(int)$with_ecotax.'-'.(int)$id_customer.'-'.(int)$use_group_reduction.'-'.(int)$id_cart.'-'.(int)$real_quantity.
'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0').'-'.($use_tax?'1':'0').'-'.(int)$decimals;
$specific_price = SpecificPrice::getSpecificPrice(
(int)$id_product,
$id_shop,
$id_currency,
$id_country,
$id_group,
$quantity,
$id_product_attribute,
$id_customer,
$id_cart,
$real_quantity
);
if (isset($configs_with_discounts) and is_array($configs_with_discounts) and count($configs_with_discounts) > 0) {
$specific_price = $groupinc->getGroupincReduction($configs_with_discounts, $id_product, $specific_price);
}
if (isset(self::$_prices)) {
return self::$_prices;
}
$cache_id_2 = $id_product.'-'.$id_shop;
if (!isset(self::$_pricesLevel2)) {
$sql = new DbQuery();
$sql->select('product_shop.`price`, product_shop.`wholesale_price`, product_shop.`ecotax`');
$sql->from('product', 'p');
$sql->innerJoin('product_shop', 'product_shop', '(product_shop.id_product=p.id_product AND product_shop.id_shop = '.(int)$id_shop.')');
$sql->where('p.`id_product` = '.(int)$id_product);
if (Combination::isFeatureActive()) {
$sql->select('IFNULL(product_attribute_shop.id_product_attribute,0) id_product_attribute, product_attribute_shop.`price` AS attribute_price, product_attribute_shop.default_on');
$sql->leftJoin('product_attribute_shop', 'product_attribute_shop', '(product_attribute_shop.id_product = p.id_product AND product_attribute_shop.id_shop = '.(int)$id_shop.')');
} else {
$sql->select('0 as id_product_attribute');
}
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
if (is_array($res) && count($res)) {
foreach ($res as $row) {
$array_tmp = array(
'price' => $row,
'ecotax' => $row,
'wholesale_price' => $row,
'attribute_price' => (isset($row) ? $row : null)
);
self::$_pricesLevel2] = $array_tmp;
if (isset($row) && $row == 1) {
self::$_pricesLevel2 = $array_tmp;
}
}
}
}
if (!isset(self::$_pricesLevel2)) {
return;
}
$result = self::$_pricesLevel2;
if (!$specific_price || $specific_price < 0) {
$price = (float)$result;
} else {
$price = (float)$specific_price;
}
if (!$specific_price || !($specific_price >= 0 && $specific_price)) {
$price = Tools::convertPrice($price, $id_currency);
if (isset($specific_price) && $specific_price >= 0) {
$specific_price = $price;
}
}
$wholesale_price_without_taxes = (float)$result;
if (is_array($result) && (!$specific_price || !$specific_price || $specific_price < 0)) {
$attribute_price = Tools::convertPrice($result !== null ? (float)$result : 0, $id_currency);
if ($id_product_attribute !== false) {
$price += $attribute_price;
$wholesale_price_without_taxes += $attribute_price;
}
}
if ((int)$id_customization) {
$price += Customization::getCustomizationPrice($id_customization);
}
$address->id_country = $id_country;
$address->id_state = $id_state;
$address->postcode = $zipcode;
$tax_manager = TaxManagerFactory::getManager($address, Product::getIdTaxRulesGroupByIdProduct((int)$id_product, $context));
$product_tax_calculator = $tax_manager->getTaxCalculator();
$retail_price_without_taxes = $price;
$retail_price_with_taxes = $product_tax_calculator->addTaxes($price);
$wholesale_price_with_taxes = $product_tax_calculator->addTaxes($wholesale_price_without_taxes);
if ($use_group_reduction) {
$reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group);
if ($reduction_from_category !== false) {
$group_reduction = $price * (float)$reduction_from_category;
} else { // apply group reduction if there is no group reduction for this category
$group_reduction = (($reduc = Group::getReductionByIdGroup($id_group)) != 0) ? ($price * $reduc / 100) : 0;
}
}
$use_group_reduction_override = true;
if ((isset($configs_without_taxes) and is_array($configs_without_taxes) and count($configs_without_taxes) > 0) || (isset($configs_with_taxes) and is_array($configs_with_taxes) and count($configs_with_taxes))) {
if (isset($configs_without_taxes) and is_array($configs_without_taxes) and count($configs_without_taxes) > 0) {
foreach ($configs_without_taxes as $giconfig) {
if (!empty($specific_price) || $group_reduction) {
if (!$giconfig) {
$id_gi_config = $giconfig;
$price = $groupinc->getPriceModified($id_gi_config, $retail_price_with_taxes, $retail_price_without_taxes, $wholesale_price_with_taxes, $wholesale_price_without_taxes);
$retail_price_without_taxes = $price;
$wholesale_price_without_taxes = $price;
}
} else {
$id_gi_config = $giconfig;
$price = $groupinc->getPriceModified($id_gi_config, $retail_price_with_taxes, $retail_price_without_taxes, $wholesale_price_with_taxes, $wholesale_price_without_taxes);
$retail_price_without_taxes = $price;
$wholesale_price_without_taxes = $price;
}
if ($giconfig) {
$use_group_reduction_override = false;
}
if ($giconfig) {
break;
}
}
if ($use_tax) {
$price = $product_tax_calculator->addTaxes($price);
}
}
if (isset($configs_with_taxes) and is_array($configs_with_taxes) and count($configs_with_taxes) > 0) {
foreach ($configs_with_taxes as $giconfig) {
if (!empty($specific_price) || $group_reduction) {
if (!$giconfig) {
$id_gi_config = $giconfig;
$price = $groupinc->getPriceModified($id_gi_config, $retail_price_with_taxes, $retail_price_without_taxes, $wholesale_price_with_taxes, $wholesale_price_without_taxes);
$retail_price_with_taxes = $price;
$wholesale_price_with_taxes = $price;
}
} else {
$id_gi_config = $giconfig;
$price = $groupinc->getPriceModified($id_gi_config, $retail_price_with_taxes, $retail_price_without_taxes, $wholesale_price_with_taxes, $wholesale_price_without_taxes);
$retail_price_with_taxes = $price;
$wholesale_price_with_taxes = $price;
}
if ($giconfig) {
$use_group_reduction_override = false;
}
if ($giconfig) {
break;
}
}
if (!$use_tax) {
$price = $product_tax_calculator->removeTaxes($price);
}
}
} else {
if ($use_tax) {
$price = $product_tax_calculator->addTaxes($price);
}
}
if (($result || isset($result)) && $with_ecotax) {
$ecotax = $result;
if (isset($result) && $result > 0) {
$ecotax = $result;
}
if ($id_currency) {
$ecotax = Tools::convertPrice($ecotax, $id_currency);
}
if ($use_tax) {
$tax_manager = TaxManagerFactory::getManager(
$address,
(int)Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID')
);
$ecotax_tax_calculator = $tax_manager->getTaxCalculator();
$price += $ecotax_tax_calculator->addTaxes($ecotax);
$wholesale_price_with_taxes += $ecotax_tax_calculator->addTaxes($ecotax);
} else {
$price += $ecotax;
$wholesale_price_with_taxes += $ecotax;
}
}
$apply_taxes_after = false;
$price_to_apply = -1;
if (isset($configs_with_discounts) and is_array($configs_with_discounts) and count($configs_with_discounts) > 0) {
foreach ($configs_with_discounts as $giconfig) {
if ($giconfig == 0) {
$price = $wholesale_price_without_taxes;
}
if ($giconfig == 1) {
$price = $retail_price_without_taxes;
}
if ($giconfig == 2) {
$price = $wholesale_price_with_taxes;
}
if ($giconfig == 3) {
$price = $retail_price_with_taxes;
}
if ($giconfig == 0) {
$price_to_apply = $wholesale_price_without_taxes;
$apply_taxes_after = true;
}
if ($giconfig == 1) {
$price_to_apply = $retail_price_without_taxes;
$apply_taxes_after = true;
}
if ($giconfig == 2) {
$price_to_apply = $wholesale_price_with_taxes;
}
if ($giconfig == 3) {
$price_to_apply = $retail_price_with_taxes;
}
break;
}
}
$specific_price_reduction = 0;
if (($only_reduc || $use_reduc) && $specific_price) {
if ($specific_price == 'amount') {
$reduction_amount = $specific_price;
if (!$specific_price) {
$reduction_amount = Tools::convertPrice($reduction_amount, $id_currency);
}
$specific_price_reduction = $reduction_amount;
if (!$use_tax && $specific_price) {
$specific_price_reduction = $product_tax_calculator->removeTaxes($specific_price_reduction);
}
if ($use_tax && !$specific_price) {
$specific_price_reduction = $product_tax_calculator->addTaxes($specific_price_reduction);
}
} else {
$specific_price_reduction = $price * $specific_price;
}
}
if ($price_to_apply > -1) {
$price_to_apply -= $specific_price_reduction;
$price = $price_to_apply;
} else{
$price -= $specific_price_reduction;
}
$override_discounts = false;
if (isset($configs_with_discounts) and is_array($configs_with_discounts) and count($configs_with_discounts) > 0) {
if ($configs_with_discounts == 1) {
$override_discounts = true;
}
if ($use_tax and $apply_taxes_after) {
$price = $product_tax_calculator->addTaxes($price);
}
}
if ($use_group_reduction && $use_group_reduction_override) {
$reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group);
if ($reduction_from_category !== false) {
$group_reduction = $price * (float)$reduction_from_category;
} else { // apply group reduction if there is no group reduction for this category
$group_reduction = (($reduc = Group::getReductionByIdGroup($id_group)) != 0) ? ($price * $reduc / 100) : 0;
}
$price -= $group_reduction;
}
if ($only_reduc) {
return Tools::ps_round($specific_price_reduction, $decimals);
}
$price = Tools::ps_round($price, $decimals);
if ($price < 0) {
$price = 0;
}
self::$_prices = $price;
return self::$_prices;
}
2. 8. 2018 14:52:59
https://webtrh.cz/diskuse/ps-1-7-pri-editaci-popisu-produktu-error-500/#reply1359237
Pro odpověď se přihlašte.
Přihlásit