#5773 - Site messaging JSON is broken
0 guests and 0 members have recently viewed this.
The top 3 point earners from 23rd Nov 2025 to 30th Nov 2025.
| PDStig |
|
|
|---|---|---|
| Master Rat |
|
|
| cupper3 |
|
There are no events at this time
Instead, we should probably strip this config option out into its own XML screen (like field filters / advanced banning). Provide a commented example in the XML.
This would also allow us to expand on its functionality in the future if we want, for example allowing to specify specific pages to show a message (this could be very handy for staff use. For example, staff could have a to-do message display to remind others to sync comcode pages to git after actualising an add or edit).
Or alternatively, make this a UI module with the ability to add/edit/delete messages individually. Make it its own addon and call it "site_messaging" (I don't think it needs to be core (but it should be bundled); I see no reason why a user shouldn't be able to uninstall it). Make site messages resource meta-aware in resource_fs so they can also be automated. Add a privilege to define who can add/edit site messages, defaulting to staff only. Update documentation accordingly to explain this small module/addon.
Site messaging was broken when trying to specify multiple messages.
This hotfix guts the old site messaging system and removes the configuration options, then adds a new addon called 'site_messaging'. Site messages are now handled through their own screen under Admin Zone > Setup > Site messaging.
I decided to go this route because I did not like the previous implementation where there were fields for a single message, but then to specify multiple messages, you had to use JSON (which is easy to get wrong) inside the Comcode-type field. This did not seem appropriate from a contextual and validation point of view.
This also adds on the ability to put messages on specific pages by specifying page-links.
However, I do want to add some nuance/context...
There's always a tradeoff between quality and where we choose to put our resources. We need to have a baseline of quality, but less important/commonly-used features may reasonably implemented in a more clunky way than more important ones. Hand-writing JSON is an example of that. But given there were apparently insufficient guard rails, probably we'd either have needed to add those, moved the feature to a hidden one, or did it the idealized way anyway. So no complaints from me.