- Issue created by @Duwid
Undefined array key "#view_mode" in template_preprocess_activity() (line 54 of profiles/contrib/open_social/modules/custom/activity_creator/activity.page.inc)
I got a lot of these warnings when viewing acitivties in streams.
Problem comes from this if:
if (isset($variables['elements']['#view_mode']) && in_array($variables['content']['field_activity_output_text']['#view_mode'], [
'notification',
'notification_archive',
])) {
...
}
Asking for $variables['content']['field_activity_output_text']['#view_mode'] in in_array method makes no sense, because field_activity_output_text is a text field and therefore has no view mode.
Ask for elements view mode in in_array method:
if (isset($variables['elements']['#view_mode']) && in_array($variables['elements']['#view_mode'], [
'notification',
'notification_archive',
])) {
...
}
Needs review
12.0
Activity/Notifications