Serialization error when try to upload files into 'File' type fields when create activities

Created on 27 July 2023, over 1 year ago
Updated 5 July 2024, 6 months ago

Problem/Motivation

An error happen when upload file to activity in "File" field type during activity creation.
Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed en serialize() (linea 14 de /app/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php).

Steps to reproduce

  1. Go to /admin/structure/opigno_activity_type and create new activity type.
  2. Go to newly created activity type and add field of type File
  3. Go to /admin/structure/opigno-activities and click to create activity of recently created activity type.
  4. Try to upload file in file field
  5. As result, AJAX process will started but error happens.
  6. Go to /admin/reports/dblog to check error message.

Proposed resolution

To solve this in OpignoActivityForm class call of getCurrentRequest() method should be removed from __construct() and should be moved directly into save() method of OpignoActivityForm class

Here is patch to fix it.

Remaining tasks

  • Test
  • Review

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

3.1

Component

Code

Created by

🇺🇦Ukraine oleksandr.s

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024