Skip to content

Commit

Permalink
Fix logo/icon upload in site setting for dnnsoftware#3722
Browse files Browse the repository at this point in the history
  • Loading branch information
gbulicanu committed May 15, 2020
1 parent 4e2b45d commit a271a59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ export default class FileUpload extends Component {
if (this.props.folderName && typeof this.props.folderName === "string") {
formData.append("folder", this.props.folderName);
}
if (this.props.validationCode && typeof this.props.validationCode === "string") {
formData.append("validationCode", this.props.validationCode);
}
sf.postfile(`UploadFromLocal${this.props.portalId === -1 ? "" : "?portalId=" + this.props.portalId}` , formData, this.uploadComplete.bind(this), this.handleError.bind(this));
this.setState({ uploading: true, uploadComplete: false });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class BasicSettingsPanelBody extends Component {
portalId={props.portalId}
selectedFile={state.basicSettings.LogoFile}
folderName={state.basicSettings.LogoFile ? state.basicSettings.LogoFile.FolderName : null}
validationCode={state.basicSettings.ValidationCode}
onSelectFile={this.onSettingChange.bind(this, "LogoFile") }
fileFormats={["image/png", "image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/jpeg", "image/svg+xml"]}
browseButtonText={resx.get("BrowseButton")}
Expand Down Expand Up @@ -289,6 +290,7 @@ class BasicSettingsPanelBody extends Component {
portalId={props.portalId}
selectedFile={state.basicSettings.FavIcon}
folderName={state.basicSettings.FavIcon ? state.basicSettings.FavIcon.FolderName : null}
validationCode={state.basicSettings.ValidationCode}
onSelectFile={this.onSettingChange.bind(this, "FavIcon") }
fileFormats={["image/x-icon", "image/ico"]}
browseButtonText={resx.get("BrowseButton")}
Expand Down Expand Up @@ -394,6 +396,7 @@ function mapStateToProps(state) {
timeZones: state.siteInfo.timeZones,
iconSets: state.siteInfo.iconSets,
clientModified: state.siteInfo.clientModified,
portalId: state.siteInfo ? state.siteInfo.portalId : undefined,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using DotNetNuke.UI.Internals;
using DotNetNuke.UI.Skins;
using DotNetNuke.Web.Api;
using DotNetNuke.Web.UI.WebControls;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -139,6 +140,7 @@ public HttpResponseMessage GetPortalSettings(int? portalId, string cultureCode)
fileId = favIcon.FileId,
folderId = favIcon.FolderId
} : null,
new DnnFileUploadOptions().ValidationCode,
IconSet = PortalController.GetPortalSetting("DefaultIconLocation", pid, "Sigma", cultureCode).Replace("icons/", "")
};
return Request.CreateResponse(HttpStatusCode.OK, new
Expand Down

0 comments on commit a271a59

Please sign in to comment.