Closed jywarren closed 3 years ago
@jywarren I would like to work on this please
Can i work on this @jywarren
I appreciate your offers of help! I'm not sure this one will be easy to solve without a copy of the full database or access to a console. I apologize!!!
ok I understand , thanks for replying.
Gosh this is mysterious. I looked for all NodeTags with both tid = 14751 ('project') and nid = 18422 (our mysterious wiki page) and it returns nothing ([]).
But:
> Node.where(nid: NodeTag.where(tid:14751).collect(&:nid),slug:"name-your-project-here")
=> #<ActiveRecord::Relation [#<Node nid: 24653, vid: 44087, type: "page", language: "", title: "Name your project here", uid: 721831, status: 1, created: 1601087860, changed: 1601087860, comment: 0, promote: 0, moderate: 0, sticky: 0, tnid: 0, translate: 0, cached_likes: 0, comments_count: 0, drupal_node_revisions_count: 1, path: "/wiki/name-your-project-here", main_image_id: nil, slug: "name-your-project-here", views: 0, latitude: nil, longitude: nil, precision: nil, flag: 0>]>
I'm missing something obvious?
Ah, strangely i guess i had the nid wrong: this does return the record:
irb(main):034:0> NodeTag.where(tid:14751,nid:24653)
And there's the issue. There are 2 records for this page:
irb(main):035:0> Node.find(18422)
=> #<Node nid: 18422, vid: 41802, type: "page", language: "", title: "Coastal Construction Crew 504: Investigating Coast...", uid: 518193, status: 1, created: 1551131573, changed: 1633305497, comment: 0, promote: 0, moderate: 0, sticky: 0, tnid: 0, translate: 0, cached_likes: 0, comments_count: 0, drupal_node_revisions_count: 3, path: "/wiki/name-your-project-here", main_image_id: nil, slug: "name-your-project-here", views: 210, latitude: nil, longitude: nil, precision: nil, flag: 8>
irb(main):036:0> Node.find(24653)
=> #<Node nid: 24653, vid: 44087, type: "page", language: "", title: "Name your project here", uid: 721831, status: 1, created: 1601087860, changed: 1601087860, comment: 0, promote: 0, moderate: 0, sticky: 0, tnid: 0, translate: 0, cached_likes: 0, comments_count: 0, drupal_node_revisions_count: 1, path: "/wiki/name-your-project-here", main_image_id: nil, slug: "name-your-project-here", views: 0, latitude: nil, longitude: nil, precision: nil, flag: 0>
The latter one, which was hidden by the other, has the project
tag. I'll delete it and the node.
This page: https://publiclab.org/wiki/name-your-project-here
is appearing in a list of pages tagged with
project
:https://publiclab.org/wiki/projects#Example+Project+Pages
Very oddly, it happens when we run the matching db query:
Working from this code which returns the "Name your project here" page --
https://github.com/publiclab/plots2/blob/c069cfbec093ede01d8731d3b60b91b452b5f84e/app/models/node.rb#L622-L625
But not sure why! See, it has no
project
tag:Hmmmm, very strange! This bears some more investigation 🕵️