X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FLogEntry.php;h=46c55157c4a37ab5158c0fc9d5ecd1e4413eba48;hb=eddce194b22b80f46ce578362250bb402312c7a2;hp=c7f9e40c5da6d13029687be0cc7b99ead66dc3bf;hpb=a5ee223cde679dece81f9c038e9fb43ddd937410;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index c7f9e40c5d..46c55157c4 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -407,7 +407,7 @@ class ManualLogEntry extends LogEntryBase { * Declare arbitrary tag/value relations to this log entry. * These can be used to filter log entries later on. * - * @param array $relations Map of (tag => (list of values)) + * @param array $relations Map of (tag => (list of values|value)) * @since 1.22 */ public function setRelations( array $relations ) { @@ -504,6 +504,10 @@ class ManualLogEntry extends LogEntryBase { 'log_comment' => $comment, 'log_params' => serialize( (array)$this->getParameters() ), ); + if ( isset( $this->deleted ) ) { + $data['log_deleted'] = $this->deleted; + } + $dbw->insert( 'logging', $data, __METHOD__ ); $this->id = !is_null( $id ) ? $id : $dbw->insertId(); @@ -512,6 +516,11 @@ class ManualLogEntry extends LogEntryBase { if ( !strlen( $tag ) ) { throw new MWException( "Got empty log search tag." ); } + + if ( !is_array( $values ) ) { + $values = array( $values ); + } + foreach ( $values as $value ) { $rows[] = array( 'ls_field' => $tag, @@ -524,6 +533,10 @@ class ManualLogEntry extends LogEntryBase { $dbw->insert( 'log_search', $rows, __METHOD__, 'IGNORE' ); } + // Update any bloom filter cache + $member = $this->getTarget()->getNamespace() . ':' . $this->getTarget()->getDBkey(); + BloomCache::get( 'main' )->insert( wfWikiId(), 'TitleHasLogs', $member ); + return $this->id; }