Warning deprecated in php8.1

Issue #154 resolved
Michael Mariaux created an issue

The settings.php file has a deprecation php8.1 in line 198 (https://bitbucket.org/dw8/moodle-format_tiles/src/master/settings.php#lines-198) on "$choices[$x * 10] = $x", to fix it, it must be replaced by $choices[floor($x * 10) = $x]

The php Warning 'Deprecated: Implicit conversion from float 303.00000000000006 to int loses precision in Command line code on line 198' * 30

Thanks

Comments (2)

  1. David Watson repo owner

    Thanks for the report Michael. This is addressed in the latest release for Moodle 4.2, which should also be compatible with Moodle 4.1. (I will mark it as compatible on moodle.org shortly)

  2. Acqua Alta

    Hi David,
    If I’m not mistaken, the plugin version which was last updated on June 2nd is 4.2.0.1 (2023060200), which is not compatible yet with Moodle 4.1, and compatible only with Moodle 4.2
    The version that is compatible with Moodle 4.1 is 4.1.0.2 (2023030500), which was last updated on March 7th.

    Could you please release a version of the plugin that is compatible with Moodle 4.1 and also deals with the PHP 8.1 deprecation issue?
    What’s strange is that although we I use PHP 8.1 and the 4.1.0.2 version of the plugin, and the debug mode is set even higher, still I didn’t encounter the messages mentioned in this thread and also here:
    https://bitbucket.org/dw8/moodle-format_tiles/issues/156/php81-deprecation-notice

    Thanks :-)

  3. Log in to comment