fix(branding): socials + promo round-trip from DB to form (#460)
formatBrandingSettings was updated when the BrandingSettings interface added the footer-overhaul fields (#441 / #440), so the admin BrandingPage initialised them as empty strings on every load. Saving any other field then sent the form's empty socials / promo_markdown / promo_position back to the backend and wiped the saved values from the DB. The public gallery footer kept rendering the old values until the next save, which is why the bug appeared asymmetric (visible to galleries, gone from the admin form). Add the missing read mappings for the seven branding_* keys so the form round-trips them correctly. Reported by @Rekoo-PS in #460 (split out of #447).
This commit is contained in:
@@ -323,7 +323,20 @@ export const settingsService = {
|
||||
login_logo_frame_enabled: this._parseBoolean(rawSettings.branding_login_logo_frame_enabled, true),
|
||||
login_logo_size: ['small', 'medium', 'large', 'xlarge'].includes(rawSettings.branding_login_logo_size)
|
||||
? rawSettings.branding_login_logo_size
|
||||
: 'medium'
|
||||
: 'medium',
|
||||
// Footer overhaul (#441 + #440 / #460). These were added to the
|
||||
// BrandingSettings interface but not to the read mapper, so the
|
||||
// BrandingPage form initialised them as empty strings on every
|
||||
// load. The next save then sent the empty form back to the
|
||||
// backend and wiped the saved values from the DB — even though
|
||||
// the gallery footer kept rendering them until the next save.
|
||||
facebook_url: rawSettings.branding_facebook_url || '',
|
||||
instagram_url: rawSettings.branding_instagram_url || '',
|
||||
whatsapp_url: rawSettings.branding_whatsapp_url || '',
|
||||
twitter_url: rawSettings.branding_twitter_url || '',
|
||||
youtube_url: rawSettings.branding_youtube_url || '',
|
||||
promo_markdown: rawSettings.branding_promo_markdown || '',
|
||||
promo_position: rawSettings.branding_promo_position === 'below_footer' ? 'below_footer' : 'above_footer'
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user