AO3-7561 Fix 500 when trying to /comments/show_comments on nothing - #5996
AO3-7561 Fix 500 when trying to /comments/show_comments on nothing#5996danderson wants to merge 3 commits into
Conversation
07fef2d to
be73224
Compare
|
The couple force pushes were to fix rubocop complaints, which all concerned the preexisting code that I moved into the else branch. The fixes are straightforward, but I did have to switch a use of |
be73224 to
99731ff
Compare
There was a problem hiding this comment.
Just one small thing to fix, otherwise it looks good. I also marked your issues as In Review on Jira so no one accidentally picks them up. Someone with more perms should be along soon to help get your account connected so you can update them yourself :)
Also including the ts() to t() conversion in this pr is absolutely expected and a-ok
sarken
left a comment
There was a problem hiding this comment.
Hi, David Anderson!
Thank you so much for this pull request. I've left a quick comment about the error message i18n. Once that's addressed, I think this will be ready to merge.
If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (CREDIT NAME)."
Once you've done that (or if you've already done it -- Jira has been unreliable about showing us new accounts in the admin panel lately), you can either reply here or send an email to otw-coders@transformativeworks.org with your account name and email address and we'll set up the permissions for you.
Thanks again for contributing! If you have any questions, you can contact us at the same email address listed above.
Signed-off-by: David Anderson <dave@natulte.net>
|
Thanks for the review! Changes done, assuming CI is happy with what I did. I emailed otw-coders@ with account info for Jira. |
sarken
left a comment
There was a problem hiding this comment.
Thank you! (Your Jira permissions should be all set now as well.)
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7561
Purpose
Fixes a 500 when attempting to view comments without passing any query parameters. With this change, the user is instead redirected back from whence they came, with a flash error noting that you can't view comments on nothing.
Testing Instructions
Navigate to http://archiveofourown.org/comments/show_comments. Without this change, will 500. With this change, will redirect to the homepage with an error flash.
References
https://otwarchive.atlassian.net/browse/AO3-7556 is a similar issue in a different route, with a similar fix. Assuming I didn't screw up this one, I can send a followup PR with that fix too.
Credit
David Anderson (he/him)
Misc notes
This is my first PR to otwarchive. There were no first timer issues open, so I picked a recent Difficulty=Easy bug instead to get my feet wet and figure out the dev workflow.
I chose to handle the nil in the show_comments logic, rather than in the redirect_to_all_comments helper where the 500 triggered. This seems to match the local coding style for handling nil commentables (e.g.
newandcreate), and the helper is also called from places where the commentable is a DB object or similar, and silently swallowing an error in those codepaths didn't seem right.