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

Improve the way we deal with renamings for donors and donees #128

Closed
vipulnaik opened this issue May 18, 2020 · 4 comments
Closed

Improve the way we deal with renamings for donors and donees #128

vipulnaik opened this issue May 18, 2020 · 4 comments
Assignees

Comments

@vipulnaik
Copy link
Owner

vipulnaik commented May 18, 2020

A few ideas:

  • For both donors and donees, rename former_name to other_names and allow a pipe-separated list of possibilities.
  • When a query is made using donor.php, donee.php, donorDonee.php, search both the main donor or donee column and the other_names column.
@vipulnaik vipulnaik changed the title Improve the way we deal with renamings Improve the way we deal with renamings for donors and donees May 18, 2020
@riceissa
Copy link
Collaborator

riceissa commented May 19, 2020

Serving in multiple locations vs redirecting: I think I prefer redirecting, mainly so there's a canonical location, and to fit in with how existing sites like Wikipedia work. e.g. if someone goes to https://donations.vipulnaik.com/donor.php?donor=Open+Philanthropy+Project it should redirect to https://donations.vipulnaik.com/donor.php?donor=Open+Philanthropy rather than serving at the old location.

On the implementation:

  • one way is to have an outer redirection layer that takes any incoming requests, checks whether this is an old name, then just sends the user to the new location. The advantage of this is that as far as the rest of the MySQL tables and PHP code are concerned, there is only a single name for each entity (i.e. none of the existing MySQL/PHP needs to be modified).
  • another way is I think closer to what you are suggesting, where we go around modifying all the MySQL queries adding ... or other_names regexp $donor.

What do you think?

@vipulnaik
Copy link
Owner Author

vipulnaik commented May 19, 2020

@riceissa I agree that redirecting is the better option. Thanks for explaining.

Outer redirection layer sounds good, if you have a clear idea of how to pull it off.

riceissa added a commit that referenced this issue May 19, 2020
riceissa added a commit that referenced this issue May 19, 2020
riceissa added a commit that referenced this issue May 19, 2020
riceissa added a commit that referenced this issue May 19, 2020
@riceissa
Copy link
Collaborator

riceissa commented May 19, 2020

Ok, I think this is working.

https://github.com/vipulnaik/donations/tree/better-renamings

You can try with e.g. /donee.php?donee=Singularity Institute for Artificial Intelligence (note: Open Phil will not work as a test case because we still haven't filled in an other_names for it)

FYI this actually allows us to use "short URLs", e.g. /donee.php?donee=MIRI if we ever want to (it will just require adding |MIRI to other_names)

vipulnaik pushed a commit that referenced this issue Dec 15, 2020
vipulnaik pushed a commit that referenced this issue Dec 15, 2020
vipulnaik pushed a commit that referenced this issue Dec 15, 2020
vipulnaik pushed a commit that referenced this issue Dec 15, 2020
vipulnaik added a commit that referenced this issue Dec 15, 2020
* Rename "former_name" column to "other_names"

For #128.

* Redirect from donor.php

For #128.

* Add redirect for donee.php

For #128.

* Add redirect for donorDonee.php

For #128.

Co-authored-by: Issa Rice <riceissa@gmail.com>
@vipulnaik
Copy link
Owner Author

vipulnaik commented Dec 15, 2020

I made a PR for easier review of changes, and have merged the PR. It's live now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants