-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom's field data erase when sorting the issue #27
Comments
Did you run the migration task? See: Please inform your schema version of redmine_issue_templates.
It would also be very helpful if you could attach some of the Redmine logs from when you submitted the form, especially when you submitted it in development mode. |
Hi! Thanks for the answer. schema version:
Here is the log when I submit the form:
It creates a new record in the database, in the table "global_issue_templates". Column "builtin_fields_json" have our "custom fields" data:
And when I moving it:
After then data in column "builtin_fields_json" became NULL. I think somehow the sorting function ignores this column and just erases it. |
I found how to enable debug logs, and it confirms my thoughts. Here is the sorting request:
|
@Sab0tag3d Thank you for the information above! And I think this change will be effective. diff --git a/app/controllers/concerns/issue_templates_common.rb b/app/controllers/concerns/issue_templates_common.rb
index 2b50b1d..0f73c78 100644
--- a/app/controllers/concerns/issue_templates_common.rb
+++ b/app/controllers/concerns/issue_templates_common.rb
@@ -55,6 +55,7 @@ module IssueTemplatesCommon
end
def valid_params
+ return template_params unless template_params.has_key?(:builtin_fields)
attributes = template_params.except(:builtin_fields)
attributes[:builtin_fields_json] = builtin_fields_json if builtin_fields_enabled?
attributes Could you please try it? By the way, since I am no longer the maintainer and this repository is open to all, I would be very happy to create a pull request for this issue if you think this feature would be useful. |
Great job. Thanks!! It fixed. |
Summary
Custom's field data erase when sorting the issue
Description
When I create an issue with custom fields and sort it after that (move with sort arrows) the customs fields are erasing.
But the main description field is saving.
Environment
Redmine version 4.2.3.stable
Ruby version 2.7.0-p0 (2019-12-25) [x86_64-linux-gnu]
Rails version 5.2.6
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Git 2.25.1
Filesystem
Redmine plugins:
redmine_issue_templates 1.1.0
redmine_resources 1.0.6
Visual Proof / Screenshot
I didn't find any useful info in the logs. But I had noticed that every time I do sorting, I get a new "updated" time. Probably, it correctly replaces the Description field, but customs fields just rewrite with empty data.
The text was updated successfully, but these errors were encountered: