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

Don't let campaign levels be deleted #523

Merged
merged 1 commit into from Oct 4, 2018

Conversation

Projects
None yet
3 participants
@bls1999
Contributor

bls1999 commented Sep 2, 2018

Before deleting a level, the server will check to see if the level is in a Campaign. If it is, it won't let the user delete the level.

This has happened before. While it's not a common thing (it's only happened about 1-5 times in PR2's history), I think it's probably best to have this check to save you the trouble of having to restore it if it happens. Just in case; especially with new Campaign levels every month from Campaign of the Month!

(I also can't test this without making tons of dummy levels on my localhost, so just take a gander and make sure everything looks up to par.)

Also, please run this query on the database:

UPDATE `pr2_levels`
  SET `live` = "1"
  WHERE `level_id` = 1442589;

EDIT: To be clear, this protects against a level being deleted via the delete_level.php script, meaning the creator cannot delete the level. The reason I didn't add this to the mods' remove_level.php is that remove_level.php only unpublishes the level, and the script that fills the Campaign ignores whether or not the level is published.

Don't let campaign levels be deleted
This has happened before. While it's not a common thing (I think it's only happened 1-5 times in PR2's history), I think it's probably best to have this check just in case.
@bls1999

This comment has been minimized.

Contributor

bls1999 commented Sep 3, 2018

Travis Status for this branch (idk why it isn't showing on its own): Build Status

@jacob-grahn jacob-grahn merged commit ebe983c into jacob-grahn:master Oct 4, 2018

@bls1999 bls1999 deleted the bls1999:campaign-level-lock branch Oct 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment