
Hi everyone!
Flarum 2.0.2 is out! It's a patch release, full of fixes for things you've told us about since 2.0.1 was released a few days ago
Flarum 2.0.1 is out, plus a few we spotted ourselves along the way, and some welcome speed-ups. Thank you for all the reports, they really do make Flarum better for everyone.
What's fixed
Around the forum
- A short wait after too many wrong passwords. After several failed attempts to log in, the login form now asks you to wait a few minutes before trying again. If your forum sits behind a proxy or load balancer, make sure Flarum sees each visitor's real IP address, or everyone will share one limit. Thanks to Ari Suryo for reporting this!
- Likes are back on profile pages. The Posts tab on a member's profile wasn't showing likes, or other details extensions add to posts. It does now. Thanks @clarkwinkelmann for spotting it!
- Hidden groups count again. If your forum hides a group, such as the Admin group, its members are now treated as members of it everywhere. Before this, a moderator could be offered Suspend on an admin, members allowed to edit others' account details could see an admin's email address, and permissions given through a hidden group didn't always count.
- Bold text is back. Some messages that should show part of their text in bold were showing
{undefined} in its place. They now read properly again.
- Start typing straight away. When you open the composer to reply to or edit a post, your cursor now lands in the editor, ready to go. Thanks to HawkForge for the fix.
- Searches that leave something out keep working. If you searched with a filter like "not by this author" and then opened the full search, the "not" could get lost along the way. Also fixed by HawkForge.
- The header stays put. On computers that show scrollbars, the header no longer jumps sideways when a popup opens.
- The back button is the same size on every page. Thanks @huoxin233 for reporting it!
- Search stays steady while you type. The search popup no longer shifts sideways or jumps in height as its results change. Thanks again, @huoxin233!
- Odd links behave. A few malformed links, like /d/0, now show a proper "not found" page instead of an error. Thanks @Karl!
- Icons arrive faster on your first visit. On forums using Flarum's built-in icons (the default), each icon font now downloads once instead of twice. Thanks again, @Karl.
On your phone
- The × that clears a search now stays inside the search box in the menu.
- The Quote button that appears when you select text stays fully on screen, and out of the way of your phone's own selection handles. Thanks @CyberGene!
Deck and live updates
- Deck catches up. If new discussions or replies arrive while you're reading somewhere else on the forum, Deck now shows them when you come back. Thanks @GreXXL for reporting this, and HawkForge for the fix.
- Live updates don't go missing. When the realtime server receives two updates at the same moment, both now get through. Thanks @edgeinfinity1 for tracking that one down!
Installing Flarum
- If your server only has PostgreSQL or SQLite support, the installer no longer insists on the MySQL driver too. Thanks @TheRogue for letting us know!
Behind the scenes
- Profile pages and post lists are quicker. A member's posts, and the lists of posts someone liked or was mentioned in, now take around a quarter less work on the server and fewer database queries. That makes up for the extra details these pages show again now that likes are back. Opening a discussion got a little quicker too.
- Pages with lots of tags now need fewer database queries, and a couple of other small inefficiencies have been tidied up.
For extension developers
- Please update flarum/phpstan to 2.0.1. Until now,
composer analyse:phpstan installed a Flarum test site into whatever database your DB_* variables point at, dropping every table in it, the first time it ran in a fresh checkout (and on every run in CI). It now installs into a SQLite database of its own, so it needs the pdo_sqlite extension. flarum/framework5247
- flarum/testing 2.0.1 creates
storage/locale for the test site, so test suites no longer end with warnings about writing translation catalogues, and suites that fail on warnings pass again. Thanks @ernestdefoe for pointing it out. flarum/framework5235
- Extensions can now listen to the
MessageSending event to change, or cancel, outgoing emails. Core's own listener was accidentally stopping every listener after it from running. flarum/framework5217
- A new
withDefaultIncludes query parameter lets a request name extra includes and still keep the endpoint's defaults. Post lists use it, which is what brought the likes back. flarum/framework5207
- Relationship fields can call
withoutRelatedScope() to have endpoints eager load them in full, rather than only what the viewer may see. It's for relations that policies need to read completely, like a user's groups, and the field's getter then leaves out what the viewer may not see. https://docs.flarum.org/extend/api#loading-a-relationship-in-full flarum/framework5241
- The API serializer now decides each field's visibility once per resource in a response, and doesn't re-run a pending getter on the same model. Make sure a field's
visible() depends on the record and the actor, not on which relations happen to be loaded. flarum/framework5238
User::isAdmin() now remembers its answer for the groups it was worked out from. If you change a user's groups, reload or replace the relation rather than editing the loaded collection in place. flarum/framework5240
- Audit log sentences for your extension's actions can now use any plain value in the entry's payload as a placeholder, as the docs already said. Core's own placeholders win if the names clash. flarum/framework5246
- flarum-webpack-config 3.0.7 registers a default-exported arrow function, call or property under its own name, instead of the first name inside it. flarum/framework5234
- Liking a post through the API that's already liked (
isLiked: true) now leaves it liked, instead of flipping it off. Thanks again, @clarkwinkelmann. flarum/framework5206
- The typings now accept a route resolver that narrows its component. Thanks @datlechin! flarum/framework5009
Package versions
Not every package changed in this release, so here's what you'll have after updating:
| Package | Version | Changed in this release |
| flarum/core | 2.0.2 | Yes |
| flarum/audit | 2.0.2 | Yes |
| flarum/deck | 2.0.2 | Yes |
| flarum/likes | 2.0.2 | Yes |
| flarum/mentions | 2.0.2 | Yes |
| flarum/messages | 2.0.2 | Yes |
| flarum/realtime | 2.0.2 | Yes |
| flarum/sticky | 2.0.2 | Yes |
| flarum/suspend | 2.0.2 | Yes |
| flarum/tags | 2.0.2 | Yes |
| flarum/phpstan | 2.0.1 | Yes, for extension developers |
| flarum/testing | 2.0.1 | Yes, for extension developers |
| flarum/akismet | 2.0.1 | No |
| flarum/approval | 2.0.1 | No |
| flarum/bbcode | 2.0.1 | No |
| flarum/embed | 2.0.1 | No |
| flarum/emoji | 2.0.1 | No |
| flarum/extension-manager | 2.0.1 | No |
| flarum/flags | 2.0.1 | No |
| flarum/gdpr | 2.0.1 | No |
| flarum/lock | 2.0.1 | No |
| flarum/markdown | 2.0.1 | No |
| flarum/nicknames | 2.0.1 | No |
| flarum/statistics | 2.0.1 | No |
| flarum/subscriptions | 2.0.1 | No |
| flarum/lang-english | 2.0.0 | No |
| flarum/pusher | 2.0.0 | No |
How to update
From your forum's root folder, run:
composer update --prefer-dist --no-plugins --no-dev -a --with-all-dependencies
php flarum migrate
php flarum cache:clear
There's more detail in the docs if you need it: https://docs.flarum.org/update
The full list of changes is in the changelog: flarum/frameworkblob/2.x/CHANGELOG.md
Thank you!
A big thank you to everyone who reported problems, sent in fixes and helped test them. Patch releases like this one only happen because you take the time to tell us when something isn't quite right.
With 2.0.2 out of the door, our attention now turns to 2.1. In the meantime, let us know how your update goes, and if anything looks off afterwards, post below and we'll take a look!