Deprecated Function Warnings when Displaying Workflow State Change Table

Created on 13 March 2023, over 1 year ago
Updated 28 March 2023, over 1 year ago

Problem/Motivation

When the table displaying past workflow changes loads it passes the comment field of the workflow change to a function that doesn't support NULL parameter inputs in Drupal 9, PHP 8. To avoid warnings when a workflow change with a blank comment is being loaded the code should be changed to change NULL parameters to an empty string.

Steps to reproduce

  1. Open the workflow of any content on PHP version 8.1.14 and Drupal version 9.5.2
  2. There should be a deprecated function warning for each workflow state change without an associated comment.

Proposed resolution

Replace the current code on line 169 of WorkflowTransitionListBuilder.php in the src folder of the workflow module:

$row['comment']['data'] = html_entity_decode($transition->getComment()); // 'class' => array('log-comment')

with this new code:

if($transition->getComment() == NULL) {
  $row['comment']['data'] = ""; 
} 
else {
  $row['comment']['data'] = html_entity_decode($transition->getComment()); // 'class' => array('log-comment') 
}
πŸ› Bug report
Status

Closed: duplicate

Version

1.6

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Dr_Penguin2275

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024