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

Fixes #11379: Made the subtopics method #11380

Closed
wants to merge 12 commits into from
6 changes: 6 additions & 0 deletions test/fixtures/node_tags.yml
Expand Up @@ -284,3 +284,9 @@ sub_tag:
tid: 37
nid: 1
uid: 2

subtopic_tag:
tid: 38
uid: 2
nid: 41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but it's applied to this page, which is a note, not a wiki:

https://github.com/KarishmaVanwari/plots2/blob/subtopics/test/fixtures/nodes.yml#L497

Will that affect the logic, and possibly cause it not to return things?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it should get the slug for this note, and try to use it as a subtopic tagname, according to this logic:

https://github.com/publiclab/plots2/pull/11380/files#diff-5d60373322d4baf080e5f3957fc30d0e8058337c202f5641e1775402776428b1R533

Aha - yes, so, then it takes the slug from that page, which is "jeff-12-20-2020-ouija-board" - and tries to find a tag with that name. It doesn't find one, so it returns null.

Let's change this to instead point at this node, which is a page, with slug about. Then let's add a new tag with the name about so that there is actually a tag that can be returned.

We could give these more realistic tag names so it makes more sense... but, maybe it's not worth it for now. Let's just get it working first.

Suggested change
nid: 41
nid: 2

So now you'll also have to add a new tags.yml entry, but it doesn't need a node_tags.yml entry, since we only look if the tag exists, not if we used it anywhere. Let's see how that works!

date: <%= DateTime.now.to_i %>
4 changes: 4 additions & 0 deletions test/fixtures/tags.yml
Expand Up @@ -150,3 +150,7 @@ hidden_response_tag:
subscribed_tag:
tid: 37
name: sub:tag

subtopic_tag:
tid: 38
name: parent:one