Recently migrated a site from Drupal v5.x with Ubecart v5.x-1.x and uc_reorder 5.x-1.1.
Discovered that reorders made using reorder button would lose attribute information. In addition, was seeing Invalid argument supplied for foreach() in /..../modules/uc_reorder/uc_reorder.module on line 98 upon clicking reorder button.
The cause is an ubercart core change in serialized attribute storage in the 'data' column of the uc_order_products table. The fix is to recognize the old serialized format and handle it, which the attached patch attempts to do. This patch (against v6.x-1.2) corrects the problems described above on the migrated site, and reorder button was tested and working correctly for all orders, past and newly placed.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_reorder-6.x-1.2-sea_lmm.patch | 1.05 KB | sea_lmm |
Comments
Comment #1
tr commentedI don't think uc_reorder should be converting "old style" serialized attribute data to the current style. I think this is something that should be handled by the core Ubercart uc_attribute module when Ubercart is upgraded. I was under the impression that uc_attribute already does this conversion - I don't have time to test to see if this is true. If uc_attribute doesn't do that, it should, and this issue should be moved to the Ubercart queue as a bug report.
Comment #2
sea_lmm commentedJust to clarify, the patch doesn't convert the old attributes... it only makes sure that they are processed such that the reorder button works as expected (the same way as when "new style" attributes are present). It is a simple and non-intrusive way to prevent the php warnings and loss of functionality experienced after migrating from a v5.x to v6.x drupal environement,
It may well be that the root cause of this is that either (1) we did not properly migrate the system - however we ran all module upgrades and didn't receive any ubercart (or otherwise) warnings, or (2) that ubercart is not converting the older attributes, but should be, or (3) that ubercart v2.x purposefully doesn't convert the old attributes and instead recognizes the "old style" and handles it via code, like this patch attempts.