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.

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

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思