Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | /* Certain actions apply to the "header", which is stored in the actual talkpage |
35 | 35 | in the database. Drop everything and behave like a normal page if those |
36 | 36 | 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'); |
38 | 38 | if ($request->getVal('lqt_method', null) === null && ( |
39 | 39 | in_array( $request->getVal('action'), $header_actions ) || |
40 | 40 | $request->getVal('diff', null) !== null ) ) { |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | $thread = Threads::newThread( $article, $this->article, $edit_applies_to, $e->summary ); |
321 | 321 | $edit_applies_to->commitRevision(Threads::CHANGE_REPLY_CREATED, $thread, $e->summary); |
322 | 322 | } else { |
323 | | - $thread = Threads::newThread( $article, $this->article, $e->summary ); |
| 323 | + $thread = Threads::newThread( $article, $this->article, null, $e->summary ); |
324 | 324 | } |
325 | 325 | } |
326 | 326 | |
Index: branches/liquidthreads/extensions/LqtModel.php |
— | — | @@ -225,6 +225,15 @@ |
226 | 226 | return $results; |
227 | 227 | } |
228 | 228 | |
| 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 | + |
229 | 238 | private function bumpRevisionsOnAncestors($change_type, $change_object) { |
230 | 239 | $this->revisionNumber += 1; |
231 | 240 | $this->setChangeType($change_type); |