Closed (won't fix)
Project:
FileField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2009 at 06:59 UTC
Updated:
21 Aug 2015 at 15:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
merlinofchaos commentedComment #2
quicksketchHm, this isn't a use-case I'd though of. There currently isn't a "has file" filter, because you can accomplish the same thing with a relationship. However there isn't a way to expose such a setting to show only nodes that don't have files. This was marked won't fix in several issues I believe. See #317784: filter by imagefield with views 6.x? for some brief instructions on setting up a relationship to do this.
So I'll mark this as a feature request since it's a valid request to have this as a filter so that you can expose it.
Comment #3
Heilong commentedYes, I saw that post on how to set up a relationship.
But it wasn't what I needed, actually for this feature it could be something like a filter which show the user "with pictures" or "without pictures" to test if the default Imagefield Image is present.
Comment #4
giorgio79 commented+1
I am unable to accomplish this with a relationship on the file table, as even though there are filters like file id, file size, file status etc. none of them can show me nodes that even if they have imagefield no files were uploaded...
I tried playing around with filters like File ID but it is just a text field, which expects the id. Also setting the File Size filter to IS NULL does not show nodes without imagefiles uploaded.
There was this #554292: Filefield filter in view : can't get "is null" operator but it seems the original purpose got lost somewhere along the way. :)
Comment #5
quicksketchPer #950000: Views Sort Criteria "image uploaded: YES/NO", this should also include the functionality to sort in addition to filter.
Comment #6
YK85 commentedHi, I'm coming from #950000. It would be great to be able to add sort criteria as well. This would allow nodes with pictures to be sorted to the top of the views query (aka in my case users with content profiles with pictures are higher up the search). I hope this may be added to the module in the near future to allow maximum flexibility in its usage.
Many thanks!
Comment #7
quicksketchI should note that you can basically already sort by sorting on the File: FID column, though you'll still end up with NULL records at the bottom I believe. It'll also end up with newer user pictures showing up at the top, but perhaps that's also okay. This new approach would likely just be a short-cut and a more balanced approach.
Comment #8
ron williams commentedI needed to present content with images at the top, while randomly sorting once the content without images was pushed to the bottom. I used a relationship for the field, then used File: Status as a sort criteria. This allowed me to still use Global: Random.
Comment #9
YK85 commentedWhat relationship do you add to the field? Seems like a long workaround and might conflict with other sorts?
Also it doesn't solve the filter to only show "has file" nodes. Changing setting back to active to remain as a feature request.
Please let me know if this should remain as fixed. Thank you!
Comment #10
ron williams commentedYou add the fields relationship to the view, then sort using file: status. Also it does solve the issue with "has file" filtering as you can "require this relationship" and that will only show nodes which have a file.
Comment #11
YK85 commentedWhat about only showing nodes without a file?
Comment #12
quicksketchThis issue should remain open. We need a dedicated filter to:
A) Show nodes that don't have a file uploaded.
B) Expose the filter to the end-user.
Comment #13
geerlingguy commentedComing from #372241: Make a "has file" Views Filter. This is an essential feature for a few of my views, and it would be so nice to have a built-in filter for it.
Comment #14
l0calh0rst commentedI was lucky someone pointed me to the solution. At least it solved the sorting problem, not the exposure. http://drupal.org/node/981710#comment-3812512
Comment #15
markchitty commentedsubscribing
Comment #16
jamesclarke commentedTrying to sort by FID, as suggested previously, didn't work for me. I was able to get it to work with file status though.
Comment #17
joachim commentedHere's a patch which allows an exposed filter for whether there is a file present or not.
Comment #18
quicksketchSuper, thanks @joachim! I still run into this problem all the time.
Comment #19
chinita7 commentedI patched #17 but can't find out how it works. After patching it now I have a new filter for "fid" with the option of "true" and "false".Even if I set it "false" it displays the nodes that have files... How can I get it work?
I'm using it for file field of content profile type node.
Comment #20
Marko B commentedhttp://drupal.org/node/1438712 some solutions without patch.
Comment #21
joachim commented@#19: That's weird. I've just checked on the site where I'm running this patch and it works perfectly for me.
I have: latest Drupal core, latest fieldfield, and latest Views 2.x. Are on Views 3.x by any chance?
Comment #22
chinita7 commented@joachim I use Drupal 6.22 Views 6.x-3.0-rc2 Filfile 6.x-3.10 That might be because of the Views virsion.. I now use the solution mentioned in #20 by @DeepM and it works for me.
Comment #23
pwolanin commentedbug fixes only now