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

Wiki tag page showing only one entry #6825

Closed
jywarren opened this issue Nov 20, 2019 · 9 comments
Closed

Wiki tag page showing only one entry #6825

jywarren opened this issue Nov 20, 2019 · 9 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute Ruby

Comments

@jywarren
Copy link
Member

https://publiclab.org/wiki/tag/project:featured should show ~ 3 wiki pages, but it shows only one.

An example of one not appearing is: https://publiclab.org/wiki/the-sand-sentinel-program

Not sure why this is happening! The code for this is here;

node_type = if %w(questions note).include?(@node_type)
'note'
elsif @node_type == 'wiki'
'page'
elsif @node_type == 'maps'
'map'
elsif @node_type == 'contributors'
'contributor'
end
if params[:id][-1..-1] == '*' # wildcard tags
@wildcard = true
@tags = Tag.where('name LIKE (?)', params[:id][0..-2] + '%')
nodes = Node.where(status: 1, type: node_type)
.includes(:revision, :tag, :answers)
.references(:term_data, :node_revisions)
.where('term_data.name LIKE (?) OR term_data.parent LIKE (?)', params[:id][0..-2] + '%', params[:id][0..-2] + '%')
.paginate(page: params[:page], per_page: 24)
.order(order_by)
else
@tags = Tag.where(name: params[:id])
if @node_type == 'questions'
other_tag = if params[:id].include? "question:"
params[:id].split(':')[1]
else
"question:" + params[:id]
end
nodes = Node.where(status: 1, type: node_type)
.includes(:revision, :tag)
.references(:term_data, :node_revisions)
.where('term_data.name = ? OR term_data.name = ? OR term_data.parent = ?', params[:id], other_tag, params[:id])
.paginate(page: params[:page], per_page: 24)
.order(order_by)
else
nodes = Node.where(status: 1, type: node_type)
.includes(:revision, :tag)
.references(:term_data, :node_revisions)
.where('term_data.name = ? OR term_data.parent = ?', params[:id], params[:id])
.paginate(page: params[:page], per_page: 24)
.order(order_by)

We'd love help debugging this!

@jywarren jywarren added bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute Ruby labels Nov 20, 2019
@jywarren jywarren added this to the Tagging and topics milestone Nov 20, 2019
@jywarren
Copy link
Member Author

Very strange, but this page doesn't suffer the same issue!

https://publiclab.org/wiki/tag/project

@jywarren
Copy link
Member Author

Could it relate to power tags?

@jywarren
Copy link
Member Author

Could it be related to this issue? Needs testing on the console! #3248

@jywarren
Copy link
Member Author

Note this returns 4 items, which is correct:

t = Tag.where('term_data.name IN (?)', 'project:featured')
=> #<ActiveRecord::Relation [#<Tag tid: 23372, vid: 3, name: "project:featured", description: "", weight: 0, count: 4, parent: nil>]>

However this returns only 1:

Tag.find_nodes_by_type('project:featured', 'page')

@NitinBhasneria
Copy link
Collaborator

@jywarren Is this issue closed.

@jywarren
Copy link
Member Author

jywarren commented Oct 6, 2020

This is an iteration of #7334 which is now solved!

@jywarren jywarren closed this as completed Oct 6, 2020
@jywarren
Copy link
Member Author

jywarren commented Oct 7, 2020

Ah, i'm seeing only 2 now but 3 are listed in the tab; reopening for a closer look - could be a "ghost node" or something... an irregular record of some kind, like in #7334 (comment)

Screen Shot 2020-10-06 at 10 45 22 PM

@jywarren jywarren reopened this Oct 7, 2020
@jywarren
Copy link
Member Author

jywarren commented Oct 7, 2020

Oh wait, the live site didn't pull the latest changes. Need to recheck the current commit on the live site and this could indeed be solved... https://jenkins.laboratoriopublico.org/job/Deploy%20Plots2/74/

@jywarren
Copy link
Member Author

jywarren commented Oct 7, 2020

OK, it published now and it worked! 4 and 4!

@jywarren jywarren closed this as completed Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute Ruby
Projects
None yet
Development

No branches or pull requests

2 participants