Closed amdrade closed 9 years ago
My proposed solution in ../core/controllers/admin/ETSettingsAdminController.class.php
changes the type checking forumHeader
if ($form->validPostBack("save")) {
$forumHeader = false;
if ($form->getValue("forumHeader") == "image"){
if ($form->getValue("forumHeaderOld") != "image"){
$forumHeader = $this->uploadHeaderImage($form);
}else{
$forumHeader = !empty($_FILES["forumHeaderImage"]['tmp_name']) ? $this->uploadHeaderImage($form) : C("esoTalk.forumLogo");
}
}
// Construct an array of config options to write.
$config = array(
"esoTalk.forumTitle" => $form->getValue("forumTitle"),
"esoTalk.language" => $form->getValue("language"),
//"esoTalk.forumLogo" => $form->getValue("forumHeader") == "image" ? $this->uploadHeaderImage($form) : false,
"esoTalk.forumLogo" => $forumHeader,
"esoTalk.defaultRoute" => $form->getValue("defaultRoute"),
"esoTalk.visibleToGuests" => $form->getValue("forumVisibleToGuests"),
"esoTalk.members.visibleToGuests" => $form->getValue("forumVisibleToGuests") and $form->getValue("memberListVisibleToGuests"),
"esoTalk.registration.open" => $form->getValue("registrationOpen"),
"esoTalk.registration.requireConfirmation" => in_array($v = $form->getValue("requireConfirmation"), array(false, "email", "approval")) ? $v : false,
);
and in ../core/views/admin/settings.php
add the input $form->input("forumHeaderOld", "hidden", array("value" => $form->values['forumHeader']));
if a new configuration, try to send the image, the image was chosen replace if not keep the previous
It is easier for @tobscure to make a pull request for this.
I noticed this myself few days back. Kind of an annoying issue. Thank you for the pull-request.
Duplicate with https://github.com/esotalk/esoTalk/issues/328
Checking the option to show image at the top, choosing the image and saving after returning to the settings screen you must send the picture again if you want to make some other change