Fix single attachment with title#13795
Conversation
alecslupu
left a comment
There was a problem hiding this comment.
I have tried the changes in this PR and seems to work ok.
I have also tried to change the proposal / edit_form_fields as suggested in the bug report, and we still have an error (different).
Could you also patch the decidim-core/app/commands/decidim/multiple_attachments_methods.rb file so that we have a successful upload?
|
@alecslupu I don't think it can be solved in the For a quick fix how you can test with the proposals:
attribute :documents, Integer
attribute :add_documents, Hash
[@form.add_documents].each do |attachment|
[@form.documents].compact.each do |document|
@form.documents = documentIf these changes were implemented to the Single attachment needs to be handled differently than multiple attachments. Otherwise I would have suggested changing |
|
It would be refactoring the Also In the actual case where this was noticed (ideas module), the logic for handling the attachments during form submission is customized for the particular case. Of course, it would be nice if we could apply the logic from the core. |
* develop: (30 commits) Change hardcoded english in seeds (#13917) Allow importing accountability results from a Proposals component (#13817) Remove user interests (#13910) Move remaining categories from some resources to taxonomies (#13838) Fix translation issue on import projects mailer (#13894) Update DownloadYourData exports for decidim-debates (#13895) Allow admins to publish the questions' answers in surveys (#13786) Fix flaky spec in autocomplete (#13901) Refine taxonomy filters (part 2) (#13725) Fix single attachment with title (#13795) Fix incorrect breadcrumb encoding on mobile and tablet (#13891) Add string for unpublish survey admin log message (#13890) Fix ux meeting date location (#13872) New Crowdin updates (#13767) Fix deleted user error in schema (#13681) Remove assembly types from user interaction (#13881) Remove participatory process types from user interaction (#13880) Lock concurrent-ruby to 1.3.4 (#13879) Fix taxonomy serialization for export/imports (#13857) Adjust form upload label changes (#13836) ...

🎩 What? Why?
Currently having a single attachment with title breaks the parameters parsing in Rails. The issue is further explained at #13792 and the added spec tests this situation.
📌 Related Issues
Testing
developActionController::BadRequest: Invalid request parameters: expected Hash (got String) for paramadd_image'`)