Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Update themes javascript cache after running themes migrations #25562

Merged

Conversation

tgxworld
Copy link
Contributor

@tgxworld tgxworld commented Feb 5, 2024

Why this change?

This is caused by a regression in
59839e4, where we stopped saving the
Theme object because it was unnecessary. However, it resulted in the
after_save callback not being called and hence
Theme#update_javascript_cache! not being called. As a result, some
sites were reporting that after runing a theme migration, the defaults
for the theme settings were used instead of the settings overrides
stored in the database.

What does this change do?

Add a call to Theme#update_javascript_cache! after running theme
migrations.

Why this change?

This is caused by a regression in
59839e4, where we stopped saving the
`Theme` object because it was unnecessary. However, it resulted in the
`after_save` callback not being called and hence
`Theme#update_javascript_cache!` not being called. As a result, some
sites were reporting that after runing a theme migration, the defaults
for the theme settings were used instead of the settings overrides
stored in the database.

What does this change do?

Add a call to `Theme#update_javascript_cache!` after running theme
migrations.
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/why-are-custom-header-links-overridden/293359/11

@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/footer-text-doesnt-populate-after-recent-update/293906/3

Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@tgxworld tgxworld merged commit d460229 into discourse:main Feb 5, 2024
19 checks passed
@tgxworld tgxworld deleted the clear_javascript_cache_after_migration branch February 5, 2024 06:35
renato pushed a commit to renato/discourse that referenced this pull request Feb 29, 2024
…iscourse#25562)

Why this change?

This is caused by a regression in
59839e4, where we stopped saving the
`Theme` object because it was unnecessary. However, it resulted in the
`after_save` callback not being called and hence
`Theme#update_javascript_cache!` not being called. As a result, some
sites were reporting that after runing a theme migration, the defaults
for the theme settings were used instead of the settings overrides
stored in the database.

What does this change do?

Add a call to `Theme#update_javascript_cache!` after running theme
migrations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants