Deprecated function: usort(): Returning bool from comparison function is deprecated

Created on 15 January 2024, 11 months ago

Problem/Motivation

Using PHP8.1, after open a new learning course I got this error message:

Deprecated function: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in opigno_learning_path_get_all_steps() (line 2722 of modules/contrib/opigno_learning_path/opigno_learning_path.module).

Steps to reproduce

  • Use >= PHP8.0
  • Open a new course using opigno_learning_path

Proposed resolution

Since PHP 8, the usort() function has been changed: https://wiki.php.net/rfc/stable_sorting
So, on the opigno_learning_path.module file, line 2727, instead of returning bool, return an int.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇦🇷Argentina andreadruiz Buenos Aires

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024