The module enables you to trigger contexts based on the referer header of the user's request.

  1. It stores an array of referer URLs (depending on the cookie/session life-time there may be more than one) in $_SESSION.
  2. It implements a context condition that allows to specify a list of regular expressions that are then matched against the referer-list in $_SESSION.

Example application:
use ~//www\.facebook\.com~ to trigger a context for all user's entering the site from facebook.

The link to the sandbox: http://drupal.org/sandbox/torotil/1485064

Currently it's a D7-only module. I've found no other module that implements this functionality.

Comments

patrickd’s picture

Status: Active » Needs review

welcome,

Please read about the project application workflow.

while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxtorotil1485064git

You can also get a review bonus and we will come back to your application sooner.

regards

torotil’s picture

The automatically detected issues are fixed as far as it goes:

  • The lower_case class names and method names seem to be standard for ctools.
  • The "* Implements …"-comments seem to be fine instead of what the test says.
  • The "white space in function call …" error is unfounded.
alesr’s picture

Status: Needs review » Needs work
StatusFileSize
new2.21 KB

There are some unknown characters in README.txt file:

Example applications:
* Display larger facebook connect/like buttons if the user entered your site
  by a facebook link.
* Customize your landing-page based on the ad-banner was followed.
* �^��

Still issues from PAReview to solve. Check appended file.
You are missing "." (dot) at the end of Implements

/**
 * Implements hook_init()
 */

should be

/**
 * Implements hook_init().
 */

Also add dots to other comment ending lines.

torotil’s picture

Thanks for pointing me at the dots in the Implements comments. I've fixed them now and also the @file comments.

The invalid character that you've mentioned is simply "…" which is a valid utf-8 character. I've replaced it with "..." which should work around your problems.
When will we finally overcome ASCII?!

This leaves only:

  • "space in function call" which seems to be bogus as stated above
  • the wrongly formatted class and method names imposed by ctools
torotil’s picture

Status: Needs work » Needs review
ClaudeSchlesser’s picture

StatusFileSize
new1.4 KB

Hello,

phpcs found a few errors (please have a look at the attached file).

After having installed the module I saw "Requires: Context (missing)"
You should include a link to this module in your README.TXT
This simplifies the setup for user (like me) that don't have the context module yet.

Regards,

ClaudeSchlesser’s picture

Status: Needs review » Needs work
patrickd’s picture

Don't set needs work on minor issues

// never mind :)

ClaudeSchlesser’s picture

Status: Needs work » Needs review

Sorry, this is was my first review ;)

torotil’s picture

Priority: Normal » Major

setting to major according to the review process timeline.

torotil’s picture

Priority: Major » Critical

has been "needs review" for 4 weeks -> critical

klausi’s picture

Category: feature » task
Priority: Critical » Normal
Status: Needs review » Reviewed & tested by the community

Sorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.

manual review:

  1. lease take a moment to make your project page follow tips for a great project page. Not everybody knows what "context" is.
  2. referer_context_init(): this will be executed on every single page request, are you sure that you need that? Why can't you determine the referrer in the execute method of your plugin where it is actually needed?
  3. referrer_context_init(): how are the referrers removed from the session? It looks like you are collecting referrer forever without deleting them.

But that are just minor issues, otherwise I think this is RTBC.

torotil’s picture

Thanks for your review.

As a full-time drupal-dev I simply haven't had the time to make reviews during the last few months - sorry for that.

ad 1. I've already added a link to the context module in the online project description and will take look at the linked article before I make this a full drupal project.
ad 2. I'll look into that.
ad 3. they aren't the number of referers usually is rather low during the lifetime of a drupal-session.

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

Please really add some more information like installation and usage instructions to your project page, nobody (I know) would ever read a readme for usage instructions.

Thanks for your contribution and welcome to the community of project contributors on drupal.org!! :)

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

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.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

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

nally’s picture

Congrats torotil !

Did this ever get moved over to a bona fide project? It seems like a pretty interesting "missing link" to me.

nally’s picture

Issue summary: View changes

added a comment about other modules implementing this functionality