Problem/Motivation
When using Drupal\monitoring\Plugin\monitoring\SensorPlugin\CommerceTurnoverSensorPlugin and a blank commerce installation (no orders) the monitoring sensors throws an exception:
CommerceGuys\Intl\Exception\InvalidArgumentException: The provided value "" is not a valid number or numeric string.
Proposed resolution
We should not set the result if there is no enough data.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3111057-fix-commerce-turnover-3-2-interdiff.txt | 661 bytes | mbovan |
| #3 | 3111057-fix-commerce-turnover-3.patch | 1.74 KB | mbovan |
| #2 | 3111057-fix-commerce-turnover-2.patch | 1.09 KB | mbovan |
Comments
Comment #2
mbovan commentedIt looks to me that is better to set
nullas a value in case there are no orders so the message prints: "No value" instead of "Value 0.00".This is related to #3086728: Make commerce turnover sensor work in D8
Comment #3
mbovan commentedAdded a test coverage for this case too.
Comment #4
berdirThanks.