Skip to content

Fix deleting media error #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

m-hefti
Copy link

@m-hefti m-hefti commented Apr 3, 2022

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.

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.
@didwedo
Copy link

didwedo commented Apr 27, 2022

Thanks for the correction, it's greatly appreciated.

@angryaxi
Copy link

angryaxi commented Nov 22, 2022

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

@stevensjn
Copy link

Would love to help keep this plugin alive here, and on wordpress.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants