-
Notifications
You must be signed in to change notification settings - Fork 8
Fix form builder when is used in system #104
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
Fix form builder when is used in system #104
Conversation
|
@microstudi we found this error, but I don't know if this solution is the best approach... can you take a look and tell me? thanks!! |
| def file_field(object_name, options = {}) | ||
| return super(object_name, options) unless Decidim::ReportingProposals.use_camera_button | ||
| return super(object_name, options) if @object_name == "editor_image" || @object_name == "oauth_application" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def file_field(object_name, options = {}) | |
| return super(object_name, options) unless Decidim::ReportingProposals.use_camera_button | |
| return super(object_name, options) if @object_name == "editor_image" || @object_name == "oauth_application" | |
| alias_method :original_file_field, :file_field | |
| def file_field(object_name, options = {}) | |
| return super(object_name, options) unless Decidim::ReportingProposals.use_camera_button | |
| return original_file_field unlesss @template.respond_to?(:snippets) |
Hi @laurajaime, I think the best approach would just do something like this
c1bee01 to
cd3e8be
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #104 +/- ##
==========================================
- Coverage 89.71% 80.43% -9.29%
==========================================
Files 72 66 -6
Lines 1507 1436 -71
==========================================
- Hits 1352 1155 -197
- Misses 155 281 +126 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
microstudi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @laurajaime
Please check the comment and we are good to go!
| return super(object_name, options) unless Decidim::ReportingProposals.use_camera_button | ||
| return original_file_field unless @template.respond_to?(:snippets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return super(object_name, options) unless Decidim::ReportingProposals.use_camera_button | |
| return original_file_field unless @template.respond_to?(:snippets) | |
| return original_file_field(object_name, options) unless Decidim::ReportingProposals.use_camera_button | |
| return original_file_field(object_name, options) unless @template.respond_to?(:snippets) |
Now that I see thid, maybe for consistency we should do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done @microstudi
|
@microstudi ready to review again |
microstudi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There is an error when the form builder is used in /system when you edit an organization.