Project

General

Profile

Actions

Defect #40301

closed

Error when create a version with custom field of "File" type from Issue page

Defect #40301: Error when create a version with custom field of "File" type from Issue page

Added by Morris Penasso almost 3 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Resolution:
Fixed
Affected version:

Description

Following this path:
Open existing issue -> Edit -> Target Version -> Create new one with green button.

I have a "File" custom field that is not required but when i try to save version after enter the name, the system say me that the custom field is not valid.
I try to delete it and create another one but i obtain the same error ( only with "File" custom field ).

System informations:

Environment:
Redmine version 5.1.0.stable
Ruby version 3.0.2-p107 (2021-07-07) [x86_64-linux-gnu]
Rails version 6.1.7.6
Environment production

SCM:
Mercurial 6.1.1
Git 2.34.1
Filesystem
Redmine plugins:
redmine_dmsf 3.1.3


Files

Updated by Morris Penasso about 2 years ago Actions #1

Any updates ?

When save "Custom file field", the name of file is not reported on summary.
The DMSF team has bugfix this bug: https://github.com/danmunn/redmine_dmsf/commit/79bc188c759681511c8ce37a7946237267ad3f17

But remain the bug writed on this issue.
The DMSF team say: "Custom field format File is Redmine's internal custom field and has nothing to do with DMSF plugin. The custom field related to DMSF is DMS Document rev."

Updated by Go MAEDA about 2 years ago Actions #2

I have confirmed the issue.

Updated by Takenori TAKAKI about 2 years ago Actions #3

Reviewing the HTML for the new version modal, I found enctype="multipart/form-data" was missing.
Adding :html => {:multipart => true} to versions/_new_modal.html.erb adds this attribute and enables successful version registration.

diff --git a/app/views/versions/_new_modal.html.erb b/app/views/versions/_new_modal.html.erb
index 052a739747..02c57abc4c 100644
--- a/app/views/versions/_new_modal.html.erb
+++ b/app/views/versions/_new_modal.html.erb
@@ -1,6 +1,6 @@
 <h3 class="title"><%=l(:label_version_new)%></h3>

-<%= labelled_form_for @version, :url => project_versions_path(@project), :remote => true do |f| %>
+<%= labelled_form_for @version, :url => project_versions_path(@project), :html => {:multipart => true}, :remote => true do |f| %>
 <%= render :partial => 'versions/form', :locals => { :f => f } %>
   <p class="buttons">
     <%= submit_tag l(:button_create), :name => nil %>

Updated by Go MAEDA about 2 years ago Actions #4

  • Target version set to 5.1.5

Updated by Marius BĂLTEANU almost 2 years ago Actions #5

  • Subject changed from Issue - New version: Error when create a version with custom field of "File" type to Error when create a version with custom field of "File" type from Issue page
  • Status changed from Confirmed to Resolved
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed

I've committed the patch posted by user:takenory together with a system test.

Thanks for reporting and fixing the issue.

Updated by Marius BĂLTEANU almost 2 years ago Actions #6

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom