Skip to content
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

Media Library Filter does not work in combination with file type #670

Closed
4 tasks
markonikolic985 opened this issue May 24, 2022 · 1 comment · Fixed by #716
Closed
4 tasks

Media Library Filter does not work in combination with file type #670

markonikolic985 opened this issue May 24, 2022 · 1 comment · Fixed by #716
Assignees
Labels
effort [XS] < 1 day of estimated development time priority: low Issues that can wait type: bug
Milestone

Comments

@markonikolic985
Copy link
Contributor

When on Media Library (List VIew), there is possibility to filter files by type, date and optimization status (this one is coming from Imagify).

However, if you choose specific file type (images, documents...) and specific optimization status, the filter will not work - all file types are still displayed.

This works with date filter, but not with file type filter.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Media Library
  2. Choose List View
  3. Choose Documents or Images from the first filter
  4. Choose Optimized/Unoptimized/Errors from the third filter
  5. Still all file types will show up
  6. If you change only one filter, it will work

Screenshots
Screenshot 2022-05-24 at 13 46 54

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@CrochetFeve0251
Copy link
Contributor

Reproduce the problem

I was able to reproduce the issue.

Identify the root cause

The root cause is due to the fact we are overriding post_mime_type on the query even when it is already set.

Scope a solution

To fix this issue we need to replace that code:

	$vars['post_mime_type'] = imagify_get_mime_types();

with that one :

    if(! key_exists('post_mime_type', $vars)) {
        $vars['post_mime_type'] = imagify_get_mime_types();
    }

On line 126 from inc/admin/upload.php.

Estimate the effort

Effort XS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort [XS] < 1 day of estimated development time priority: low Issues that can wait type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants