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

File filters yield inconsistent results when file_type null #3134

Closed
robinsowell opened this issue Mar 17, 2023 · 2 comments · Fixed by #3418
Closed

File filters yield inconsistent results when file_type null #3134

robinsowell opened this issue Mar 17, 2023 · 2 comments · Fixed by #3418
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@robinsowell
Copy link
Contributor

Had a user with only images allowed in a directory. Had 50 pages of files in the directory. If they filter by 'Image' they had 5 pages of files.

EE 7.2.11

I think the issue is file_type may not have been set- if I do a 'SELECT * FROM exp_files where file_type IS NULL' I get 4000 results. From comments, it's clear that after a migration, it may not have been set at that point. According to them:

The workaround is simply, simply go to column (metadata) and select File type. Once it is done, all the images will be identified as Image file type again.

I'm thinking it's a js thing and the filter didn't have access to the null file types until that happens.

Is a weird one. They can also get a broken language key in the column when file type is empty- just get type_.

@robinsowell robinsowell added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Mar 17, 2023
@intoeetive
Copy link
Contributor

i'm not sure what's the step that they made to get this fixed?

@intoeetive
Copy link
Contributor

@robinsowell how it currently works is that it sets correct File Type when visiting file manager, if it's null (which is the case for all pre-EE7 upgrades). We only load & set the value for files that are on the page though. So if they have 50 pages of files, they'd need to visit all of those to have the File Types set property.

Also we can't just set all file types to Image even if the directory is 'images only' - it might have been allowing other file types previously and as such might contain non-image files uploaded before.

With all that said, I am going to add setting correct file type (when it's null) to Synchronize Upload Directory page. If you still have a place to test this, check the referenced PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
2 participants