Warning: Undefined variable $transition_machine_name

Created on 29 November 2023, 7 months ago
Updated 14 December 2023, 7 months ago

Problem/Motivation

In the logs, I find quite a bit of the following warnings:

Warning: Undefined variable $transition_machine_name in Drupal\\workflow_buttons\\Plugin\\Field\\FieldWidget\\WorkflowButtonsWidget::processActions() (line 271 of \/app\/web\/modules\/contrib\/workflow_buttons\/src\/Plugin\/Field\/FieldWidget\/WorkflowButtonsWidget.php)
"Warning: Undefined variable $transition_machine_name in Drupal\\workflow_buttons\\Plugin\\Field\\FieldWidget\\WorkflowButtonsWidget::processActions() (line 278 of \/app\/web\/modules\/contrib\/workflow_buttons\/src\/Plugin\/Field\/FieldWidget\/WorkflowButtonsWidget.php)

Steps to reproduce

Not sure.

Proposed resolution

Initialize the variable $transition_machine_name before using it.

πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡ͺEstonia ragnarkurm

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

Comments & Activities

  • Issue created by @ragnarkurm
  • Status changed to Postponed: needs info 7 months ago
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    @ragnarkurm It would be really good to know what the value of

    $transition_data
    

    in cases where that code path is triggered, maybe there is a way to make sure we never get that far without the data we need.

    I'd request three things from you if it is possible:

    1. The value of $transition_data when you reach that watchdog log
    2. What your workflow configuration looks like for the entity type in question
    3. If there are any particular actions you take that make the difference between having the error and not having it (i.e. it only happens when newly creating content, or it only happens on a specific transition)
Production build 0.69.0 2024