r24931 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24930‎ | r24931 | r24932 >
Date:07:33, 20 August 2007
Author:david
Status:old
Tags:
Comment:
mindblowingly stupid bug
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -33,7 +33,7 @@
3434 /* Certain actions apply to the "header", which is stored in the actual talkpage
3535 in the database. Drop everything and behave like a normal page if those
3636 actions come up, to avoid hacking the various history, editing, etc. code. */
37 - $header_actions = array('history', 'edit', 'submit');
 37+ $header_actions = array('history', 'edit', 'submit', 'protect');
3838 if ($request->getVal('lqt_method', null) === null && (
3939 in_array( $request->getVal('action'), $header_actions ) ||
4040 $request->getVal('diff', null) !== null ) ) {
@@ -319,7 +319,7 @@
320320 $thread = Threads::newThread( $article, $this->article, $edit_applies_to, $e->summary );
321321 $edit_applies_to->commitRevision(Threads::CHANGE_REPLY_CREATED, $thread, $e->summary);
322322 } else {
323 - $thread = Threads::newThread( $article, $this->article, $e->summary );
 323+ $thread = Threads::newThread( $article, $this->article, null, $e->summary );
324324 }
325325 }
326326
Index: branches/liquidthreads/extensions/LqtModel.php
@@ -225,6 +225,15 @@
226226 return $results;
227227 }
228228
 229+ function ancestors() {
 230+ $id_clauses = array();
 231+ foreach( explode('.', $this->path) as $id ) {
 232+ $id_clauses[] = "thread_id = $id";
 233+ }
 234+ $where = implode(' OR ', $id_clauses);
 235+ return Threads::where($where);
 236+ }
 237+
229238 private function bumpRevisionsOnAncestors($change_type, $change_object) {
230239 $this->revisionNumber += 1;
231240 $this->setChangeType($change_type);

Status & tagging log