attachments icon indicating copy to clipboard operation
attachments copied to clipboard

Fix deleting media error

Open m-hefti opened this issue 3 years ago • 3 comments

While deleting a media, you might get an error about classes/class.attachments.search.php:64 count() expecting an array and getting a null value. The $params['fields'] var might be an array or a null value (by default). If null, the count() function in the for loop (line 65) returns an error. Adding the if statement (line 64) resolves the problem.

m-hefti avatar Apr 03 '22 12:04 m-hefti

Thanks for the correction, it's greatly appreciated.

didwedo avatar Apr 27 '22 12:04 didwedo

This should be merged. This fatal error happens on PHP version 8.0 and up.

As PHP 7.4 security updates stop in 6 days (28 Nov 2022), and many hosting providers have already moved sites to use PHP 8 it would be of utmost priority to publish a new version of this plugin to the WP plugin directory with this fix included.

This pull request fixes #193

angryaxi avatar Nov 22 '22 12:11 angryaxi