Index: trunk/extensions/SemanticPageSeries/includes/SPSPageCreationJob.php |
— | — | @@ -18,10 +18,6 @@ |
19 | 19 | */ |
20 | 20 | class SPSPageCreationJob extends Job { |
21 | 21 | |
22 | | -// public function __construct( $command, $title, $params = false, $id = 0 ) { |
23 | | -// parent::__construct( $command, $title, $params, $id ); |
24 | | -// } |
25 | | - |
26 | 22 | function __construct( $title, $params = '', $id = 0 ) { |
27 | 23 | parent::__construct( 'spsCreatePage', $title, $params, $id ); |
28 | 24 | } |
— | — | @@ -31,9 +27,16 @@ |
32 | 28 | * @return boolean success |
33 | 29 | */ |
34 | 30 | function run() { |
35 | | - |
| 31 | + |
| 32 | + global $wgUser, $wgCommandLineMode; |
| 33 | + |
| 34 | + $oldUser = $wgUser; |
| 35 | + $wgUser = User::newFromId( $this->params['user'] ); |
| 36 | + |
| 37 | + unset( $this->params['user'] ); |
| 38 | + |
36 | 39 | $this->params['form'] = $this->title->getText(); |
37 | | - |
| 40 | + |
38 | 41 | $handler = new SFAutoeditAPI( null, 'sfautoedit' ); |
39 | 42 | $handler->isApiQuery( false ); |
40 | 43 | $handler->setOptions( $this->params ); |
— | — | @@ -49,7 +52,11 @@ |
50 | 53 | |
51 | 54 | $result = wfMsgReplaceArgs( '$1', array($result) ); |
52 | 55 | } |
| 56 | + |
53 | 57 | |
| 58 | + $wgUser = $oldUser; |
| 59 | + |
| 60 | + $this->params = array( $result ); |
54 | 61 | wfDebugLog( 'sps', 'Page Creation Job: ' . $result ); |
55 | 62 | } |
56 | 63 | |
Index: trunk/extensions/SemanticPageSeries/includes/SPSSpecialSeriesEdit.php |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | |
161 | 161 | private function evaluateForm( WebRequest &$request ) { |
162 | 162 | |
163 | | - global $wgOut, $spsgIterators; |
| 163 | + global $wgOut, $wgUser, $spsgIterators; |
164 | 164 | |
165 | 165 | $requestValues = $_POST; |
166 | 166 | |
— | — | @@ -213,6 +213,8 @@ |
214 | 214 | } |
215 | 215 | |
216 | 216 | $targetFormTitle = Title::makeTitleSafe( SF_NS_FORM, $targetFormName ); |
| 217 | + |
| 218 | + $requestValues['user'] = $wgUser->getId(); |
217 | 219 | |
218 | 220 | foreach ( $iteratorValues as $value ) { |
219 | 221 | SFAutoeditAPI::addToArray( $requestValues, $targetFieldName, $value, true ); |
Index: trunk/extensions/SemanticPageSeries/README |
— | — | @@ -6,8 +6,9 @@ |
7 | 7 | |
8 | 8 | == Dependencies == |
9 | 9 | |
10 | | -This extension was developed for MediaWiki 1.17 with Semantic Forms 2.4 |
11 | | -installed. Other version might work, but are not tested. |
| 10 | +This extension was developed for MediaWiki 1.17 with at least Semantic |
| 11 | +MediaWiki 1.5.3 and Semantic Forms 2.4 installed. Other version might work, but |
| 12 | +are not tested. |
12 | 13 | |
13 | 14 | |
14 | 15 | == Installation == |