FriendsOfFlarum / discussion-language

Specify the language a discussion is written in & sort by language
MIT License
6 stars 2 forks source link

WIP: Missing Language id in certain cases #53

Closed DavideIadeluca closed 10 months ago

DavideIadeluca commented 10 months ago

This PR tries to address an issue when fof/discussion-language is used in combination with fof/follow-tags.

Problem Description:

Summary:

Notes:

imorland commented 10 months ago

I can see where you are coming from here, and the underlying problem. However, the intention is that if dl_language_id is null, then the user does not want to restrict notifications to a particular language, and will therefore receive notifications for any language.

DavideIadeluca commented 10 months ago

Okay, so I think I know what's going on now. By default, the setting to show "Any Language" as an option is enabled. Then, when following a tag, the option "Any language" is also selected by default.

In this case, it makes totally sense to don't pass any language id. And if the user only wants to follow a certain language, then the onclick handler is called and the respective language id passed.

The confusion stems from when the setting to show "Any Language" as an option is disabled. In this case, a language is visually already "selected" in the dropdown, but no onclick handlers are being called, when left unchanged, which are needed for the id to be passed as far as I understand.

I guess this would a case that needs to be covered?

imorland commented 10 months ago

Superseded by https://github.com/FriendsOfFlarum/discussion-language/pull/55