FIX: Unable to change homepage style via wizard (#19462)

Depending on the current state of things, sometimes the homepage style
wouldn't update because we were incorrectly blocking updates the
`desktop_category_page_style` site setting if the first item in the top
menu was 'categories'.

Added a test case to handle this situation.

See https://meta.discourse.org/t/248354
This commit is contained in:
Blake Erickson
2022-12-13 17:52:59 -07:00
committed by GitHub
parent d147e92953
commit 492f68c462
2 changed files with 22 additions and 1 deletions

View File

@ -166,7 +166,7 @@ class Wizard
if updater.fields[:homepage_style] == 'latest' && top_menu[0] != "latest"
top_menu.delete("latest")
top_menu.insert(0, "latest")
elsif updater.fields[:homepage_style] != 'latest' && top_menu[0] != "categories"
elsif updater.fields[:homepage_style] != 'latest'
top_menu.delete("categories")
top_menu.insert(0, "categories")
updater.update_setting(:desktop_category_page_style, updater.fields[:homepage_style])