Closed (fixed)
Project:
File Entity (fieldable files)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
6 Jan 2013 at 11:14 UTC
Updated:
21 Apr 2015 at 16:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
roysegall commentedComment #2
ParisLiakos commentedTypos
Comment #3
roysegall commentedComment #4
devin carlson commented#3 looks good but it seems like it is hardcoded to either public or private stream wrappers?
I'd suggest using file_get_stream_wrappers() to enable filtering by other schemes like those provided by projects such as Remote stream wrapper and AmazonS3.
Comment #5
roysegall commentedNot stream wrappers - Schema type. As far as i know, in drupal there is two types of file schema: public and private.
Comment #6
dave reidThe schema type of the file is the stream wrapper used, so Devin is correct this needs to support everything in file_get_stream_wrappers() that also has the 'visible' flag. There should be an file entity API function that can already be used to get the visible stream wrappers.
Comment #7
roysegall commentedComment #8
agoradesign commentedThere's a typo in the filename and also in the class name: views_handler_filter_scehma_type.inc (scehma)
Comment #9
agoradesign commentedI've tried out this filter. It basically works, but lacks of some basic configuration options:
There is no operator to choose. At least the possibility to reverse the filter in order to exclude a specific scheme would be nice. Now, if you have a couple of filters and want to exclude only one of them, you would have to insert multiple schema filters for all the remaining schemas in an Views filter group with an OR condition - at least theoratically. Because that didn't work for me and resulted in an empty search result.
I ended up in removing this filter and using a filter on the file's path with the condition set, that the path should not start with "private://" and it worked better for me
Comment #10
roysegall commentedRe rolling and fix typos.
Comment #11
aaron commentedThis is a good start. However we need to address the concerns about the operator's in #9. Additionally, it does not work if you expose the filter. Lastly, we need to change the administrative description which currently reads "Filter files by private/public schema." I am not certain offhand what would be better, but an example would be if you are using, for instance, the media youtube module to add a youtube schema. Maybe we can have something like "filter files by their schema, such as private/public." Lastly lastly, I noticed that it allows you to select temporary files and I am not certain if those would be considered visible. And finally (for real), I think it would be better to have checkboxes to allow for multiple selections.
Comment #12
mpetrovic commentedThis filter wasn't working for us either. Here's a new version that's more flexible.
Comment #13
mpetrovic commentedComment #14
mpetrovic commentedMissed a couple things
Comment #16
jorisdejong commentedHi there,
I have recreated MPetrovic's #14 patch against the latest 7.x-2.x branch. Let's see if it gets passed by testbot.
Comment #17
ParisLiakos commentedComment #18
roysegall commentedMinor coding standart:
=> $statements[] = 'uri ' . $nope . 'LIKE \'' . db_like($schema) . '://%\'';
Comment #19
jorisdejong commentedMade this small change in code, including your coding standard fix :)
Comment #20
jorisdejong commentedComment #21
aaron commented19: filter-by-file-schema-type-1881356-19.patch queued for re-testing.
Comment #22
aaron commentedWorks as advertised. Congratulations!
Comment #24
aaron commentedCommitted to http://drupalcode.org/project/file_entity.git/commit/929a939
Comment #26
PascalAnimateur commentedIs the Schema type also exposed as a field, or only as a filter criteria?