t1mwillis / GWCode-EE3-EE4-EE5

A fork of the GWCode module to support EE3+ as well as PHP7
14 stars 6 forks source link

Function create_function() is deprecated #3

Closed StuartMcD closed 4 years ago

StuartMcD commented 5 years ago

Good ol' PHP7 and EE5. This error is being thrown when using sort, specifically line 1385

usort($this->categories, create_function('$a,$b','return strnatcasecmp($a["'.$col_name.'"],$b["'.$col_name.'"]);'));

I tried manually changing it as per search results directed but everything I tried just spat out more errors. ie.

usort($this->categories, function($a, $b){'return strnatcasecmp($a["'.$col_name.'"],$b["'.$col_name.'"])';});

Any suggestions greatly appreciated :)

t1mwillis commented 4 years ago

@StuartMcD can you check the recently merged PR?

t1mwillis commented 4 years ago

Is this resolves your issue, please close 😄

StuartMcD commented 4 years ago

Perfect, thx.