I have still a problem with updating magento system.
My last update put a terrible mess in my websites.
The first problem I observe, I don’t have any custom options show in the front-end.
However, it is still show up in my backend.
The second problem I have, is about database updgrade.
Especially about the catalogInventory status table.
When we want to save a product, I meet an error about foreign key :
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`databasename/cataloginventory_stock_status`, CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DELETE CASCADE ON UPD)
In spite of it save properly my products in database but I don’t have any stock options saved.
I think I would had to stay on older upgrade.
I loose so many orders in order to upgrade magento.
On the other hand, we have so far 10+ thousand orders with magento and we meet many problems about performance issues.
We ought to look up for master and slave servor system to improve traffic issues…
A terrible mess for us, we have to spend many times and plenty of money to manage our servors.
The Custom Options disappearing is a known and now fixed bug, which will be packaged with the 1.2.2 release. In the bug report you can find an SQL statement that fixes it temporarily. Search the issues on “disappearing” and see the one I filed.
If you do more than 10K orders, presumably in under a year, you must also be able to afford load balanced or DB clustered servers.
Any why would you loose orders during an upgrade? Surely you test the upgrade on a dev server first before pushing the changes out to production in under 30 minutes during low-traffic times in the day?
UPDATE catalog_product_entity
SET has_options = 1
WHERE entity_id IN
(SELECT distinct(product_id) FROM catalog_product_option);
But my options are still hidden.
And I don’t understand one point : Magento team seems have resolved this issue but they don’t communicate on how to fix it ?
That’s the one. If that doesn’t fix it for you, you’ve hit something else.
They rather keep on bug fixing and releasing it the usual way than giving people bitsy patches which may then conflict with the real release again. Most releases take just two weeks so it’s up to you whether to roll back or keep it buggy for a few weeks.
The problem is when you come on product informations page, catalog_product_entity table reset has_options to 0.
You may put a cron job with the previous mysql command but it doesn’t solved the problem at all.
The only thing to do is waiting for a fixed release…
Hope soon…
Ok, I have a temporary fix for this problem.
We need to comment the
$this->setHasOptions(false);
line.
Mage/Catalog/Model/Product.php :
/** * Check product options and type options and save them, too * */ protected function _beforeSave() { $this->cleanCache(); $this->setTypeHasOptions(false); $this->setTypeHasRequiredOptions(false);
$this->getTypeInstance()->beforeSave();
$hasOptions = false; $hasRequiredOptions = false;
$this->canAffectOptions($this->_canAffectOptions || $this->getCanSaveCustomOptions()); if ($this->getCanSaveCustomOptions()) { $options = $this->getProductOptions(); if (is_array($options)) { foreach ($this->getProductOptions() as $option) { $this->getOptionInstance()->addOption($option); if ((!isset($option['is_delete'])) || $option['is_delete'] != '1') { $hasOptions = true; } } foreach ($this->getOptionInstance()->getOptions() as $option) { if ($option['is_require'] == '1') { $hasRequiredOptions = true; break; } } } }
/** * Set true, if any * Set false, ONLY if options have been affected by Options tab and Type instance tab */ if ($hasOptions || (bool)$this->getTypeHasOptions()) { $this->setHasOptions(true); if ($hasRequiredOptions || (bool)$this->getTypeHasRequiredOptions()) { $this->setRequiredOptions(true); } elseif ($this->canAffectOptions()) { $this->setRequiredOptions(false); } } elseif ($this->canAffectOptions()) { // $this->setHasOptions(false); $this->setRequiredOptions(false); } parent::_beforeSave(); }