Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
mpotter CreditAttribution: mpotter commentedNot 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.
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI 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.
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI am seeing this error in a view. the module used to do this is views_field_view not viewfield.
Comment #4
damiankloip CreditAttribution: damiankloip commentedIf you're moving it to thus queue, the summary needs updating.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commented