The context_flag module exposes flags from the Flag module for use as conditions of the Context module. To date I haven't been able to find any other modules providing this functionality.

I've put together a features module showing a couple simple examples on github: context_flag_examples.

Project page: https://drupal.org/sandbox/mraichelson/2047083

Git repository: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/mraichelson/2047083.git context_flag

Projects reviewed:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxmraichelson2047083git

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.

mraichelson’s picture

The issues flagged by the PA review script are really issues with the coding style of the Context module (which this module just adds plugins for). This can be seen by reviewing the codebase for Context itself and looking at the notes for the standard context condition plugin files (context_condition_book.inc makes for a good example).

mraichelson’s picture

Issue summary: View changes

Updated reviewed project list.

mraichelson’s picture

Issue summary: View changes
Status: Needs work » Needs review

Updated list of reviewed modules.

mraichelson’s picture

Issue summary: View changes

Updated reviewed projects list.

mraichelson’s picture

Issue summary: View changes

Updated reviewed projects list.

mraichelson’s picture

Issue summary: View changes

Updated reviewed projects list.

mraichelson’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus

Updated reviewed projects list.

mraichelson’s picture

Issue tags: -PAreview: review bonus

(Since most of the reviews I provided weren't particularly deep don't feel like I've earned a reviewer bonus.)

mraichelson’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus

Updated reviewed projects list.

nonsie’s picture

Status: Needs review » Needs work

Requirements - Flag 2.x branch or 3.x branch? Both are supported.
Info file - no need for double quotes around the name and description (see https://drupal.org/node/542202)
No hook_help() in .module file.

In your readme file perhaps clarify user account vs active user since node flags can apply to anonymous users as well.
Any planned support for other types of flags (comments, terms etc)?

mraichelson’s picture

Status: Needs work » Needs review
FileSize
168.27 KB

Pushed a new update up to the 7.x-1.x branch.

  • Updated dependency in .info file and notes in README.txt file to specify that this is only compatible with Flag 3.x for the moment.
  • Removed quotes from .info file
  • Added hook_help() to explain the context conditions provided by this module with a brief description of why/when they would be triggered.
  • Added note in hook_help() and README file about applying conditions to anonymous users (this can be done with default context conditions and doesn't actually need this module to do so).

I did look at adding support for comments and other entity types, comments are a possibility for something that can be added. Adding a generic "show all entity types" option was a little more than I wanted to bite off for an initial release (and may be better suited as a submodule of some sort or by providing some stub/example code for making a new set of flag condition triggers that a machine name can be dropped into).

The PAReview items that are present following this update are the same as before (see comment #2), a side effect of the structure from the main Context module.

nonsie’s picture

Status: Needs review » Reviewed & tested by the community
mpdonadio’s picture

Status: Reviewed & tested by the community » Needs work

Manual Review.

1. context_flag_context_registry() has untranslated titles.

2. _context_flag_requireall_form() should have a proper docblock.

Looks like a useful module, and project page looks good. I'll mark as RBTC once the titles are fixed.

mraichelson’s picture

  • Titles in context_flag_context_registry() are now wrapped with t().
  • Docblock added for _context_flag_requireall_form().
  • Made adjustments for a logic error when using a context with "require all flags" applied to it.
mraichelson’s picture

Status: Needs work » Needs review
mpdonadio’s picture

Status: Needs review » Reviewed & tested by the community

I agree that PAReview issues in the Context plugins can be ignored.

Manual Review.

Do classes loaded via plugins still need to be declared in the files[] section in the .info? I don't really know this answer, but you may want to check into it.

Project page looks good. Not seeing any security issues, duplicate projects, third-party-code, or major API problems, so I think this is RBTC.

mraichelson’s picture

Re: files listings in the .info file - Looks like the answer is "no", I'll push another update to clean them out.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

Review of the 7.x-1.x branch:

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: /home/klausi/pareview_temp/context_flag.module
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     96 | ERROR | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  • context_flag_condition.node.inc: This is hard to read, please use proper doc blocks to separate the functions. See https://drupal.org/node/1354#functions . Also elsewhere, makes it a bit look like spaghetti code.

But otherwise looks good to me, so ...

Thanks for your contribution, mraichelson!

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.

mraichelson’s picture

Woohoo! Thanks, klausi!

Excess whitespace was in part of a comment block, cleaned it up after you posted this.

Will make another run through the condition plugin .inc files to clean up the commenting and make them more legible.

joachim’s picture

Oh nice, I didn't know about this!

Be sure to add your module to the list of Flag ecosystem modules in the docs pages.
(And please look at #1323826: Make it easier to identify and discover ecosystem modules too!)

Status: Fixed » Closed (fixed)

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