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.
Comments
Comment #2
ragnarkurm commentedComment #3
ultrabob commented@ragnarkurm It would be really good to know what the value of
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:
Comment #4
mlncn commentedWe are already logging an unexpected-ish state (falsy value for a given transition ID in $transition_data) and know there is at least some transition data. We can prevent this warning and if no one else has run into it figure it is rare enough that when anybody cares enough this existing log message will help the debugging.
Comment #6
damienmckennaShould this be "fixed" or "postponed (needs more info)"?
Comment #7
mlncn commented