Supress ChangeTags::addTags() exceptions for ManualLogEntry objects
authorPiotr Miazga <piotr@polishdeveloper.pl>
Tue, 26 Mar 2019 15:17:05 +0000 (16:17 +0100)
committerPiotr Miazga <piotr@polishdeveloper.pl>
Tue, 26 Mar 2019 17:00:12 +0000 (18:00 +0100)
commit2f30defc743b93316e2bd7cf46a548b6da9a6512
tree82ad64a3316ff44d390d8d7e83573a9709bdc12f
parentf31b45192ec1385bd9143f23f5147985a9ca6bb6
Supress ChangeTags::addTags() exceptions for ManualLogEntry objects

Looks like some parts of the code try to publish log event when
$newId is 0 or null. This cause ChangeTags::addTags to throw
an exception as at least one of rc_id, rev_id, or log_id must be
specified.

When ChangeTags::addTags() fails (because both $rev_id and $log_id
are not present), just ignore the exception and continue with
the execution.

Also, if one of those is set to 0, we need to pass null instead
(do not insert 0's in to DB as both log_id and rev_id are foreign
keys).

Additionally log all places where ManualLogEntry::publish() is
called with incorrect arguments so later we can fix all occurencie
and remove that try{}catch around ChangeTags::addTags() call.

Bug: T218940
Change-Id: I495f79f2b7a7ef1503d229a689babdc12deb353c
includes/logging/LogEntry.php