This module creates a block, which displays a list of links to admin tasks for an OG group, for an OG group administrator. The OG context must be set to the group you want the links to relate to on the page(s) the block is displayed.

More information on the project page:
https://drupal.org/sandbox/__cj/1926754

git clone --branch 7.x-1.x http://git.drupal.org:/sandbox/__cj/1926754.git og_admin_block

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robin.ingelbrecht’s picture

Hi __cj ,

Pareview shows some errors in your code:
http://pareview.sh/pareview/httpgitdrupalorgsandboxcj1926754git

- You should delete your master branche
- Add a README file
- Apply all coding standards.

ydahi’s picture

Would like to take a moment to promote this project - very useful and works like a charm!

__cj’s picture

Thanks Robin - I've done these bits.

Thanks ydahi, for the review, and for adding the issues.

EDIT:
Add links to issues ydahi added

__cj’s picture

Status: Needs work » Needs review
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

dimduj’s picture

Hi __cj,

Here are some observations on your module (this is part of the review bonus workflow ;) ).

1
--
You should remove your username (prefix) from your git clone instruction:

git clone --branch 7.x-1.x http://git.drupal.org:/sandbox/__cj/1926754.git og_admin_block

2
--
You use some variable in your code but there is no admin to define theme:
variable_get('og_admin_block_exclude_' . $node_type, 0);

You should also clean your variable in a hook_uninstall

3
--
Your caching strategy for your block is quite heavy. the granularity is in fact not per role per page but per role per og_context right ?
Maybe you should consider using a DRUPAL_CACHE_CUSTOM and implement the caching mechanism in your
in your hook_block_view() ?

Useful module BTW, this definitively lack on og module ... (maybe you should try to merge your code in the existing OG module ?)

Regards,

Dimitri

__cj’s picture

Issue summary: View changes
__cj’s picture

Hi Dimitri,

Thanks for the in depth review.

1 - Sorted.
2 - Uninstall hook added.
3 - Good spot! I've done as you suggested and am using DRUPAL_CACHE_CUSTOM, and caching per user og role(s), per og context.

Chris.

johnennew’s picture

The API file, the document above each hook should describe the hook, not just say Implements hook!

Otherwise, great module - you are my hero.

Angry Dan’s picture

Status: Needs review » Needs work

Hi Chris,

variable_get('og_admin_block_exclude_' . $node_type, 0)

I'd suggest renaming this variable to og_admin_block_include_…. It'll help you avoid double negatives

 // Check we're on a group page.
  $context = og_context();
  if (empty($context)) {
    return NULL;
  }

Comments like this are often superfluous.

'#href' => 'node/' . $group->nid . '/edit',

This module appears to be tied to nodes; it's not compatible with OG's wider entity support. That's probably fine because most people don't use OG for anything other than nodes, but you might want to note it on the project page. I don't think you have a bug with this because I'm pretty sure that og_context() only returns if the current group is a node.

global $user;

You should always declare globals at the top of a function body.

Nice module!

__cj’s picture

Thanks ceng - I've added the document comment in the api file.

Thanks Angry Dan I've changed the variable to include as suggested, updated the module page, and moved global $user to the top of the function.

I think that gives me the required number of reviews - thanks everyone!

Chris.

johnennew’s picture

Status: Needs work » Reviewed & tested by the community

I personally feel this is good to go now.

er.pushpinderrana’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
5.59 KB
7.11 KB
9.9 KB

@__cj, thankyou for this nice module.

I have use OG module in number of my projects and its flow is little bit complex but your module gives a block that helpful for admin users to play with OG from one place.

Automated Review

Best practice issues identified by pareview.sh / drupalcs / coder. One minor issue found.

FILE: /var/www/drupal-7-pareview/pareview_temp/og_admin_block.api.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
11 | ERROR | Missing parameter type
--------------------------------------------------------------------------------

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and fragmentation. OG is already a complex module and include all these features that are included in this module. But this module is much useful for admin users who quickly want easy access to the OG links. As I have tested this module functionality and googled not found similar one :)
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
  1. (+) Initially When there is no content type is associated with Group content, it produces following notices on every page that need to be fix.

    Notices
  2. (*) After this I added Article and Test New Content Type(newly created content type) with one of OG group, that hides above notices and block appears like this.

    Block Appear

    Now I renamed Test New Content Type with Rename New OG Content Type as shown below.

    Renamed OG Content Type

    And again check the OG Admin block but it still appears the same.

    Block Appear

    Rename Content type is not updated here still previous label is coming that looks wired and need to be fix.

  3. hook_help() is missing in your module.
  4. (+) og_admin_block_block_view($delta): In this function at number of places, you have concatenate strings. Better to use t() for these and for anchor link, use l().

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)

Thanks Again!

__cj’s picture

Status: Needs work » Needs review

Thanks er.pushpinderrana.

I've updated the coding standards

Coding style & Drupal API usage

  1. Thanks - I've fixed this.
  2. The block is cached - if you clear cache you'll see the new name displayed.
  3. Noted.
  4. Thanks, l() / url() isn't needed though as the link is being built with a render array. I've added the missing t().

I think that takes me to 6 reviews! Thanks everyone!

johnennew’s picture

Status: Needs review » Reviewed & tested by the community

I personally feel this is good to go now. I've been using this module for some time now and would like to see it available as a full release!

Angry Dan’s picture

This is also RTBC in my opinion. This is a useful module, and I think it's time to release it to the wider community!

mike.davis’s picture

I've been using this for a while now and it works great. Would be great to get this out as a full release.

johnennew’s picture

The whole world needs a full release of this module!

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

In og_admin_block_form_node_type_form_alter(), shouldn't this variable_get('og_admin_block_include_' . $node_type, 1) have a default of 0 instead since the user hasn't enabled anything when the module is installed? Or is it your intent that content types will show up by default unless disabled?

Checked for security, licensing, Drupal API, duplication, and individual account, no blocking issues found.

Thanks for your contribution, __cj!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.