Problem/Motivation

PHP 8 throws the error:
Deprecated function: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in LinkitProfile->setEnabledsearchPlugins() (line 59 of /includes/profile.class.php).

Steps to reproduce

Install Linkit on PHP 8. Use linkit to create a link and start typing into the autocomplete field.

Proposed resolution

Change the uasort function linkit_sort_plugins_by_weight() to what core and other contrib use to return an integer rather than a boolean.

Issue fork linkit-3351631

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:

Comments

darkodev created an issue. See original summary.

avpaderno’s picture

Title: PHP 8 uasort(): Returning bool from comparison function is deprecated » uasort(): Returning bool from comparison function is deprecated
Issue tags: +PHP 8.0

darkodev’s picture

Tests failed because of my failure to fix the other sort function in linkit_profiles.inc.

Can't seem to run another test at this moment.

mark_fullmer’s picture

Status: Active » Reviewed & tested by the community

Tests are failing on 7.x-3.x with GitLab because the testing syntax is outdated. That said, this code change makes logical sense to me for remediating PHP 8 syntax expectations, so I'm comfortable proceeding with the merge.

mark_fullmer’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

darkodev’s picture

Attributing my contribution to my organization. Thanks for merging, @mark_fullmer!

mark_fullmer’s picture