My specific requirement involves a context plugin which has been added as a new dependency of an existing feature. This feature also includes a context which requires the new context plugin. Due to context module not picking up new context plugins until after a cache clear, the context requiring the new plugin simply seems to not work. Clearing the cache makes the new plugins settings appear on the context admin page, and the context magically begins working again.

Comments

hefox’s picture

There's an issue about adding a hook called after revert, could look for that issue.

However, it sounds like a bug that the context isn't showing, which is likely either a ctools or a context issue.

mpotter’s picture

Status: Active » Closed (won't fix)

Closing this for lack of activity. Please re-open this issue if you can reproduce it in the latest version.

dmsmidt’s picture

Version: 7.x-1.x-dev » 7.x-2.0-rc5
Status: Closed (won't fix) » Active

Reopening this as I have the same problem as the original poster.

Using:
Context 7.x-3.0-rc1
Features 7.x-2.0-rc5

- Created a custom context reaction plugin
- Created a context with the reaction from the plugin
- Created a feature with the context and dependency on the custom plugin
- Install new site with in its install profile the given feature
- On the new site the custom reaction plugin is enabled
- Context UI doesn't show the custom plugin until a clear cache

Any ideas?

dmsmidt’s picture

Status: Active » Fixed

To answer the main question:

There are some hooks which can be used to run some code after a rebuild / revert:

  • hook_post_features_rebuild Feature module hook. Invoked on a Feature module after that module is rebuilt.
  • hook_post_features_revert Feature module hook. Invoked on a Feature module after that module is reverted.

See: http://drupalcontrib.org/api/drupal/contributions%21features%21features.api.php/7

You can put that code in your features .module file.
I thought a cache_clear_all('plugins:context:plugins', 'cache'); would do the trick.
But it doesn't, even registry_rebuild(); doesn't. So for now I use a hook_enable() in my .install file with a consuming drupal_flush_all_caches();.

Maybe a thing for the context module to automate ...

Status: Fixed » Closed (fixed)

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