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

Comments

mbovan created an issue. See original summary.

mbovan’s picture

Issue summary: View changes
Status: Active » Needs review
Related issues: +#3086728: Make commerce turnover sensor work in D8
StatusFileSize
new1.09 KB

It looks to me that is better to set null as 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

mbovan’s picture

Added a test coverage for this case too.

berdir’s picture

Status: Needs review » Fixed

Thanks.

  • Berdir committed 7bd64bb on 8.x-1.x authored by mbovan
    Issue #3111057 by mbovan: InvalidArgumentException is thrown...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.