Deprecated function: round(): Passing null to parameter #1 ($num) of type int|float is deprecated

Created on 12 July 2023, over 1 year ago
Updated 4 July 2024, 6 months ago

Problem/Motivation

We're using PHP 8.1 and Drupal 9. During checkout this warning is shown, and logged too:

Deprecated function: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in Drupal\commerce_user_points\Plugin\Commerce\CheckoutPane\CommerceUserPoints->buildPaneForm() (line 147 of modules/contrib/commerceuserpoints/src/Plugin/Commerce/CheckoutPane/CommerceUserPoints.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

9.0

Component

Code

Created by

🇸🇰Slovakia kaszarobert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kaszarobert
  • 🇮🇳India Shreya_98

    Please give the steps to reproduce this issue .

  • 🇸🇰Slovakia kaszarobert

    1. Use PHP 8.1 or newer,
    2. add this to settings.php to show each PHP error on page and clear caches:
    $config['system.logging']['error_level'] = 'verbose';
    3. set up the module as written in documentation
    4. add points for a user to use
    5. add something to the cart and start checkout
    6. try to use your points for the order
    7. that error should be shown and logged what I mentioned. Also if core dblog module is enabled, then it should also be at /admin/reports/dblog

  • 🇮🇳India mohd sahzad

    I have fixed this issue Deprecated function: round(): Passing null to parameter #1 ($num) of type int|float is deprecated please review above attached patch

  • Status changed to Fixed 6 months ago
  • 🇮🇳India jigish.addweb

    Changes are added now in 3.0.x branch, Thanks for the patch @Mohd Sahzad.

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

Production build 0.71.5 2024