FriendsOfFlarum / discussion-language

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

Incompatibility with flarum/sticky #31

Closed iamdarkle closed 11 months ago

iamdarkle commented 2 years ago

Bug Report

The flarum/sticky extension stops working properly in discussions when this extension is activated, sticky posts are lost chronologically among new posts, not only for users (without having seen the post), but also for guests.

clarkwinkelmann commented 2 years ago

The Sticky extension essentially disables itself as soon as any search of filter is applied to a view. With this extension enabled, this means Sticky almost always disables itself.

Sticky has an explicit whitelist for TagFilterGambit. Ideally we should have a way to plug LanguageFilterGambit into that whitelist... But Flarum doesn't have any API to achieve that at the moment.

https://github.com/flarum/framework/blob/v1.5.0/extensions/sticky/src/PinStickiedDiscussionsToTop.php#L27-L37

The only workaround would be to re-implement the whole PinStickiedDiscussionsToTop for when a language filter is active in this extension... I think the work would be better put on core to make the whitelist extensible.