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

Marking trending post as "disallowed" breaks moderation interface for said post #23573

Closed
smiba opened this issue Feb 13, 2023 · 5 comments · Fixed by #23574
Closed

Marking trending post as "disallowed" breaks moderation interface for said post #23573

smiba opened this issue Feb 13, 2023 · 5 comments · Fixed by #23574
Labels
bug Something isn't working

Comments

@smiba
Copy link

smiba commented Feb 13, 2023

Steps to reproduce the problem

  1. Mark trending post as "Disallow post"
  2. Open the post and press "Open this post in the moderation interface"
  3. 500 error is thrown

Expected behaviour

Moderation interface should've opened

Actual behaviour

500 error is shown

Detailed description

Opening the post throws the following error:

[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700] method=GET path=/admin/accounts/109552402632649346/statuses/109855755827007172 format=html controller=Admin::StatusesController action=show status=500 error='ActionView::Template::Error: undefined method `requires_review?' for #<StatusTrend id: 35247, status_id: 109855755827007172, account_id: 109552402632649346, score: 0.8788198703741205, rank: 1, allowed: false, language: "en">
Did you mean?  require_dependency' duration=39.37 view=0.00 db=6.37
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700] ActionView::Template::Error (undefined method `requires_review?' for #<StatusTrend id: 35247, status_id: 109855755827007172, account_id: 109552402632649346, score: 0.8788198703741205, rank: 1, allowed: false, language: "en">
Did you mean?  require_dependency):
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     34:           %td
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     35:             - if @status.trend.allowed?
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     36:               %abbr{ title: t('admin.trends.tags.current_score', score: @status.trend.score) }= t('admin.trends.tags.trending_rank', rank: @status.trend.rank)
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     37:             - elsif @status.trend.requires_review?
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     38:               = t('admin.trends.pending_review')
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     39:             - else
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]     40:               = t('admin.trends.not_allowed_to_trend')
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700]
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700] app/views/admin/statuses/show.html.haml:37
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700] app/controllers/concerns/localized.rb:11:in `set_locale'
[4e11d1ef-e4b9-43d9-98c5-4aeec1c18700] lib/mastodon/rack_middleware.rb:9:in `call'

Specifications

Mastodon 4.1.0
Ruby 3.0.4p208

@smiba smiba added the bug Something isn't working label Feb 13, 2023
@smiba
Copy link
Author

smiba commented Feb 13, 2023

Should be noted I can't reproduce this on a trending post that doesn't have any edits to the post.

Also odd chance that the issue isn't with disallowing it, but with the fact it is a trending post that has an edit to it. (I'm not sure if I checked the moderation interface before disallowing it)

Unfortunately I don't have any other trending posts that have an edit in them to test it further, but I will report back once I do

@ClearlyClaire
Copy link
Contributor

That seem to occur to the history view of any trending-but-not-approved-to-trend post. This only affects the view of the post's history.

ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this issue Feb 13, 2023
@smiba
Copy link
Author

smiba commented Feb 13, 2023

Unfortunately it causes the entire request to come back as "Sorry something went wrong", meaning I can't access the interface for the post

I may have missed it before, as trending posts on my instance are approved by default. I forgot this is not the default

@ClearlyClaire
Copy link
Contributor

Unfortunately it causes the entire request to come back as "Sorry something went wrong", meaning I can't access the interface for the post

Yes, but I mean the entire request is just here to display the edit log in the first place.

@smiba
Copy link
Author

smiba commented Feb 13, 2023

Unfortunately it causes the entire request to come back as "Sorry something went wrong", meaning I can't access the interface for the post

Yes, but I mean the entire request is just here to display the edit log in the first place.

Oh like that, got it :)

Thanks for looking into it by the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants