I would like to create a block on my site similar to the maintainers block on each Drupal.org project page. I reviewed the documentation but did not see a way of doing this without modification. I made a slight change to project.views.inc and added hook_views_data() implementation to expose a relationship between project nodes and maintainer user entities.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mattreba’s picture

dww’s picture

Status: Active » Needs review

Currently, that maintainers block on d.o is from versioncontrol_project. See #1007102: [META] Port versioncontrol_project to D7 for progress on that, although you probably don't want/need a dependency on VCAPI for your site.

So yes, I think it'd be a lovely thing to expose this to views so folks could make their own block without VCAPI.

In fact, I'd be happy to have a default view that provides a simple maintainers block that sites could enable if they wanted. So, once you get your view working, please export it and post it as a patch here, too. ;)

Do we want/need to expose more fields for this? E.g. what permissions each maintainer has?

Related (but not a dup nor a blocker): #1090056: Show a version of the maintainers tab for all (auth?) users

Thanks!
-Derek

mattreba’s picture

Thanks for the response. I had guessed it might be in versioncontrol_project since it had number of commits. I was thinking about the same thing last night after I posted this. A user might want to sort based on permissions or add icons to differentiate the primary owner(s) from other maintainers. I'll post up another patch later today.

I'm having good luck with the project and project_issue so far on my D7 site. Thanks for all the hard work.

mattreba’s picture

Added update_project and administer_maintainers fields. Added default_view for project_maintainers.

I must admit the views API is a bit new to me. I joined project_maintainer to the node view which has the side affect of having these two new fields show up as available fields in any node view. If you have suggestions on a better way to make this information available without mucking about in the node view please let me know.

mattreba’s picture

Issue summary: View changes

Fixed typo in hook name

drumm’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)