Plots2: Fix hyperlinks not working on profile page

Created on 11 Mar 2019  Β·  17Comments  Β·  Source: publiclab/plots2

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you πŸ’

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

πŸ€” What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

πŸ“‹ Step by Step

  • [ ] πŸ™‹ Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!
  • [ ] πŸ“ UPDATE
    Change line 31 of (https://github.com/publiclab/plots2/blob/master/app/views/tag/show.html.erb) to:
<% if !@related_tags.nil? %>
    <p> <%= render partial: 'tag/subscribe_button', locals:{tags: @related_tags } %></p>
  <% end %>

to ensure that an iteration does not occur on a nil value (that is, tags.each should only run when tags has a non-nil value).
Current Behavior
Clicking on the hyperlinks to a user's questions and activities on their profile page breaks the app and opens an error page.
Screenshot 2019-03-11 at 10 38 15 PM
Screenshot 2019-03-11 at 9 58 50 PM

Expected Behavior
Clicking on the hyperlinks on a user's profile page ("questions", for example) should take you to a page that shows the questions or activities the user has made.
Screenshot 2019-03-11 at 10 38 15 PM
Screenshot 2019-03-11 at 10 38 33 PM

  • [ ] πŸ’Ύ Commit your changes
  • [ ] πŸ”€ Start a Pull Request. There are two ways how you can start a pull request:
  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.
  2. You can also edit files directly in your browser and open a pull request from there.
  • [ ] 🏁 Done Ask in comments for a review :)

πŸ€”β“ Questions?

Leave a comment below!

assigned first-timers-only

Most helpful comment

Aha gotcha, thanks @madeofhuman. @helenatxu this is ready you can get started on it...comment below if you get stuck.

All 17 comments

@gauravano here's the issue.

Hi I am an Outreachy applicant, could I be assigned to this issue to work on? Or maybe you have another issue you could assign me to start working :) Thanks @gauravano

@madeofhuman good catch, but to make it a first-timer-only you have to give the the actual code to be written and links to where specifically it should be. Please do that on the description or I can help with that, juts let me know. @helenatxu awesome you can take up this issue once its ready

Actually this could be split into three ftos now that we are in need for more..one for each hyperlink thanks again @madeofhuman

@cesswairimu It's actually only one line of code that needs to be modified to fix everything. If you look at the screenshot of the error page that I added to the description, it's line 4 of _tags_popover.html.erb

Aha gotcha, thanks @madeofhuman. @helenatxu this is ready you can get started on it...comment below if you get stuck.

Thank you @cesswairimu!

@helenatxu how are you doing with this? If you're running into any problem, please don't hesitate to reach out. πŸ˜„

Hi, @helenatxu. Hope you're all right? How are you getting on with this issue? Don't forget to reach out if you have any problem.

Hello @madeofhuman! Sorry I didn't answer as I didn't see any notification. I think I will /unclaim this issue because I didn't have time yet to start it after a few days. I will come back if I have enough time again. Thank you!

That's ok @helenatxu, maybe @shubhi2000 would like to take this one over for now and we can make one for you when you're ready? You can always ask and we will make one.

https://github.com/publiclab/plots2/issues/4963

@jywarren sure, I will take this issue and work on it.

great!

On Tue, Mar 19, 2019 at 8:55 PM Helena Moreno ChacΓ³n <
[email protected]> wrote:

Hello @madeofhuman https://github.com/madeofhuman! Sorry I didn't
answer as I didn't see any notification. I think I will /unclaim this issue
because I didn't have time yet to start it after a few days. I will come
back if I have enough time again. Thank you!

β€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/5021#issuecomment-474641336,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ8Ahk8-DHGpLZydWTj_-AfTtxWgMks5vYYbEgaJpZM4bpuZc
.

I added a conditional statement to run tags.each only when tags has a non-null value, and then I created a PR. Out of 3 checks on my PR, 2 checks were successful and 1 check failed. Since, it is my first PR, I didn't know that I need to tick the checkboxes before proposing the PR. So, the check failure is because of not checking the boxes or something else needs to be done with the code? Please help me regarding this.

Okay so I am not sure why this file is being used here in the profile page. This file was just written for multiple tag subscription, and I don't know why it is linked to links in the profile page. Besides, if tags are empty, that is already being checked here:

<% if @node && [email protected]_tags.empty? && ((current_user && @node.liked_by(current_user.uid)) || !current_user) %>

Let's try and find out what's happening here

Finally found the bug! The file that needs to be changes here is not _tags_popover.html.erb, its tag/show.html.erb. The subscribe_button partial is being called there and the nil condition is not being checked there. I am EDITING this issue here only since @madeofhuman reported this issue in the first place! @shubhi2000 you can close your previous PR and create a new PR according to the new changes. Thanks a ton everyone!

@IshaGupta18 okay, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cesswairimu picture cesswairimu  Β·  119Comments

CleverFool77 picture CleverFool77  Β·  73Comments

SidharthBansal picture SidharthBansal  Β·  142Comments

jywarren picture jywarren  Β·  154Comments

grvsachdeva picture grvsachdeva  Β·  183Comments