ManualLogEntries::publish do not store tags when published to `udp`
I noticed that ManualLogEntry items could have tags only when those entries
are published to `rc` or `rcandudp`. Then the extensions can attach tags
via RecentChange_save hook and everything works perfectly. The problem I
encountered happens when the log entry is published to `udp` only, then
tags are ignored. The only way to apply tags to the LogEntry is to call
`ChangeTags::addTags()` after log entry creation.
In the AMC project we would like to tag user actions with `advanced
mobile edit`. Some of those actions, like "Thanks" are not published as
RecentChange, and we want to keep it as it is right now.
What is the reason for this?
Can I safely add support for tagging log entries that are published to
udp only inside the ManualLogEntry class?
Otherwise, I'll need to update Thanks extension code and
- create a new hook that passes the LogEntry object, for
- in the MobileFrontend listen to that hook and call the
`ChangeTags::addTags( [ 'advanced mobile edit' ], null, null, $logId );`
Doesn't sound that bad, but then I'll have to apply the same code to other
places where we create log entries that are not published as RecentChange.
It sounds like a technical debt to me. Also, the current implementation
feels broken, as code quietly ignores tags when logs are published to `udp`
It looks like the ChangeTags already supports adding tags to LogEntries
only - both rc_id and rev_id are nullable, and the only question is how to
tag logs published to the RecentChange (do we add tags to both LogEntry and
Additionally, I'd like to introduce a Taggable interface, that provides
a one way to tag objects (right now RecentChange exposes addTags() method
but the ManualLogEntry exposes setTags() method).
> Then the extensions can attach tags via RecentChange_save hook and
> everything works perfectly.
I note this is not really related to the fact that tags set on the
ManualLogEntry aren't stored when entries are published to `udp`, as that
hook doesn't directly deal with log entries at all.
To support tagging published log entries directly rather than via the
associated RecentChange entry, you'd probably want to add a
"ManualLogEntryPublish" hook or something like that.
> Additionally, I'd like to introduce a Taggable interface, that provides
> a one way to tag objects (right now RecentChange exposes addTags() method
> but the ManualLogEntry exposes setTags() method).
"Taggable" seems like it may be too generic.
"MediaWiki\ChangeTags\Taggable" could work.