This commit adds `register_category_update_param_with_callback` to the
plugin API, allowing plugins to register category parameters and apply a
transactional callback relating to the param. The callback receives the
category instance and parameter value, and any exception raised will
roll back the category update.
Example usage:
```
register_category_param_with_transaction_callback(:doc_index_topic_id) do |category, value|
DocCategories::CategoryIndexManager.new(category).assign!(value)
end
```
In the example above, `doc_index_topic_id` will be added to
`permitted_params` in the category controller on update, and the
callback will be invoked on `after_update`, to ensure the category save
does not happen if the callback fails.
**Dev note**: I had considered creating a `CategoryExtension` and just
doing the typical `Category.prepend`, but I thought a plugin API is
probably better.
This commit introduces `registerCategorySaveProperty` that allows other
plugins that are adding additional parameters to the category to save
the new property alongside the default category properties (all under
the same save call), and are not using custom fields for that.
```
api.registerCategorySaveProperty("property_one");
api.registerCategorySaveProperty("property_two");
```
Strengthens deprecation handling in tests by enforcing errors for
unhandled deprecations.
* Enforces error throwing for unhandled deprecations via stricter
DeprecationWorkflow.shouldThrow(..., true) usage in test handlers
* Fix the autocomplete deprecation warnings that were introduced while
the deprecations were not throwing errors.
- rename from calendar -> calendar and events
- fix config for plugin to show a tab for settings
still needs some CSS adjustments but mostly there
---------
Co-authored-by: Martin Brennan <martin@discourse.org>
Disabling post event with category events set would cause an error when
visiting the category, this commit ensures it's not the case and adds a
test for it.
Also added tests to ensure we correctly render category calendar in
different outlets as the before-topic-list-body one was broken.
This function is effectively now a no-op after
https://github.com/discourse/discourse/pull/34867 which removes the
ability to set up the jquery-based autocomplete library in composer.
Floatkit autocomplete handles its own cancel & close functionality via
its component lifecycle.
This will be ok to merge once all calls to this function from supported
plugins are removed.
We currently bump the entire topic if the last post
in the topic is edited.
This is quite noisy and distracting, particularly in cases where the
edit was to address a small typo rather than dramatically rework the
post.
So, this commit no longer bumps a topic on post edit for
any posts in the topic. Only manually bumping the
topic in the footer or in bulk actions will bump it now,
or when tags/category are edited depending on settings.
This commit removes the filter that would remove themeable
site settings from all setting lists, so they are easier to
find for admins.
To do this, we show the value of the site's default theme
for that theme site setting, disable the setting component,
and provide a link to the site's default theme for quick
editing.
---------
Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
For these steps:
* In Horizon, create a topic.
* You’ll notice that the topic card has the OP name.
* Make an edit to the OP after the edit grace period.
You would see no username under the topic title. This is because
we were saying that if the topic bump date was after the last post
date, then we should never show any edit details.
However this didn't handle the common case of posting then editing
soon after.
Now in this commit, if the difference is < 1 day, we still show
the same username.
A proper fix would be to know the bumped_at_user then we can tell
if the user is the same as the last poster, but that is more complex
to do.
Avoid parsing images with `data:` content (usually with long base64) on
image node's `parseDOM` (eg. when pasting).
Base64 images are unsupported when pasting on markdown mode and on other
"rich" authoring tools.
A future improvement will be triggering an upload for each pasted base64
image and then replacing it, but this stops the bleeding of generating
an awfully long Markdown output.
When navigating the composer toolbar with arrow keys, you get stuck once
you hit the headings button and arrow keys cease to work in either
left/right direction. You get stuck here:
<img width="595" height="58" alt="image"
src="https://github.com/user-attachments/assets/cebc00a5-c629-488a-8716-6a9100e7b1b1"
/>
The issue was that DMenu captures keyboard commands looking for a `tab`
and ignoring all other keys and this was breaking the parent handler
watching for arrow keys. This will now pass other keys beyond tab back
to the parent, so we can nav beyond headings in the toolbar.
<img width="630" height="62" alt="image"
src="https://github.com/user-attachments/assets/88d96979-0651-4744-8dd7-d2f2d8abe53b"
/>
I've added a test to check for this "stuck" state in the future.
Refactor `showSidebar` in `application.js` to use a tracked property,
allowing dynamic updates and configurable overrides. This supports
themes that rely on viewport properties to adjust the sidebar's
visibility.
**Description**
Currently, when using Discourse as an SSO provider through the
DiscourseConnect provider, if a user logs in using the login form, the
user is not redirected to the expected `return_sso_url`. Instead, it is
redirected to the forum's home page. This fixes this behaviour and
allows the user to return to the expected URL.
It doesn’t appear this expectation is necessary and it was causing
random failure as sometimes we will have an error from promotheus in the
log totally unrelated:
```
expected block to not output to stderr, but output "E, [2025-09-19T07:16:59.199016 #2050] ERROR -- : Prometheus Exporter, failed to send message Connection refused - connect(2) for \"localhost\" port 9405\n"
```
/t/-/149729
Prior to this fix events with a description wouldn't show in the
composer when they contain a description. This was particularly
problematic as saving the post in this state would remove the event.
Since the session is backed by a cookie, storing too much data will lead
to a cookie overflow error.
A return path can be quite large sometimes, so intead of storing it in
the session, this patch stores it in our server session.
This commit ensures that the "Themes & Components" admin sidebar link
stays active on the `/admin/config/customize/components` and
`/admin/config/customize/theme-site-settings` routes.
There was two issues:
- using the `TopicListItemSerializer` was fetching way more than we need
and also expecting includes from other plugins (assign for example),
switching to our own dedicated serializer seems a better choice here
- event dates were not preloaded
- fixed a spec which was supposed to track N+1 but was commented
I also improved our fabricator to limit the boilerplate needed.
We might need few more indices to improve perf event more here but going
to merge this first.
We've had the new floatkit-based autocomplete live in various parts of
Discourse for about a month now, and it's stable enough for us to remove
the site setting letting admins revert to the jquery-based autocomplete
library which is now deprecated.
This was causing restores to fail. The trigger is also unnecessary
because the `topic_id` column is already marked as read-only.
Follow-up to eeeb7d302f
We are deprecating this jquery-based autocomplete library, replaced by
DAutocomplete modifier for text field usage and DMultiSelect for input
selector usage.