Posted by bg1 on March 1, 2010 at 8:29pm
4 followers
| Project: | NodeReferrer |
| Version: | 6.x-1.0-rc1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I have 2 Content Types A and B.
B has a CCK field with multiple values of type Node Reference of A.nid.
I then have a View retrieving data from A, whereby one column is node referrer of type B.
I get the list (comma delimited) of all the Bs that refer to each instance of A file, but I can't sort it.
I then added a CCK field in A of type node referrer to B based on the node reference field. This works find in the node returning all the Bs that reference that A, and they are sorted by Title which is what I want. However, I don't seem to be able to select that field to display in a View.
Any suggestions?
Comments
#1
Some additional information to this issue.
I was thinking that I might be able to substitute a query I have written for the one generated by the view, but then I found that the query that is generated (or displayed as the generated query in Views) does not include any reference to the nodereferrer column.
The issue then is "where do the nodereferrer values get put in?"
I posted an issue in the Views Project, but I am retty sure they are going to refer me to the nodereferrer project.
If I replace the View Query with my custom query and they do not have the same columns, what will happen? (The primary purpose of my query is that I want to sort the nodereferrers - my query does this via a subquery and returns the results to match the views display columns. In other words, my query delivers exactly the data that I want the view to display - plus the node IDs that would be used for node hyperlinks.)
Why doesn't the query displayed in the view deliver the results one sees in the preview?
Is this because another module is involved?
If it is the latter, is there some place where can I see the logic that is delivering the nodereferrer results?
Please response in detail as I am a drupal newbie. In addition, while I am a database SQL programmer and a Microsoft.Net programmer and can generally follow most of the raw code syntax in PHP, I have no experience with the general concept, structure or libraries of PHP nor developing in a PHP environment.)
Thanks.
#2
Attached is a patch that duplicates nodereferrer's sort functionality from its node field to its view field. It adds a new setting on the view field for "sort order" with the same four sorting options (chronological, reverse chronological, title, reverse title). The nodereferrer list will then be sorted by your selection for this setting.
#3
Thanks. I have never applied a patch to a Drupal module before. Is it simply a metter over copying the files into the respective module folder?
#4
I patched against nodereferrer-6.x-1.0-rc2 with success.
I had to apply the patch from outside the nodereferrer directory :
patch -p0 < nodereferrer/nodereferrer-6.x-1.0-rc1-views-sort-order_0.patchAnyway the patch worked correctly for me (trying to sort with reverse title)
Thanks @richardwdoe for the patch
#5
patch in #2 worked perfectly for me. thanks @richardwdoe