Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#7 | 3185869-php-error.patch | 703 bytes | marcelovani |
#2 | Screenshot 2020-12-01 at 16.52.29.jpg | 597.29 KB | marcelovani |
Issue fork workflow-3185869
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:
- 3185869-notice-trying-to changes, plain diff MR !1
- 8.x-1.x changes, plain diff MR !2
Comments
Comment #2
marcelovaniComment #5
marcelovaniComments below
Comment #7
marcelovaniUsing 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
Comment #9
marcelovaniComment #10
marcelovaniComment #11
ayalon CreditAttribution: ayalon at Liip commentedThanks for the patch! I had the same issue and the patch in #7 fixes the notice.
Comment #13
johnvThanks, committed.