No matter how I sort my book nodes (book weight, title etc.), multiple instances of the same node appear if files happen to be attached.
If one node has 5 attached files, 5 instances are displayed in the custom Views page.
I am using the basic upload module, NOT Filemanager.
Is there a patch to prevent the same node to be displayed twice or more?
Comments
Comment #1
merlinofchaos commentedHave you tried the distinct filter? Are you showing fields or filters from the files table?
Comment #2
marcoBauli commentedAlso, with what attachment module did this happen exactly? (upload, upload_image, image_attach, imagefield,...)
I encountered the same problem listing CCK nodes with multiple images attached to them with imagefield.module (filed a related issue on that mod's project page here on #3)
Comment #3
mediameriquat commentedOK, this time I tried with a more complex post:
First, I publish an image type node (I have the Image module installed, I guess it is the upload_image ??) and it generates a thumbnail, so that 2 files are "attached" to the node.
Then I enter some description text and attach a PDF file to the node, using the basic upload module (the one that comes with the core installation).
Total = 3 files attached, and 3 instances of the same node are listed in the page generated by the Views module. This looks like a bug.
I did not specify anything re: files and filters.
Comment #4
mediameriquat commentedSorry, I actually have one filter that shows all children of a specific book page.
The fields displayed are Node:Title, Node:Body, and File:Name (if any).
Nodes are sorted by Node title.
IMPORTANT: if I suppress the File:Name field, I don't have this problem anymore. So for now I'll just find another way of letting users know there are some files attached (Hey dude, 3 files to download here! in the first line of body text.)
I've been using the SPIP engine a few times, and I took for granted the fact that a same node won't be displayed twice. They might have some interesting PHP code over there.
Comment #5
xamox commentedI am having the same problem, whether I am using list view or table view.
Comment #6
eaton commentedAt present, the 'file name' field isn't able to collapse ALL the files on a node into a single entry. Because of that, adding the 'file: name' field will cause an entry for EACH file. If it's more important to have one line item ofr each node, add the 'distinct' filter.
Comment #7
xamox commentedI am not even using the file name field. I am using the "node:Author Name" field with "node:distinct" as a filter and yet I am still getting it displaying multiples. What it displays is this:
admin
admin
admin
admin
xamox
admin
I am logged in as admin, and xamox is a standard user on the install. Not quite sure why this is happening. Doesn't matter for what node type I add either still displaying multiples.
Comment #8
m3avrck commentedI'm encountering this same issue but with multiple node references.
I've created a view that has shows a list of nodes, each of these nodes has *multiple* nodereferences. For each node reference the item shows up in the view, with each item showing only *1* reference. It'll show each item, with each nodereference.
So if I have a node with node references A, B, C and I want to show a view of all nodes, in my view, it's going to list my node with A, same node with B, and same node with C.
It does not seem to just show the node with A, B, and C
Sounds like the same problem as files.
Comment #9
m3avrck commentedAlso, as mentioned, if I turn off my nodereference field as a displayed field, only one node shows up, as it should.
Sounds like the query logic that builds the list of nodes with references is wrong... it shows each node with each reference (or file), instead of, in these cases, looping through the node and all of it's references and aggregating them together.
Comment #10
xamox commentedYeah mine fuctions the same way(multiples of nodes), only when I use node references such as "Node:Title", "Node:Type", etc. But if I used something else it displays how it should
Comment #11
merlinofchaos commentedYup. This is an issue with SQL more than it is with Views.
Let's say I have two tables.
NODE
nid title
1 'Hello there, here are some files for you'
FILES
nid file
1 'foo.zip'
1 'bar.zip'
Because Views wants to get every node in a single record, it uses your basic JOIN, which WILL result in:
1 'Hello...' 'foo.zip'
1 'Hello...' 'bar.zip'
With the current setup, that's what you can get. Possibly I can add an 'all files' field like the taxonomy: all terms. Not sure. That creates an extra query per record.
Comment #12
m3avrck commentedHmmm, in terms of performance, this would only affect people showing listing of files. Seems to me that an extra query would be worth the hit, consolidating the view so it makes more sense.
Comment #13
merlinofchaos commentedWant to write a patch? =)
Comment #14
m3avrck commented*runs*
Not familar enough with Views to do that--yet. I wouldn't hold your breath waiting on me though :-p
Comment #15
xamox commentedSorry, my above statement was wrong. I didn't really understand how to use views when I first started using it and this is no longer a problem for me.
Comment #16
merlinofchaos commentedm3avrck: Here's a start
'all_files' => array(
'name' => t('File: All Attached Files'),
'notafield' => true,
'handler' => 'views_handler_file_all_files',
'sortable' => false,
'help' => t('Display all attached files as one field),
),
Then the above handler runs a query to determine the files that are attached. See, easy!
Comment #17
merlinofchaos commentedThis feature will appear in Views 1.1
Comment #18
(not verified) commentedComment #19
joeshirley@drupal.org commentedI have a standard list view with half a dozen filters. One is Taxonomy: Vocabulary Name. When I choose operator "Is One Of" and select multiple vocabularies, my list view displays multiple nodes - as many multiples as the node has vocabulary terms. Example: if three vocabularies are chosen in the filter, a node with terms in all three vocabularies will display three times while a node with only two terms selected will show up only twice. (Fortunately, for now I am able to set up my vocabularies so that I can choose just one for my filter and get the results I'm after.)
I have no coding experience, so will not be able to help troubleshoot and fix. But thought you should hear about it.
Here's the export:
By the way, I absolutely love the module - am using it for the first time.
Comment #20
joeshirley@drupal.org commentedOne more note: I did try the Node: Distinct filter to no avail.
Comment #21
merlinofchaos commentedPlease don't take over semi-related issues. This one was about files, yours is about taxonomy. The behavior is similar but this is a different issue.
Comment #22
joeshirley commentedMy apologies. This is my first attempt submitting bug reports etc, so would like to try to contribute. Thanks for your input. Should I submit a new issue?
Comment #23
merlinofchaos commentedYes, please do so. The issue is valid, I think, though may be somewhat difficult to fix properly.