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

Remove references to "place" and "tool" node types #714

Closed
jywarren opened this issue Aug 20, 2016 · 21 comments · Fixed by #9719
Closed

Remove references to "place" and "tool" node types #714

jywarren opened this issue Aug 20, 2016 · 21 comments · Fixed by #9719
Labels
enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute Ruby

Comments

@jywarren
Copy link
Member

These are now completely gone from the database, and we can remove that code. All those types have been converted to "page" and we can just use "page" in those queries now.

There are instances in a few places, including:

https://github.com/publiclab/plots2/blob/master/app/controllers/wiki_controller.rb#L267

for example. Other file that include these are:

https://github.com/publiclab/plots2/blob/master/app/controllers/notes_controller
https://github.com/publiclab/plots2/blob/master/app/controllers/tag_controller

https://github.com/publiclab/plots2/blob/master/app/models/drupal_node.rb
https://github.com/publiclab/plots2/blob/master/app/models/drupal_users.rb
https://github.com/publiclab/plots2/blob/master/app/models/drupal_tag.rb

There may be more instances as well. But there are none in the fixtures, so in removing all these, tests should still pass.

@jywarren jywarren added enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute Ruby labels Aug 20, 2016
@nickstaggs
Copy link
Collaborator

@jywarren I can take this one. Just so I understand what you want, the original line is:

.where("node_revisions.status = 1 AND node.status = 1 AND (type = 'page' OR type = 'tool' OR type = 'place')")

and the final product should be:

.where("node_revisions.status = 1 AND node.status = 1 AND type = 'page")

for all instances where place and tool node types occur?

@jywarren
Copy link
Member Author

Yes -- that's right! And note to self that we'll have to triple-check that
all tool and place pages have been converted over before merging this.
Thanks!

On Wed, Sep 21, 2016 at 2:35 PM, Nick Staggs notifications@github.com
wrote:

@jywarren https://github.com/jywarren I can take this one. Just so I
understand what you want, the original line is:

.where("node_revisions.status = 1 AND node.status = 1 AND (type = 'page' OR type = 'tool' OR type = 'place')")

and the final product should be:

.where("node_revisions.status = 1 AND node.status = 1 AND type = 'page")

for all instances where place and tool node types occur?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#714 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ_wgoMEBuyDCNY0mkShKWGphNX8Nks5qsXj9gaJpZM4JpLpI
.

@nickstaggs
Copy link
Collaborator

@jywarren could you assign this to me?

@jywarren
Copy link
Member Author

Absolutely -- done! Thanks!!

@jywarren
Copy link
Member Author

Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks!

@grvsachdeva
Copy link
Member

@jywarren is this issue solved?

@jywarren
Copy link
Member Author

jywarren commented Mar 25, 2019 via email

@grvsachdeva
Copy link
Member

Yes, it can!

@swathi-0901
Copy link
Contributor

@jywarren can I work on this issue?

@swathi-0901
Copy link
Contributor

@jywarren can I work on this issue?

@jywarren can u assign this to me?

@jywarren
Copy link
Member Author

jywarren commented Nov 25, 2019 via email

@cesswairimu
Copy link
Collaborator

UPDATE

The file links currently that still have this references are:

https://github.com/publiclab/plots2/blob/main/app/controllers/wiki_controller.rb
https://github.com/publiclab/plots2/blob/main/app/controllers/notes_controller.rb
https://github.com/publiclab/plots2/blob/main/app/models/node.rb
https://github.com/publiclab/plots2/blob/main/app/services/search_service.rb
e.g
https://github.com/publiclab/plots2/blob/main/app/controllers/wiki_controller.rb#L377 would ideally be change from
.where("status = 1 AND nid != 259 AND (type = 'page' OR type = 'tool' OR type = 'place') AND cached_likes >= 0")
to
.where("status = 1 AND nid != 259 AND type = 'page' AND cached_likes >= 0")

This could potentially be broken down to to ftos or worked on as one.

please note: some tests may fail after this and that will need to be fixed with this PR...No worries if you are new to testing we are willing to help once the changes are done. thanks

@anirudhprabhakaran3
Copy link
Member

@jywarren @cesswairimu should I make this into a bunch of FTOs? Or should I work on it?

@cesswairimu
Copy link
Collaborator

Hi @anirudhprabhakaran3 , either its great and will be highly appreciated..your call. thanks

@anirudhprabhakaran3
Copy link
Member

I think @KSVSC is working on this, if that's the case I'll take up some other issue!

@KSVSC
Copy link
Contributor

KSVSC commented May 29, 2021

I think @KSVSC is working on this, if that's the case I'll take up some other issue!

Yes, I am working on this. Thanks :)

@KSVSC
Copy link
Contributor

KSVSC commented Jun 1, 2021

@jywarren @cesswairimu @TildaDares Hi! I have opened a PR for this, kindly review it :)

@KSVSC
Copy link
Contributor

KSVSC commented Jun 3, 2021

UPDATE

The file links currently that still have this references are:

https://github.com/publiclab/plots2/blob/main/app/controllers/wiki_controller.rb
https://github.com/publiclab/plots2/blob/main/app/controllers/notes_controller.rb
https://github.com/publiclab/plots2/blob/main/app/models/node.rb
https://github.com/publiclab/plots2/blob/main/app/services/search_service.rb
e.g
https://github.com/publiclab/plots2/blob/main/app/controllers/wiki_controller.rb#L377 would ideally be change from
.where("status = 1 AND nid != 259 AND (type = 'page' OR type = 'tool' OR type = 'place') AND cached_likes >= 0")
to
.where("status = 1 AND nid != 259 AND type = 'page' AND cached_likes >= 0")

This could potentially be broken down to to ftos or worked on as one.

please note: some tests may fail after this and that will need to be fixed with this PR...No worries if you are new to testing we are willing to help once the changes are done. thanks

Hi, @cesswairimu. I believe that Line nos 22-28 needs to be removed too in the file https://github.com/publiclab/plots2/blob/main/app/controllers/legacy_controller.rb#L22-#L28. Please confirm and review my PR for this issue. Thanks!

@cesswairimu
Copy link
Collaborator

cesswairimu commented Jun 3, 2021

Hi @KSVSC on this https://github.com/publiclab/plots2/blob/main/app/controllers/legacy_controller.rb#L22-#L28 that is fine we can leave it as is...bacuse the request already redirects to /wiki

what we would like to remove is anywhere we are filtering nodes with the type 'page' OR 'tool'.

e.g select * from nodes where type='tool' -- we shouldn't have any query that has this type of filter...what do you think?

@KSVSC
Copy link
Contributor

KSVSC commented Jun 3, 2021

@cesswairimu, Agreed! I made the required modifications to my PR. Thanks!

@cesswairimu
Copy link
Collaborator

great 🎉 , thanks...reviewing in a few

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute Ruby
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants