Warning: number_format() expects parameter 1 to be double, string given funktiossa _payment_method_adjustment() (rivi 271 tiedostossa /home/biovasa/biovasa.fi/sites/all/modules/uc_pma/uc_pma.module).

This is repeated for every order (Thus giving hundreds of orders)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ryank76’s picture

I'm getting this too:

Warning: number_format() expects parameter 1 to be double, string given in _payment_method_adjustment() (line 271 of /home/reunionu/public_html/sites/all/modules/uc_pma/uc_pma.module).
Warning: number_format() expects parameter 1 to be double, string given in _payment_method_adjustment() (line 271 of /home/reunionu/public_html/sites/all/modules/uc_pma/uc_pma.module).
Warning: number_format() expects parameter 1 to be double, string given in _payment_method_adjustment() (line 271 of /home/reunionu/public_html/sites/all/modules/uc_pma/uc_pma.module).
Warning: number_format() expects parameter 1 to be double, string given in _payment_method_adjustment() (line 271 of /home/reunionu/public_html/sites/all/modules/uc_pma/uc_pma.module)

.

xurizaemon’s picture

Status: Active » Needs review
FileSize
864 bytes

Without digging TOO deeply, it seems like round() is the right thing to do here, not number_format()?

Try this, let me know if it applies discounts properly. Untested.

xurizaemon’s picture

Hmm, also apparently a dupe in #964156: Warning: number_format() expects parameter 1 to be double, the fix there may be more appropriate (but may need updating for D7).

Was this happening when the adjustment was zero, or when there was some adjustment being applied?

If for zero adjustments, you might prefer to use the fix from that issue, updated to D7 here.

ryank76’s picture

That patch totally worked - thanks!

xurizaemon’s picture

Guessing you mean the first patch, based on the time of our comments here?

kopeboy’s picture

Issue summary: View changes

I applyed the patch, but this is not right IMHO! It causes a problem for the end user to solve a trivial problem in the admin logs.

The problem is now the customer see the line item with the fee even if adjustment is not present.

BEFORE:
Example with COD (I want to apply a fee):

Subtotal: 100
Discount 1: -10
COD fee: 5
Order total: 95

+ Errors in the log.

BEFORE:
Example with paypal (I apply no fee):

Subtotal: 100
Discount 1: -10
Order total: 90

+ Errors in the log.

NOW:
Example with paypal (I apply no fee):
Subtotal: 100
Discount 1: -10
PayPal Website Payments Standard fee: 0
Order total: 90

No errors in the log, but HORRIBLE for the user.

xurizaemon’s picture

@kopeboy / @ryank76, can you confirm which of the above patches you were trying?

Ryan you posted a few minutes after I added a second patch so I wondered if you used the first instead?

Kopeboy if patch #3 didn't work for you try the eearlier one.

Remember to mark RTBC if it works for you, that's how you can help things get committed :D

kopeboy’s picture

I applied the "empty adjustment" one..

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

#3 works and should be committed

xurizaemon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reviewing.

  • xurizaemon committed 00fcf4f on 7.x-1.x
    Issue #1687740. Check the number is not a blank string before we try to...
ladinusamad’s picture

Status: Fixed » Reviewed & tested by the community

#3
thx!
worked for me

ParisLiakos’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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