I found that by simply changing the .info file this module seemed to work for D7. Enclosed is the patch.

Comments

ngmaloney’s picture

Status: Active » Needs work

I stand corrected. That patch does not work (when saving context). Working on another.

ngmaloney’s picture

Status: Needs work » Needs review
StatusFileSize
new27.67 KB

Attached is a working D7 port. I basically copied the new D7 context_reaction_block.inc from context over to this module and refactored the code that checks path and role.

kevinwal’s picture

Thanks ng, reviewing and testing patch.

ngmaloney’s picture

I found another bug with my D7 port. Rather than continually submitting patches I put it on github. https://github.com/ngmaloney/context_respect

kevinwal’s picture

Status: Needs review » Closed (fixed)

Ok, those changes were added to the 7.x dev version here as well.

ngmaloney’s picture

Excellent. I added in some code so that each block can be overridden via setting a persistant variable. This is useful if you wish to have context respect handle a core role based setting but not a core page based setting (or vice versa). The new code checks for either 2 variables:

- context_respect_override_role which contains array('$block_id' =>'$value')
- context_respect_override_page which contains array('$block_id' =>'$value')

ex: Lets say you wanted context to respect role based settings but ignore page based settings. Somewhere in code you would set the following:

  variable_set('context_respect_override_page',array('system-main' => TRUE));

I didn't provide an interface yet but these variables can be set via settings.php, strongarm/features, or a module.install.