Skip to content
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

Dashboard crashes when Proposals are deleted due to ActiveLog #5265

Closed
tramuntanal opened this issue Jul 11, 2019 · 0 comments · Fixed by #5267
Closed

Dashboard crashes when Proposals are deleted due to ActiveLog #5265

tramuntanal opened this issue Jul 11, 2019 · 0 comments · Fixed by #5267
Assignees
Labels
type: bug Issues that describe a bug

Comments

@tramuntanal
Copy link
Contributor

tramuntanal commented Jul 11, 2019

Describe the bug
The problem is that proposal drafts can be removed, but the Admin Activity Log, when renders Proposals takes for granted that the associated resource, when a Proposal, there's always there. But this is not always true.

Culprit: Admin Log (rendered in the Dashboard and in the Admin Activity Log).

The crash raises in Decidim::Proposals::ProposalPresenter.title:L44 with the typical "no title method for Nil class" message.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'a participatory process'
  2. Enable participatory text
  3. import a document
  4. discard the participatory text
  5. go to dashboard or AdminLog

Expected behavior
ActionLog should not crash when proposals are discarded.

Stacktrace

F, [2019-07-10T09:29:35.769851 #3089] FATAL -- : ActionView::Template::Error (undefined method `title' for nil:NilClass):
F, [2019-07-10T09:29:35.769971 #3089] FATAL -- :      8:     <% if logs.any? %>
     9:       <ul class="logs table">
    10:         <% logs.each do |log| %>
    11:           <%= render_log(log) %>
    12:         <% end %>
    13:       </ul>
    14:     <% else %>
F, [2019-07-10T09:29:35.770004 #3089] FATAL -- :
F, [2019-07-10T09:29:35.770053 #3089] FATAL -- : /home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-proposals/app/presenters/decidim/proposals/proposal_presenter.rb:44:in `title'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-proposals/app/presenters/decidim/proposals/log/resource_presenter.rb:13:in `present_resource_name'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/resource_presenter.rb:45:in `present_resource'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/resource_presenter.rb:31:in `present'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:193:in `i18n_params'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:110:in `block in present_explanation'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:41:in `block in capture'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:205:in `with_output_buffer'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:41:in `capture'
actionview (5.2.3) lib/action_view/helpers/tag_helper.rb:272:in `content_tag'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:107:in `present_explanation'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:121:in `block in present_content'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:41:in `block in capture'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:205:in `with_output_buffer'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:41:in `capture'
actionview (5.2.3) lib/action_view/helpers/tag_helper.rb:272:in `content_tag'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:120:in `present_content'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:154:in `block in present_action_log'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:41:in `block in capture'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:205:in `with_output_buffer'
actionview (5.2.3) lib/action_view/helpers/capture_helper.rb:41:in `capture'
actionview (5.2.3) lib/action_view/helpers/tag_helper.rb:272:in `content_tag'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:153:in `present_action_log'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-core/app/presenters/decidim/log/base_presenter.rb:43:in `present'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-admin/app/helpers/decidim/admin/log_render_helper.rb:17:in `render_log'
/home/decidim/.rvm/gems/ruby-2.5.3/bundler/gems/decidim-88bdce57dd9a/decidim-admin/app/views/decidim/admin/logs/_logs_list.html.erb:11:in `block in 

Additional Context
Related with meta-decidim: https://meta.decidim.org/processes/bug-report/f/210/proposals/14701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issues that describe a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant