1. Enable a clean install of openatrium
2. Add a views_field_view to a view.
3. reference a view that you created
4. save.

You get this error:
Notice: Trying to get property of non-object in oa_discussion_preprocess_views_view_fields() (line 181 of drupal7/profiles/openatrium/modules/contrib/oa_discussion/oa_discussion.module).

The line is:

 if ($vars['view']->name == 'open_atrium_discussions') {

views_field_views $vars['view'] returns a string not an object.

Comments

mpotter’s picture

Not sure if maybe you didn't explain it correctly, but in the hook_views_view_fields(), $var['view'] should always return an object for the current View. As documented here: https://api.drupal.org/api/views/theme%21theme.inc/function/template_pre...

So if $vars['view'] is not a proper Views object, then this would be a bug in the viewfield module.

SocialNicheGuru’s picture

Project: Open Atrium Discussion » Viewfield
Version: 7.x-2.18 » 7.x-2.x-dev

I am having this problem with another module but I think mpotter is right.

viewfield returns a string for $vars['view'] for the field value instead of an object.

SocialNicheGuru’s picture

Project: Viewfield » Views Field View
Version: 7.x-2.x-dev » 7.x-1.x-dev
Issue tags: -viewfield +views_field_view

I am seeing this error in a view. the module used to do this is views_field_view not viewfield.

damiankloip’s picture

If you're moving it to thus queue, the summary needs updating.

SocialNicheGuru’s picture

Title: doens't play well with viewfield: Notice: Trying to get property of non-object in oa_discussion_preprocess_views_view_fields » doens't play well with views_field_view: Notice: Trying to get property of non-object in oa_discussion_preprocess_views_view_fields
Issue summary: View changes