To reproduce:

- Create a order.
- On Admin page, go Store -> orders
- Select a order.
- Click the tab "Payment"
- Select a payment.

Not sure if its necessary to install another module to reproduce this error.

So, the thing is, its necessary to cast the from string to numeric when a calculation is happen:

"1000" to 1000
"1.3" to 1.3

... and so on. Not sure if its a custom page in this project, but I'm attaching the screenshot of the page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jkamizato created an issue. See original summary.

jkamizato’s picture

Issue summary: View changes
FileSize
24.78 KB
jkamizato’s picture

mrP’s picture

Ran across the same warning on multiple sites. Patch #3 applies cleanly to latest dev code and no more warnings.

kscheirer’s picture

Status: Active » Reviewed & tested by the community

based on #4

rszrama’s picture

Priority: Normal » Minor
Status: Reviewed & tested by the community » Needs review
FileSize
766 bytes

Confirmed the bug, but rather than cast $amount to a float in the return, I'm going to edit the transaction add form to use a numeric value as specified instead of an empty string. I suppose we just always depended on '' being cast to 0 in numeric operations in the past when there's really no reason not to pass 0 to begin with.

  • rszrama committed 6d7aae8 on 7.x-1.x
    Issue #3035138 by jkamizato, rszrama, mrP: fix a PHP 7.2 warning related...
rszrama’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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

solideogloria’s picture