simplenews.views.inc is currently included in hook_menu().
There's a known erratic race condition where the exposed data is missing when views requires it.

See http://drupal.org/node/189311 for a similar issue that got fixed in VotingAPI.
CCK, OG have been doing this for more than a year now, VotingAPI got fixed a few months ago too, so I'm setting directly as RTBC :-)

function simplenews_init() {
  // only bother when we are not serving a cached page. check for which function that only exists afterwards
  if (function_exists('drupal_set_content')) {
    if (module_exists('views')) {
      include_once(drupal_get_path('module', 'votingapi') .'/votingapi_views.inc');     
    }
  }
}

Comments

sutharsan’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the code. However I rather have the function to include simplenews_views.inc instead ;)
Attached patch is committed.

yched’s picture

er, right, including simplenews_views.inc will probably be closer to what users expect :-)
Thx.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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