Undefined array key "view_mode" in flag_theme_suggestions_flag()

Created on 27 March 2025, 10 days ago

Problem/Motivation

Warning: Undefined array key "view_mode" in flag_theme_suggestions_flag() (line 269 of modules/contrib/flag/flag.module).

I have flags displayed on a view. It all seems pretty standard. I have created a patch to stop the warning appearing, I am not sure if this is a sign of a deeper issue, or if covering it up with this patch will suffice.

Here is my tags yaml file:

langcode: en-gb
status: true
dependencies:
  module:
    - webform
id: tags
label: Tags
bundles: {  }
entity_type: webform_submission
global: true
flag_short: 'Tag this submission'
flag_long: ''
flag_message: ''
unflag_short: 'Update tags'
unflag_long: ''
unflag_message: ''
unflag_denied_text: ''
weight: 0
flag_type: 'entity:webform_submission'
link_type: field_entry
flagTypeConfig:
  show_in_links: {  }
  show_as_field: true
  show_on_form: false
  show_contextual_link: false
  extra_permissions:
    owner: '0'
linkTypeConfig:
  flag_confirmation: 'Enter tagging details'
  edit_flagging: 'Edit tags'
  unflag_confirmation: 'Are you sure you want to remove these tags?'
  flag_create_button: 'Create tags'
  flag_delete_button: 'Delete tags'
  flag_update_button: 'Update tags'
  form_behavior: modal
🐛 Bug report
Status

Active

Component

Flag core

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024