UI for the "Logging" setting is confusing/incorrect on multisite/multi-domain installation
The UI for the "Logging" setting (i.e. detailed logging) on the Administer -> System Settings -> Misc page is confusing, misleading, and indeed incorrect for a multisite installation. This is because when you first turn logging on ("Yes") for one site, it actually enables logging for all sites (all Civi domain IDs), not just for the current site. However, if you navigate to the Administer -> System Settings -> Misc on a different site, the Logging setting will still indicate logging is off ("No"). The UI on the other sites do not correctly show the logging status.
The opposite is also true. If the logging setting is "Yes" on multiple sites, as soon as you turn it off ("No") for one site, it is actually turned off for all sites. But the Misc settings page on other sites continues to show that logging is turned on.
The preferred behavior would be ensure the status of logging is always shown correctly on all sites. As soon as you set it to "Yes" or "No" on one site, navigating to the "Misc" settings page on any other site should show the same status.
- Create a multisite/multi-domain installation with at least two sites (Site A and Site B).
- On Site A, navigate to Administer -> System Settings -> Misc, change Logging to Yes and Save changes.
- On Site B, navigate to Administer -> System Settings -> Misc. Observe that the Logging setting incorrectly shows No.
If a new site (domain ID) is added to a multisite installation for which logging is already turned on, will the System Settings -> Misc page on the new site correctly show Logging is set to Yes?
See use case #1 (closed) above.
As above, but in use case #1 (closed) step (3), Site B correctly shows Logging is Yes.
In addition, the "If enabled, all actions will be logged with a complete record of changes." help text could be changed to something like: "If enabled, all actions will be logged with a complete record of changes. (In a multisite installation, this setting applies to all sites.)"
In addition of course the Sys Admin guide should explain the logging behavior for multisite.
I notice that in the civicrm_setting table, the
is_domain field for the
name = "logging" record is "1" (meaning, presumably, that "logging" is a domain-specific setting). But in fact it is a system-wide setting, right? Would simply changing
0 cause the UI to behave correctly?
Or a simpler/faster fix would be to change the code so that all of the
name = "logging" records are updated to the same value whenever the setting is changed in the UI anywhere. (But, if a new site is added, would the "logging" setting be initialized to the correct current value?)
A third option would be to only display the Logging setting on the primary domain's Misc settings page.