The version parameter of the JS plugin-api has never really been used
properly. These days, themes and plugins use the
`.discourse-compatibility` system for defining compatibility with core,
and we made the plugin-api version argument optional in
acad83199e.
This commit removes the internal infrastructure which supported the
versioning system. There is no change to the API. Any passed version
numbers will be ignored.
This commit splits the `moderators_manage_categories_and_groups` setting
into 2 separate settings to allow for more precise control over
categories and groups management by moderators.
Internal topic: t/141392.
Follow-up to 0bc18fdf78
The `before` hooks were arragned in such a way that we were visiting the
admin user page first before the site setting was updated.
These specs are to ensure category names remain translated when
navigating around.
In a future PR there will be a fix for logged in users, where category
names get overridden in the local store due to async requests updating
the category names in store.
1 of 2.
/t/163217
In a previous refactor we lost the functionality that creates a reviewable when a moderator immediately takes action on a post and chooses to either silence or suspend a user.
This commit allows editing colors of palettes that are installed with
themes. Prior to this commit, editing colors of theme-owned palettes wasn't
allowed because a theme update could override the edits made by admins
and there was no way to revert edits to the original values. With this
commit, all of that is solved by copying the palette when it's first edited
by an admin, and making future updates to the theme update the original
copy only with the ability for admins to revert to the colors in the
original copy at any time.
Internal topic: t/162130.
Cleanup task to remove the recursive option from the category link
helper.
This was mostly replaced with the additional of the `ancestors` option
in #26638, this PR removes the last instance of where it was used and
removes it from the helper.
Before this change, every update to the `searchTerm` tracked property would create a new promise in the `data` function. The issue was that once the debounce delay completed, only the most recent promise would be handled, leaving the other promises in a limbo state. This is problematic because we pass these promises to TrackedAsyncData, which registers a test waiter in the test environment. If promises are never settled, the test waiters will never complete, causing tests to hang indefinitely.
In our efforts to increase the signal-to-noise ratio and discoverability of site settings, we're hiding overly technical settings that few users override.
c.f. https://github.com/discourse/discourse/pull/34945
This commit updates `PostRevisor` to bump a topic if the
edited post is a wiki post and it is also the first post in
the topic (OP).
In this case, people want to know about a
change to the OP, because it may need to be reviewed (in the case of a
wiki) or it should be “promoted” so that others can see what’s changed
(in the case of general documentation).
A related change in this commit is to add a `should_bump_topic`
plugin modifier, so plugins like Discourse Doc Categories
(see https://meta.discourse.org/t/discourse-doc-categories/322376)
can enforce bumping in certain cases.
The settings text doesn't reflect reality, as wide rectangular logo isn't a requirement. A square one works just as well, and is recommended to optimise header space.
In the current version of DiscourseHub on iOS 26, video uploads are stalling.
This is because the video thumbnail generation code relies on video events and it looks like iOS 26 webviews are not firing those events.
This may require a fix in DiscourseHub, but in the meantime, we need to tighten the logic in thumbnail generation here.
Examples:
* Run only the "badges" and "users" steps in the converter:
```
migrations/bin/cli convert discourse --reset --only=badges,users
```
* Run all steps except "users" in the converter:
```
migrations/bin/cli convert discourse --reset --skip=users
```
* Run only the "badges" step in importer:
This also runs all steps that "badges" depends on (e.g. "users" and "uploads").
```
migrations/bin/cli import --reset --only=badges
```
* Run only the "badges" step in importer and skip the "users" on which "badges" depends:
```
migrations/bin/cli import --reset --only=badges --skip=users
```
- Rename SSO -> DiscourseConnect. SSO is the general term for all
external login methods. DiscourseConnect is the name for this protocol
- Allocate different IP for each parallel spec environment, so they
don't clash. This will resolve some flaky specs we're seeing
- Only bind to localhost. No need to make this available from other
machines
The badge in `CategoryChooser` is incorrectly showing the child category
badge when displaying both parent and child as the selected option. This
was already fixed for cases where the `ancestors` option is passed to
`categoryBadgeHTML` in the category link helper.
Updating the option within CategoryChooser fixes this issue, but I have
also added a fallback fix for any other components that still use the
recursive option.
_Note: as part of #26638 the preferred approach was to pass `ancestors:
category.predecessors` in place of `recursive: true`. That way reducing
multiple calls to `Category.findById` at the component level when
looping through category parents. We may want to completely remove the
recursive option in the future but leaving it be for now._
### Before
The category emojis are working correctly on the top header:
<img width="448" height="68" alt="Screenshot 2025-10-03 at 2 44 02 PM"
src="https://github.com/user-attachments/assets/f929cebf-3523-40cd-ac44-4c8d240793d5"
/>
The category chooser is showing the incorrect emoji for the parent
category when editing the topic:
<img width="430" height="159" alt="Screenshot 2025-10-03 at 2 43 55 PM"
src="https://github.com/user-attachments/assets/a7ed5cff-db10-4899-8096-45bd2b882eea"
/>
### After
<img width="451" height="153" alt="Screenshot 2025-10-03 at 2 43 02 PM"
src="https://github.com/user-attachments/assets/6033c164-3451-4526-8ff0-29819f8ae3d7"
/>
We can't enable `Rails/WhereNot` lint/autofix, because it would break
code that uses mini_sql instead of AR (which rubocop, and tbh also we,
can't easily differentiate)
Those are safe because they either:
* are executed in AR model scope definitions
* are clearly chained starting from a AR model
* are less-clearly chained, but still can be traced to a AR model/scope
---------
Co-authored-by: Loïc Guitaut <loic@discourse.org>
This commit adds a new setting `moderators_change_trust_levels` to
control whether moderators are allowed to change trust level of users.
Moderators are currently allowed to change trust levels, so this new
setting is enabled by default to avoid sudden changes in behavior for
existing sites.
When the setting is disabled and moderators are not allowed to change
trust levels, they see the trust levels dropdown disabled.
Internal topic: t/141392.
---------
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
**Description**
Add an option to ignore orphaned posts since these can cause errors when
running the task like:
```
ERROR:
duplicate key value violates unique
PG:: UniqueViolation:
DETAIL: Key (topic_i, post_number, user_id)=(212064, 1, 33887) already exists.
```
This PR uses MessagePack instead of JSON for serializing our cookies.
MessagePack is almost as fast as Marshal but without the security
issues. It’s also able to serialize more objects than JSON (like Time,
Symbol, etc.). As it’s a binary format, it takes less space than JSON,
sometimes half less. Finally, MessagePack isn’t Ruby-specific and
implementations exist in every existing language.
Regarding the cookies Discourse is using, we can see a small improvement
on the `_forum_session` one when it’s almost empty (around 2%), but the
more things are put into it, the more we’ll see savings. For the `_t`
cookie, we’re saving around 20% for free.
Now that `ServerSession` can store arbitrary data, we can move some more
data into it.
This patch moves some data related to authentication into it, as
sometimes that kind of data can be pretty big.
When we revamped the problem check system, we lost this job that creates admin notifications when there are lingering problems. This PR adds it back.
It is almost a line-for-line copy of the original job and its tests, except for the implementation of #persistent_problems?.
When quoting an image it is easy to accidentally select the image
caption as it appears on hovering the image. Because of this the caption
text also appears underneath the image (within the quote).
Making the caption text unselectable when hovering the image solves
this.
In the aws_media_convert_adapter we were referencing
`SiteSetting.s3_upload_bucket` but that can be empty on some instances,
so we need to use the `SiteSetting.Upload.s3_upload_bucket` version,
which should always have a value when using s3.
This follows a similar pattern we used previously for other s3 related
settings.
Followup 2a65bf4522
With the above change, we inadvertently made it so that
when you edited the topic title or category, we bumped
the topic.
This fix makes it so we do not bump topics when only title, category,
or tags are changed, to restore the previous behaviour.
In addition, we are making it so the following settings no longer
influence topic bump behaviour, keeping only their intended notification
behaviour around. The site setting description never mentioned anything
about topic bumps:
* disable_category_edit_notifications
* disable_tag_edit_notifications
Context: The `btn` mixin is used for every functional button, but this
includes button elements that are not, or should not be, styled like our
default or primary buttons.
To change how this works this commit:
* stripped down the mixin to the bare essentials, mainly limiting to the
properties that use variables.
* moved most things into the `btn` class
* moved some things into specific descriptive classes (default, danger,
success) such as border-radius
Example of button that does not need a border-radius and would benefit
from this:
<img width="464" height="184" alt="CleanShot 2025-09-19 at 12 56 04@2x"
src="https://github.com/user-attachments/assets/e908b2cf-971f-4c1f-aade-7492bad2f89c"
/>
* Deprecated…
* FlatButton component
* btn-active: we should use the proper pseudoclass :active or a –-active
modifier in code if we need it
* btn-text: every button by default is a btn-text. We already have a
class to indicate when it isn’t (no-text)
* fixed btn-link property to make DButton component behave like an
inline link (no padding, link-styling)
* Since I moved styling from .btn, ths means every button now needs a
specific declaration. So I’ve added btn-default where necessary.
* Fixed btn-flat hover effect: The difference between btn-flat and
btn-transparent was getting very ambiguous. I’ve fixed the hover effect
for btn-flat so that the distinction is:
<img width="1094" height="408" alt="image"
src="https://github.com/user-attachments/assets/addf56a9-1f61-463d-abd9-5028a3b88fad"
/>
* Changed the custom icon colour from header icons so it follows the
normal btn-flat styling, the way the sidebar icon already was doing.
(Consistency)
**Other small button-related change along the way**
What | BC | AC |
|----| ----|--------|
Inconsistent save/cancel colours | <img width="1720" height="1084"
alt="CleanShot 2025-09-19 at 15 31 40@2x"
src="https://github.com/user-attachments/assets/227289c3-6ded-4633-868d-6e33c32d83c3"
/> | <img width="1720" height="1084" alt="CleanShot 2025-09-19 at 15 30
56@2x"
src="https://github.com/user-attachments/assets/b23f96c9-04f3-40ea-9fba-2be59eae8e64"
/> |
---------
Co-authored-by: Martin Brennan <martin@discourse.org>