diff --git a/README.md b/README.md index 2b8f9b00..5c1e449f 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ You can either clone the master branch or download the latest zipped version. Be `RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf` 5. The access rights must be set for web server, example: `chown -R www-data:www-data plugins/redmine_dmsf`. -6. Restart the web server, e.g. `systemctl apache2 restart` +6. Restart the web server, e.g. `systemctl restart apache2` 7. You should configure the plugin via Redmine interface: Administration -> Plugins -> DMSF -> Configure. 8. Don't forget to grant permissions for DMSF in Administration -> Roles and permissions 9. Assign DMSF permissions to appropriate roles. diff --git a/app/controllers/dmsf_upload_controller.rb b/app/controllers/dmsf_upload_controller.rb index e00d6eb2..fba1b671 100644 --- a/app/controllers/dmsf_upload_controller.rb +++ b/app/controllers/dmsf_upload_controller.rb @@ -70,7 +70,12 @@ class DmsfUploadController < ApplicationController if defined?(EasyExtensions) @attachment.skip_description_required = true end - saved = @attachment.save + begin + Attachment.skip_callback(:commit, :after, :reuse_existing_file_if_possible) + saved = @attachment.save + ensure + Attachment.set_callback(:commit, :after, :reuse_existing_file_if_possible) + end respond_to do |format| format.js