On Drupal 10.4
Using eForm, worked well with workflow 1.8.
Got this error after upgrading to workflow 2.0
The user object does not exist in the default value of the element.

The website encountered an unexpected error. Try again later.

Error: Call to a member function hasPermission() on null in Drupal\workflow\Element\WorkflowTransitionTimestamp::processTimestamp() (line 168 of modules/contrib/workflow/src/Element/WorkflowTransitionTimestamp.php).
call_user_func_array() (Line: 1011)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1074)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1074)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1074)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1074)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 579)
Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 83)
Drupal\workflow\Form\WorkflowTransitionForm::createInstance() (Line: 106)
Drupal\workflow\Plugin\Field\FieldWidget\WorkflowDefaultWidget->formElement() (Line: 459)
Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 219)
Drupal\Core\Field\WidgetBase->formMultipleElements() (Line: 120)
Drupal\Core\Field\WidgetBase->form() (Line: 190)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm() (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form() (Line: 64)
Drupal\eform\Form\EFormSubmissionForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 188)
Drupal\entity_print_form\Service\PrintFormBuilder->generateHtml() (Line: 122)
Drupal\entity_print_form\Service\PrintFormBuilder->deliverPrintable() (Line: 97)
Drupal\entity_print_form\Controller\EntityPrintFormController->Drupal\entity_print_form\Controller\{closure}() (Line: 106)
Symfony\Component\HttpFoundation\StreamedResponse->sendContent() (Line: 423)
Symfony\Component\HttpFoundation\Response->send() (Line: 99)
Drupal\entity_print_form\Controller\EntityPrintFormController->viewPrint()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)
CommentFileSizeAuthor
#2 workflow_timestamp_issue_3524614_2.patch604 bytesgigimaor

Comments

gigimaor created an issue. See original summary.

gigimaor’s picture

StatusFileSize
new604 bytes

Work well after patch

johnv’s picture

This reverts the commit from #3432411-5: Add WorkflowTransition::uid as widget field using EntityOwnerTrait.
Not sure why that commit would give another result for $user determination.

johnv’s picture

Status: Active » Needs review

  • johnv committed a9154a97 on 8.x-1.x
    Issue #3524614 by gigimaor: Error on Transition Timestamp - no owner in...
johnv’s picture

Status: Needs review » Fixed

Your analysis is correct, but the patch does not fit the analysis.
The committed change fixes the root cause - it sets a decent value for uid upon creating a new Transition.

Please test latest dev version and report back.

Status: Fixed » Closed (fixed)

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