It looks like if you have a view of users you can get his terms with the relationship provided by Private Taxonomy, but if you have a view of taxonomy terms there isn't a relationship to get the terms' owner information.
This patch provides the relationship I need. I'm not sure what the help text should be since this patch gives $data['user_term']['uid'] both a filter and a relationship.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | private_taxonomy-views-relationship-2922230-8.patch | 1.61 KB | jacob.embree |
| #9 | views-relationship-2922230-9.patch | 1.57 KB | trobey |
| #4 | Screenshot from 2018-12-08 12-18-04.png | 122.83 KB | trobey |
Comments
Comment #2
jacob.embree commentedComment #3
jacob.embree commentedComment #4
trobey commentedI created a view of taxonomy terms. Then I click on add a relationship and there is Private Taxonomy term: Content owner (see attached file). What am I missing?
Comment #5
jacob.embree commentedI'm not sure what that relationship provides. I don't have access to user fields without the above patch.
Comment #6
jacob.embree commentedTry to add the username of the term owner to a view of taxonomy terms. Make sure to clear the Views cache between using and not using the patch.
Comment #7
trobey commentedI tried adding the existing content owner relationship and you are right that the user fields do not show up under the fields. I cannot find any documentation on why these fields do not appear. Your patch does seem to allow the user fields to show up but the relationship is titled as "Current User." This does not appear to be correct as it actually is the owner of the term from my quick tests. So we need something that is labeled correctly. I think it would be best to fix the current relationship rather than create a new one or something in-between the two.
Comment #8
jacob.embree commented$data['user_term']['tid']provides us with a relationship to the {taxonomy_term_data} table when we already have the {users} table. "tid" is the field, so "Content owner" is the wrong label. If you already have the owner and want a relationship to the user's terms you can do that through "tid", so I renamed it "User's terms".$data['user_term']['uid']provides us with a relationship to the {users} table when we already have the {taxonomy_term_data} table. The filter uses the "views_handler_filter_user_current" handler, so that's why it was labeled "Current user". The filter, argument, relationship, etc. can have different help text, so I added some to distinguish them. The relationship I added and the existing argument use the uid of the row in the database, not the current user, so they should not have "Current user" in their text.Comment #9
trobey commentedThe posted patch does not seem to have any changes. But the description is helpful and I tried updating the patch to incorporate it.
Comment #10
jacob.embree commentedSo sorry. This is the patch I meant to post. I think I like yours better overall, so I'm marking yours "Reviewed and tested by the community".
Comment #12
trobey commented