Closed (fixed)
Project:
Commerce Reporting
Version:
7.x-4.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2014 at 20:00 UTC
Updated:
17 Apr 2015 at 13:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
greenskin commentedThe array_multisort() function re-indexes numerical keys. Here's a patch that fixes the issue, allowing for support of numerical product SKUs.
Comment #2
greenskin commentedComment #3
mglamanThe stock module just got overhauled in the beta1 release. This kind like it'd still be an issue, but could you confirm? Thanks!
Comment #4
vensiresHello, I had the same problem but the patch above didn't fix it. What did fix it though was to replace the
data[$sku] = array(....);code found in commerce_reports_stock.module(line 93) with the following code:The problem is that this $data is then processed by drupal_render() which tries to render numeric indexes as values and just fails. It seems that array_multisort() is also working fine even with strings and SORT_NUMERIC option.
Comment #5
mglamanThanks, vensires. Render is probably expecting numeric keys to be part of elennt subchildren. That makes sense. So really when $sku is defined we need to typecast it to string. I'm not sure we need any other modifications.
Comment #6
mglamanMarking this under the beta2 release plan #2425267: [META] 4.0 Beta2 Release Plan
Comment #8
mglamanUpdated to ensure that the SKU gets casted as a string when we initialize the variable. Fixed!