plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Redirected pages not listed in wildcard tag listing

Open jywarren opened this issue 9 years ago • 18 comments

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @jywarren to get it labelled. Or, if this is not your first time, try to solve it yourself!


Background

Some pages have a tag like redirect:pagename where pagename is the name of another page which the viewer should be automatically redirected to. Documentation:

https://publiclab.org/wiki/power-tags (look for redirect)

This behavior is captured (at the controller level) in this test:

https://github.com/publiclab/plots2/blob/master/test/functional/wiki_controller_test.rb#L507-L516

Problem

These redirected pages should be listed on this tag listing page for wiki pages, using the wildcard redirect:* -- but nothing is shown there:

https://publiclab.org/wiki/tag/redirect:*

There are definitely redirected pages, like this one:

https://publiclab.org/wiki/camera-triggering

Next steps

We should write a functional test to ensure that such tags appear on that tag listing page. There is already one for notes, but the separate action to display wiki pages is not tested:

https://github.com/publiclab/plots2/blob/master/test/functional/tag_controller_test.rb#L160-L167

I believe it uses the same action, but changes the params[:node_type] parameter:

https://github.com/publiclab/plots2/blob/master/app/controllers/tag_controller.rb#L23-L25

Once the test correctly describes this bug, changes to the tag controller will be able to resolve the problem.

jywarren avatar Feb 26 '17 18:02 jywarren

I will take up the issue

StlMaris123 avatar Feb 27 '17 09:02 StlMaris123

Yes please, we appreciate it!

jywarren avatar Mar 01 '17 16:03 jywarren

@jywarren Could you please make sure if he's working on it and remove the fto-candidate label if that's the case? Cutting down on fto-candidates. Thanks.

ryzokuken avatar Mar 01 '17 20:03 ryzokuken

Hi, @StlMaris123 - would you like me to assign this issue to you, or are you working on another (I think i've seen your PR on another)? Thanks!

jywarren avatar Mar 02 '17 21:03 jywarren

Yes, I will work on both. If i encounter any challenge i will get to you

StlMaris123 avatar Mar 03 '17 11:03 StlMaris123

Great!

jywarren avatar Mar 03 '17 20:03 jywarren

@jwarren I want to work on this. Can I..?

MayankKashyap avatar Mar 05 '17 21:03 MayankKashyap

@StlMaris123 - are you currently working on this, and if not, could @MayankKashyap give it a try? But there are plenty to go around, so Mayank, if you have already claimed another please let @StlMaris123 have a try at this. Thanks, all!

jywarren avatar Mar 06 '17 22:03 jywarren

@jwarren https://github.com/jwarren yes am on it, i just finished the other issue so am on this one now. Am sorry for taking too long

On Tue, Mar 7, 2017 at 1:23 AM, Jeffrey Warren [email protected] wrote:

@StlMaris123 https://github.com/StlMaris123 - are you currently working on this, and if not, could @MayankKashyap https://github.com/MayankKashyap give it a try? But there are plenty to go around, so Mayank, if you have already claimed another please let @StlMaris123 https://github.com/StlMaris123 have a try at this. Thanks, all!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1293#issuecomment-284553570, or mute the thread https://github.com/notifications/unsubscribe-auth/AMdR2bTfr0XRAOJb5ySHh3jVa8jAoXvdks5rjIdcgaJpZM4MMeFv .

StlMaris123 avatar Mar 07 '17 06:03 StlMaris123

Hello @jywarren , how about this test?

 test "should show a featured wiki page at top, if it exists" do
    tag = tags(:test)

    get :show, id: node(:organizers).slug

    assert_select '#wiki-content', 1
end 

StlMaris123 avatar Mar 09 '17 07:03 StlMaris123

is there a relationship between it and what am supposed to test?

StlMaris123 avatar Mar 09 '17 07:03 StlMaris123

Hello Jeffrey, please shed some light on Redirected pages not listed in wildcard tag listing #1293. I am having trouble understanding the problem part. I will really appreciate your help. Thank you. Warm regards, Stella.

On Tue, Mar 7, 2017 at 9:23 AM, stellamaris njage < [email protected]> wrote:

@jwarren https://github.com/jwarren yes am on it, i just finished the other issue so am on this one now. Am sorry for taking too long

On Tue, Mar 7, 2017 at 1:23 AM, Jeffrey Warren [email protected] wrote:

@StlMaris123 https://github.com/StlMaris123 - are you currently working on this, and if not, could @MayankKashyap https://github.com/MayankKashyap give it a try? But there are plenty to go around, so Mayank, if you have already claimed another please let @StlMaris123 https://github.com/StlMaris123 have a try at this. Thanks, all!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1293#issuecomment-284553570, or mute the thread https://github.com/notifications/unsubscribe-auth/AMdR2bTfr0XRAOJb5ySHh3jVa8jAoXvdks5rjIdcgaJpZM4MMeFv .

StlMaris123 avatar Mar 20 '17 19:03 StlMaris123

Hi, @StlMaris123 -- my sincere apologies for responding so slowly to this. I must've missed it and am reading it over now. Thank you so much for your patience!

jywarren avatar Mar 21 '17 18:03 jywarren

Hi, so, we're looking to test something very similar to this test:

  test "wildcard tag show" do
    get :show, id: 'question:*'
    assert :success
    assert_not_nil :tags
    assert :wildcard

    assert_select '#note-graph', 0
  end

But with an additional parameter, :node_type, so we check for wiki pages, not notes:

  test "wildcard tag show wiki pages" do
    get :show, id: 'question:*', node_type: 'wiki'
    assert :success
    assert_not_nil :tags
    assert :wildcard

    assert_select '#note-graph', 0
  end

Can you try that out and see if you get an error when you run the test? If so, that's the error we've identified and we should start figuring out how to fix it. Thanks!

jywarren avatar Mar 21 '17 18:03 jywarren

Thanks. Working on it now

StlMaris123 avatar Mar 21 '17 18:03 StlMaris123

Hi @jywarren the tests are passing locally

StlMaris123 avatar Mar 21 '17 19:03 StlMaris123

Hmm, I suppose that means we haven't​completely reproduced the bug. Are you sure there exists a wiki page in the tests that fairly closely matches the one described in the bug report? Are we asserting the right things?

On Mar 21, 2017 3:06 PM, "StellaMaris Njage" [email protected] wrote:

Hi @jywarren https://github.com/jywarren the tests are passing locally

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1293#issuecomment-288185956, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJyUuw05-EiFpq_Ieq9VFcsvGCJfWks5roB-3gaJpZM4MMeFv .

jywarren avatar Mar 21 '17 19:03 jywarren

I think there is a difference between the two tests.One tests for a featured wiki page if it exists while the other one tests for a wiki page after the wikd card

StlMaris123 avatar Mar 21 '17 19:03 StlMaris123