douyi7055 2013-06-07 02:19
浏览 48
已采纳

自定义Magento模块有时会从销售表中获取随机数据

STORY (Sad): I'v been assigned to fix this bug we had for a long time, unfortunately the module was written 2 years back by a Dev who already left the company :(

FUNCTION : Module is develop to fetch some order/customer details from Magento and write them to few other custom tables, then a different system in production will fetch them to make and deliver all orders to their customers.

HOW : Module has a Model extends from Mage_Sales_Model_Order and a method _afterSave() which overrides Mage_Sales_Model_Order::_afterSave(). This method includes all code that writes to these additional tables.

BUG : At some odd occasions, some orders has additional order line items, as an example in one scenario it had an order that has 3 order line items, when the real order had only 1 order line item. After doing some deep digging found that one of the order lines were from a old order by the same customer, and the other additional line item was a duplicate of the real order line item.

CLUES : Tried so many things and few clues I manage to find, I can see _afterSave was getting called twice when I was debugging through xDebug. But couldn't find where it get called twice.

Tried to re-create the issue by my safe so many time but every thing works fine in dev environment as it always does.

We use $this->getAllItems() to get the order item data.

HELP :This happens in a really random manner, Just looking for help to get my self to look different avenues, coz I know no one will be able to provide me with a total solution. Some guidance please, since I have ran in to few rabbit wholes already.

Thanx Heaps!!! If you need more details, please let me know.

  • 写回答

1条回答 默认 最新

  • douduiwei2831 2013-06-20 01:27
    关注

    Ultimately we have decided to rewrite the module, with good Magento disciplines.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改