Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This issue occurs when you have a number component that isn't required, and a submission to the webform with the number field empty. On csv export you get this warning.
Simple patch here that fixes the issue. Related (sort of) to #1458330: Empty string number components throw PHP notice on display
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-csv-number-format-fix-2.patch | 656 bytes | acbramley |
webform-csv-number-format-fix.patch | 632 bytes | acbramley | |
Comments
Comment #1
Liam MorlandI am not getting the error you report. Your patch would prevent a number of 0 being processed by number_format(). You may find is_numeric() to be a useful function for what you are trying to do, if the problem still exists.
Comment #2
acbramley CreditAttribution: acbramley commentedI can reproduce this error every time, after exporting the csv reload the page and you should see it (or have a look in the watchdog). This patch is better.
Comment #3
quicksketchCommitted #2 to 6.x-3.x, 7.x-3.x, and 7.x-4.x. Thanks guys!
Comment #4
quicksketchThough I am curious why this problem would ever happen... non-numeric data shouldn't really be in the number component's data. In any case this results in more robust code, so I'm not opposed to including it.