Skip to content

FIX: Add new attribute that is required when using the basic topic serializer #375

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

Merged
merged 2 commits into from
May 20, 2025

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented May 20, 2025

In discourse/discourse#32618 we added the dependency on locales to the basic topic serializer gated behind SiteSetting.experimental_content_localization. This is so that fancy_titles can be rendered in the language of the user.

Error:

ActiveModel::MissingAttributeError (missing attribute 'locale' for Topic)

This PR adds that dependency to extra_data_pluck_fields which lists fields required from the serializer.

Reviewer note: The test will pass despite not adding locale, as the experimental setting is false by default. Once this experimental setting is removed, the test will be effective to check that the BasicTopicSerializer serializes without errors. Also, I had considered making the check in core less reliant on the locale attribute, but I believe we should not need to update core for a plugin.

@nattsw nattsw merged commit a0a7f8d into main May 20, 2025
6 checks passed
@nattsw nattsw deleted the fix-topic-queries branch May 20, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants