Problem/Motivation

Form page shows this error:

Deprecated function: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in Drupal\node_action_log\Form\FilterForm->buildForm() (line 82 of modules/contrib/node_action_log/src/Form/FilterForm.php).
Drupal\node_action_log\Form\FilterForm->buildForm(Array, Object)

Steps to reproduce

Go to /admin/reports/nalog in php >=8.0

Proposed resolution

Change logic on FilterForm.php:80 to read

    uasort($filters_node_type, static function ($a, $b) {
      if ($a == $b) {
        return 0;
      }
      return $a > $b ? -1 : 1;
    });
CommentFileSizeAuthor
#2 3345313-uasort-fix.patch558 byteschris dart
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 2.0.x Comparecompare

Comments

Chris Dart created an issue. See original summary.

chris dart’s picture

StatusFileSize
new558 bytes

Here's a patch from the above branch.

harivenuv’s picture

Hi @Chris Dart,

Thanks you for the patch, will review and merge

yash_khandelwal’s picture

Status: Active » Needs review

#2 patch is working fine for me. @harivenuv, please review once and apply the patch. Thanks

  • Chris Dart authored 0d7c8859 on 2.0.x
    Issue #3343513 by Chris Dart, harivenuv, yash_khandelwal: Deprecated...
harivenuv’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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