I don't know if it's a bug or I do bad configuring.
I have "jobseeker profile" content type for content profile with some data as name, birth date, location.
I have "resume" content type, where is node reference field to content profile fields, that obtain data through the views. I also want to display this referring field with node reference views using the same views while creating.
So if I use filter just "user: current", then while displaying the user who see resume node will get data from his profile and not from use who has created profile/resume.
I can't filter by role, as I need that admin user could also see data and some users would have multiple roles.
So I need to define the author of the profile.
I tried to use solution from #335082: where views argument option "User: UID is Author" gone in drupal 6 using argument "User: uid", default "User ID from URL",
but it didn't help to me.
I get "no query is run" in devel and empty result.
I tried another solution:
- Make a new argument, select the 'User: Name' field.
- Under 'Action to take if argument is not present:' select 'Provide default argument'
- Under 'Default argument type:' select 'PHP Code'
- Paste in the code:
$args = drupal_get_title();
return $args;- Leave 'Validator' as it is, at 'Basic Validation'
- Hit 'Update'
It didn't help either.
I tried to play with different relationships and filters, not successful. I can get results for current user, for all users, but not for author.
I attached some screenshots. One of them is settings for argument "User: uid", default "User ID from URL", so when I check "User ID from URL" there is a box "Default argument" that appears. Maybe I don't understand but it seems to me strange as if user ID is from URL it's already default value, then there is another for it.
Comments
Comment #1
dawehnerConceptual it's right to use an argument here together with "provide default argument".
This is the most important part here: You have a content type "resume" with node reference fields to "the author"(the content profile)
Then you want to show some parts of the "resume" content type on the profile/content-profile page, right?
So you want to add a argument user: uid and use "provide default argument" user: uid from url
Some steps to do it:
* Add something into the "default argument" textfield. This looks like a bug here, just do it :)
* Add a "relationship" to the content profile.
* Select this relationship in your argument.
* Add a "relationship" to the "resume" content type node reference field(and select the previous relationship there). => Now you get every node which refers to a content profile from the uid from the argument.
* Now add the fields and select the last relationship in the fields.
I think that should be it.
Comment #2
esmerel commentedComment #3
clashar commenteddereine, thank you for this quick reply.
Yes "resume" has node reference fields to "the author"(the content profile).
Actually I want to show contrarily, content from "jobseeker profile" content profile on "resume" page. So that when user register, he should not to retype again his name, location, etc.
So I created relationships
1) content - node reference field of "resume", that is referring to "jobseeker profile"
2) node: content profile
I tried relationships as you said and dependencies contrarily, please see screenshots, but no success again.
I tried to enter in "default argument" textfield value "0". Changing again both relationships in argument.
The same empty result, "No query was run."
Is it ok, what I did?
Problem seems to be with argument, as if with some settings I enter "1" in preview "Arguments" field, then I get results for user 1 - admin.
Comment #4
clashar commentedesmerel, I would like very much to see this fixed, but it's not yet ))
Comment #5
dawehnerThe key of an issue is to describe the problem itself :)
I guess http://drupal.org/project/reverse_node_reference can help you.
Comment #6
clashar commentedSorry, seems I have problems with explaining people my thoughts ))
I have seen this module, but I didn't think it could help somehow.
I mean that actually the author of "profile" is the same of "resume", so not sure if the reversed relationship would help.
Anyway I wanted to try and install but get this message "Your MySQL Server is too old (5.0.91). The Reverse Node Reference module requires at least MySQL 5.1.".
I will speak with hosting provider, but not sure when they would upgrade as I have normal shared hosting.
So to filter the author even of "resum"e it is not possible to solve my issue without this module?
Comment #7
clashar commentedidea, actually I could also try to use some old version of this module...
added later:
strange, but no other versions are available except the one I used of 16 july 2010
Comment #8
clashar commenteddereine,
my hoster was very kind to update MySQL to 5.1
So, I've installed reverse Node Reference an got new relationship:
Content reverse references: Data from profile (field_cv_from_profile) - reverse reference
Node reference (reverse reference) - Appears in: Resume
After creating I tried to use it in argument and fields, trying to do dependencies with other relationships, but with no success again. I am still doing smth wrong.
Could you please say what should be my settings with Reverse Node Reference now?
Comment #9
clashar commentedI want to precise that I don't use paths in views, so no % there, don't know if it could be related.
Comment #10
clashar commentedI am stupid, as I have no uid in path on node creation page. Seems that it's not possible with pathauto before node is saved, but I need to run view at that time. So still no solution is found for me.
I am just wondering why Views just don't have as in Drupal 5, smth like Node's Author.
Profile page has actually uid, but not sure if it could be taken in views from other node creation page, even with relationship, as profile page URL is just not active.
Comment #11
iamjon commentedclashar
I spoke to merlinofchaos about this, and I'm afraid we are not entirely sure what is wrong and how to help. Please see the submission guidelines for the types of information and structure that can help us reproduce the issue or explain it.
http://drupal.org/node/571990
Comment #12
iamjon commentedchanging status
Comment #13
merlinofchaos commentedIt does. It's user: uid or user: name
Comment #14
merlinofchaos commentedLet's go back a bit.
I've reread the original post a couple of times and I need a few questions answered:
1) What display type is this? Is it a block?
2) If it's a block, where are you trying to display it? Everywhere? Just the user's profile page?
3) Please clarify the exact content types you have and the fields supplying references to other content types. For example, if you have a 'jobseeker profile' and it's a content profile node, that means the 'author' of the node, i.e, the user: id, links directly to the user account? How does the resume link? Does it link to the user or the jobseeker profile? And is the uid of the resume different?
Please mark this issue active when the questions are answered.
Comment #15
iamjon commentedClosing from a lack of activity.