Undefined variable: view referral.views_default.inc:19 [121.13 sec, 286.77 MB] [notice]
Trying to get property of non-object referral.views_default.inc:19 [121.13 sec, 286.77 MB] [notice]
Undefined variable: view referral.views_default.inc:19 [121.13 sec, 286.77 MB] [notice]

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SocialNicheGuru created an issue. See original summary.

dev22.addweb’s picture

I did not get any error while enabling "User Referral" module and it works proper at my end. Can you provide more details to reproduce it?

caschbre’s picture

I to am receiving this error when dealing with Features.
https://cgit.drupalcode.org/referral/tree/views/referral.views_default.i...

I'm guessing for some reason the 'require_once' file is not loaded at all times?

function referral_views_default_views() {
  $path = dirname(__FILE__) . '/default_views/';
  $views = array();

  // Add View
  require_once $path . 'referral_my_referrals.views_export.inc';
  $views[$view->name] = $view;

  return $views;
}
caschbre’s picture

This doesn't necessarily fix the issue, however it does work around the cases where the $view var is undefined. I'm not actually using the included view so this is a stop-gap patch.

I would receive the warnings after cache clearing.