diff --git a/controllers/class.rankcontroller.php b/controllers/class.rankcontroller.php
index 06390e2..0d49938 100644
--- a/controllers/class.rankcontroller.php
+++ b/controllers/class.rankcontroller.php
@@ -189,14 +189,14 @@ class RankController extends DashboardController {
* @param int $RankID
* @param string $TransientKey
*/
- public function DeletePhoto($RankID = FALSE, $TransientKey = '') {
+ public function DeletePhoto($TransientKey = '') {
// Check permission
$this->Permission('Garden.Ranks.Manage');
- $RedirectUrl = 'yaga/rank/edit/'.$RankID;
+ $RedirectUrl = 'yaga/rank/settings';
if (Gdn::Session()->ValidateTransientKey($TransientKey)) {
- $this->RankModel->SetField($RankID, 'Photo', NULL);
+ SaveToConfig('Yaga.Ranks.Photo', NULL);
$this->InformMessage(T('Yaga.RankPhotoDeleted'));
}
diff --git a/views/rank/settings.php b/views/rank/settings.php
index efd7583..ddfd7f4 100644
--- a/views/rank/settings.php
+++ b/views/rank/settings.php
@@ -12,7 +12,7 @@ echo $this->Form->Errors();
$Photo = C('Yaga.Ranks.Photo');
if($Photo) {
echo Img(Gdn_Upload::Url($Photo));
- echo '
'.Anchor(T('Delete Photo'), 'rank/deletephoto', 'SmallButton Danger PopConfirm');
+ echo '
'.Anchor(T('Delete Photo'), CombinePaths(array('rank/deletephoto', Gdn::Session()->TransientKey())), 'SmallButton Danger PopConfirm');
}
echo $this->Form->Input('PhotoUpload', 'file');
echo $this->Form->Close('Save');