Index: trunk/extensions/LiquidThreads/classes/Thread.php |
— | — | @@ -323,9 +323,12 @@ |
324 | 324 | } |
325 | 325 | } |
326 | 326 | |
327 | | - function delete( $reason ) { |
328 | | - $this->type = Threads::TYPE_DELETED; |
329 | | - $this->commitRevision( Threads::CHANGE_DELETED, $this, $reason ); |
| 327 | + function delete( $reason, $commit = true ) { |
| 328 | + |
| 329 | + if ( $commit ) { |
| 330 | + $this->type = Threads::TYPE_DELETED; |
| 331 | + $this->commitRevision( Threads::CHANGE_DELETED, $this, $reason ); |
| 332 | + } |
330 | 333 | /* Mark thread as read by all users, or we get blank thingies in New Messages. */ |
331 | 334 | |
332 | 335 | $this->dieIfHistorical(); |
— | — | @@ -1154,9 +1157,8 @@ |
1155 | 1158 | $title = Title::newFromID( $this->rootId ); |
1156 | 1159 | } |
1157 | 1160 | |
1158 | | - if ( !$title ) { |
1159 | | - $this->setType( Threads::TYPE_DELETED ); |
1160 | | - $this->save(); |
| 1161 | + if ( !$title && $this->type() != Threads::TYPE_DELETED ) { |
| 1162 | + $this->delete('', false /* !commit */); |
1161 | 1163 | return null; |
1162 | 1164 | } |
1163 | 1165 | |