FIX: Wizard branding step null logo (#30523)

Followup 3135f472e2

Fixes an issue where the wizard branding step would
error if SiteSetting.logo was null, this did not come
up during testing because in our testing discourse-logo-sketch-small.png
is used for the logo settings.
This commit is contained in:
Martin Brennan 2025-01-02 10:44:31 +10:00 committed by GitHub
parent 3135f472e2
commit 9a12eb5c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,7 @@ export default class Image extends Component {
hasUpload() { hasUpload() {
return ( return (
!this.uploading && !this.uploading &&
this.field.value &&
!this.field.value.includes("discourse-logo-sketch-small.png") !this.field.value.includes("discourse-logo-sketch-small.png")
); );
} }

View File

@ -59,6 +59,11 @@ describe "Wizard", type: :system do
let(:file_path_1) { file_from_fixtures("logo.png", "images").path } let(:file_path_1) { file_from_fixtures("logo.png", "images").path }
let(:file_path_2) { file_from_fixtures("logo.jpg", "images").path } let(:file_path_2) { file_from_fixtures("logo.jpg", "images").path }
before do
SiteSetting.logo = nil
SiteSetting.logo_small = nil
end
it "lets user configure logos" do it "lets user configure logos" do
wizard_page.go_to_step("branding") wizard_page.go_to_step("branding")
expect(wizard_page).to be_on_step("branding") expect(wizard_page).to be_on_step("branding")