Splitting from T152394: BlockUser::log() creates a log entry and inserts it, without offering any way for callers to alter the entry. In particular, it is not possible to alter visibility of the entry (via ManualLogEntry::setDeleted), which has at least a use case (see mentioned task). Three possible solutions:
- Add a setter for log entry visibility, i.e.
/** @var int|null */ private $logDeletionFlags; /** * @param int $flags One of LogPage::* constants */ public function setLogDeletionFlags( int $flags ) : void { $this->logDeletionFlags = $flags; } private function log( DatabaseBlock $block, bool $isReblock ) { // ... if ( $this->logDeletionFlags !== null ) { $logEntry->setDeleted( $this->logDeletionFlags ); } // ...
- Add it as a constructor parameter inside $blockOptions
- Add a hook to allow further customization of the entry
I would be fine with any of these solutions, keeping in mind that option (3.) might lack real use cases, and it would have to be considered as a long-term solution, whereas (1) and (2) can be introduced as a more hacky/temporary™ solution.
Tagging AHT per developers/maintainers.