Problem with Actions in Workflows after upgrade to 4.5.5

Some actions no longer work after the upgrade and cannot be edited or viewed

mayan.apps.logging.middleware.error_logging <20434> [ERROR] "process_exception() line 15 Exception caught by request middleware; <WSGIRequest: GET '/workflows/workflow_templates/states/actions/25/edit/'>, 'WorkflowStateAction' object has no attribute 'workflow'"
Traceback (most recent call last):
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/views/view_mixins.py", line 704, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/views/generic/edit.py", line 190, in get
    return super().get(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/views/generic/edit.py", line 133, in get
    return self.render_to_response(self.get_context_data())
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/views/view_mixins.py", line 242, in get_context_data
    context = super().get_context_data(**kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/views/view_mixins.py", line 560, in get_context_data
    context = super().get_context_data(**kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/views/view_mixins.py", line 676, in get_context_data
    context = super().get_context_data(*args, **kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/views/generic/edit.py", line 66, in get_context_data
    kwargs['form'] = self.get_form()
  File "/opt/mayan-edms/lib/python3.9/site-packages/django/views/generic/edit.py", line 33, in get_form
    return form_class(**self.get_form_kwargs())
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/views/view_mixins.py", line 129, in get_form_kwargs
    'schema': self.get_form_schema()
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/backends/view_mixins.py", line 3, in get_form_schema
    return self.get_backend_class().get_form_schema(
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/document_states/classes.py", line 98, in get_form_schema
    return super().get_form_schema(**kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/backends/class_mixins.py", line 51, in get_form_schema
    form_fields = cls.get_form_fields(**kwargs)
  File "/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/metadata/workflow_actions.py", line 128, in get_form_fields
    document_types_queryset = cls.workflow_state.workflow.document_types
AttributeError: 'WorkflowStateAction' object has no attribute 'workflow'
mayan.apps.navigation.class_mixins <20434> [WARNING] "get_request() line 37 No request variable, aborting `Menu` resolution"

Thanks for the report. Looking into this.

thank you, the error exist in 4.5.3 maybe earlier, but only in Workflow Action type metadata

Kind Regards

Thank you
it is fixed with 4.5.6
and an error appeared with it, in 4.4.8

{{document.label

still worked strangely in one workflow, I have now corrected it with

{{workflow_instance.document.label

Thank you
it is fixed with 4.5.6

This fix along with a few others is being backported to series 4.4.

and an error appeared with it, in 4.4.8

{{document.label

still worked strangely in one workflow, I have now corrected it with

{{workflow_instance.document.label

This was a change in how workflows work for series 4.5:

The workflow template state action template no longer has direct access to the document to which the workflow is attached via the variable {{ document }}. To access the document, do so indirectly via the {{ workflow_instance }} variable with {{ workflow_instance.document }}.

https://docs.mayan-edms.com/releases/4.5.html#id9