Problem/Motivation

PHP Errors

Error message
Notice: Trying to access array offset on value of type null in workflow_get_user_role_names() (line 274 of modules/contrib/workflow/workflow.module).
workflow_get_user_role_names('create send_to_editor workflow_transition') (Line: 78)
Drupal\workflow_ui\Form\WorkflowConfigTransitionRoleForm->buildRow(Object) (Line: 155)
Drupal\workflow_ui\Form\WorkflowConfigTransitionFormBase->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
Drupal\Core\Form\FormBuilder->retrieveForm('workflow_config_transition_permission_form', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

This happens when using PHP 7.4 and I visit the Transitions tab, see screenshot

Proposed resolution

Check the variable

Remaining tasks

Review patch

User interface changes

None

API changes

None

Data model changes

None

Issue fork workflow-3185869

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcelovani created an issue. See original summary.

marcelovani’s picture

Issue summary: View changes
FileSize
597.29 KB

marcelovani’s picture

Comments below

marcelovani’s picture

Status: Active » Needs review
FileSize
703 bytes

Using the new PR system instead of the usual patching way..

A bit confusing UI but here is the pr https://git.drupalcode.org/project/workflow/-/merge_requests/1/diffs

And the build passed https://www.drupal.org/pift-ci-job/1900821

Attaching the patch anyway

Status: Needs review » Needs work

The last submitted patch, 7: 3185869-php-error.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

marcelovani’s picture

marcelovani’s picture

Status: Needs work » Needs review
ayalon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch! I had the same issue and the patch in #7 fixes the notice.

  • johnv committed e57dc20 on 8.x-1.x authored by marcelovani
    Issue #3185869 by marcelovani: Notice: Trying to access array offset on...
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.4
Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.