Closed (fixed)
Project:
Commerce Webform
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Sep 2013 at 00:45 UTC
Updated:
28 Nov 2015 at 17:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
karingActually some of them log messages are re: line 560 - same message though:
Comment #2
johnennew commentedHi KarinG - It looks like $values is not always an array. Documentation for the hook says it should always be an array so it would be good to know what it is when the error occurs.
I've not been able to replicate this - can you try the attached patch and see what happens?
Comment #3
karingComment #4
karingHi! I've uploaded product_skus.png to this node - as you can see I've got 12 product skus and when I debug $values, I get:
So I'm getting = null for Select elements IF I haven't selected for the product (paid/unpaid status doesn't matter). I'm getting 2 notices in the dblog for every = null, so 14 in total. The drink options are checkboxes and these are working as expected.
I recently changed the #type for Quantity with a 'select' (formerly a textfield) - https://drupal.org/node/2073513 - but reverting that still gives me the same number of:
$values = 0Curious (and hoping) you can reproduce this by making some products "Allow the user to set the quantity".
-- KarinG
Comment #5
johnennew commentedHi KarinG,
I have replicated the problem. Not sure why there is a NULL going in there but the patch in #2 does appear to stop the issue. Basically, if there is no value return nothing - can you confirm, or is expected data missing from the CSV export?
Comment #6
karingHi! Yes, we can stop the error messages in the dblog by checking to see if $values is an array first (patch in #2) - but w/ that patch I am now missing data from the report. Essentially the $values = null fields are no longer producing a 0 in their cell - everything is now shifted right to left - so data is in the wrong columns and/or no data at all (far right columns).
-- Karin
Comment #7
karingHi John - I've attached a screenshot to illustrate #6. -- Karin
Comment #8
karingComment #9
karingHi John,
Hoping you will soon have a chance to think about what to do here. To recap: the patch in #2 does stop the error messages written to the dblog - but the csv is all messed up. I think perhaps we need to rewrite the:
nullto
something like:
{"product_id":0,"quantity":0, etc.Best for 2014!
-- Karin
Comment #10
johnennew commentedHi Karin,
Found some more time to work on this at the weekend. This issue has thrown up some deeper problems with the module. Can you check the attached, rather larger patch and see how you get on? It's a patch against latest 1.x dev branch - if you are not running the dev branch you might have a problem with this one.
Kind regards,
John
Comment #11
karingHi John, Ah - I see. Thank you. I'll take a cloned copy of the school's site to 1.x dev - apply this patch and run tests. -- Karin
Comment #12
johnennew commentedConfirmed this is a problem with 7.x-2.x
Comment #13
johnennew commentedSlight modification of the patch in #10 for the 7.x-2.x branch
Comment #15
johnennew commentedCommitted to 7.x-2.x with thanks!
Comment #16
karingGreat - thank you!