Log setting changes that happen because of an update in staff action logs

Moin
Tue, 23 Sep 2025 14:59:50 +0000
Feature

I know there are site setting changes by system in the staff action logs. For example, at the end of July, the system enabled rich editor on my forum, and in April, the allowed iframes were changed.

But when I tried to find out why the welcome message from Discobot no longer worked, it was very difficult. I checked for changes of settings in the staff action logs, but there was no change. That’s why I assumed the problem was not related to a site setting. If those hadn’t changed and it had worked before, it couldn’t have been the cause.
Some days later, I found out that the Discourse update had changed the site setting Disable Discourse Narrative Bot welcome post[1].

An entry in the staff action logs would have helped me to find that. Is it possible to add an entry in those cases?

When allowed iframes was changed, such an entry was added:

github.com/discourse/discourse

db/migrate/20250415224422_update_allowed_iframes_codepen_stricter_default.rb

3762ed22d

15.     return if new_value == prev_value





17.     DB.exec(<<~SQL, new_value:)


18.       UPDATE site_settings


19.       SET value = :new_value


20.       WHERE name = 'allowed_iframes'


21.     SQL





23.     DB.exec(<<~SQL, prev_value:, new_value:)


24.       INSERT INTO user_histories (action, subject, previous_value, new_value, admin_only, updated_at, created_at, acting_user_id)


25.       VALUES (3, 'allowed_iframes', :prev_value, :new_value, true, NOW(), NOW(), -1)


26.     SQL


27.   end


28. end

Is it possible to do this for all migrations of site settings? Maybe also with “changed during Discourse update” in the context field?

1. https://github.com/discourse/discourse/pull/34373 ↩︎

4 сообщения - 3 участника