Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Mayan EDMS Mayan EDMS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 192
    • Issues 192
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mayan EDMSMayan EDMS
  • Mayan EDMSMayan EDMS
  • Issues
  • #862
Closed
Open
Created Aug 19, 2020 by Dennis Ploeger@dploeger

Missing Widget Keyword Arguments on transition fields lead to MediaDefiningClass object argument after ** must be a mapping, not NoneType

Steps to reproduce:

  • Create a new workflow
  • Add states a and b
  • Add a transition from a to b
  • Add a field to the transition, choose the "Text Area" class (leave "Widget keyword arguments" empty)

Expected result:

Running the workflow and transitioning from a to b presents the form with the created form field.

Actual result:

A server error is displayed and the following error is shown in the logs:

mayan.apps.common.middleware.error_logging <418> [ERROR] "process_exception() line 17 Exception caught by request middleware; <WSGIRequest: GET '/workflows/documents/workflows/8/transitions/2/execute/'>, MediaDefiningClass object argument after ** must be a mapping, not NoneType"
Traceback (most recent call last):
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/common/mixins.py", line 548, in dispatch
    ).dispatch(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/mayan-edms/lib/python3.7/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.7/site-packages/mayan/apps/common/mixins.py", line 101, in get_context_data
    context = super(ExtraContextMixin, self).get_context_data(**kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/common/mixins.py", line 443, in get_context_data
    context = super(RedirectionMixin, self).get_context_data(**kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/generic/edit.py", line 66, in get_context_data
    kwargs['form'] = self.get_form()
  File "/opt/mayan-edms/lib/python3.7/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.7/site-packages/mayan/apps/common/forms.py", line 171, in __init__
    )(**widget.get('kwargs', {}))
TypeError: MediaDefiningClass object argument after ** must be a mapping, not NoneType

Workaround:

Add this to the "Widget keyword arguments" field:

attrs:
  rows: 3

Suggested solution:

Add the above as the default value for "Widget keyword arguments" or make the field required and document it well.

Assignee
Assign to
Time tracking