Foxtrott has submitted this change and it was merged.
Change subject: fix bug 47806 ("minor edit" and "watch this page" checkboxes no
longer work in forms)
......................................................................
fix bug 47806 ("minor edit" and "watch this page" checkboxes no longer work in
forms)
With some exceptions values from standard inputs were ignored.
Change-Id: I3bf24ac4d383b782182e52d065c8b23429084eba
---
M includes/SF_AutoeditAPI.php
1 file changed, 11 insertions(+), 12 deletions(-)
Approvals:
Foxtrott: Verified; Looks good to me, approved
jenkins-bot: Checked
diff --git a/includes/SF_AutoeditAPI.php b/includes/SF_AutoeditAPI.php
index fe154d6..c46a23c 100644
--- a/includes/SF_AutoeditAPI.php
+++ b/includes/SF_AutoeditAPI.php
@@ -309,22 +309,21 @@
// Find existing target article if it exists, or create a new
one.
$article = new Article( Title::newFromText( $this->mOptions[
'target' ] ) );
- $summary = (array_key_exists( 'wpSummary', $this->mOptions )) ?
$this->mOptions[ 'wpSummary' ] : '';
- $startTime = (array_key_exists( 'wpStartTime', $this->mOptions
)) ? $this->mOptions[ 'wpStarttime' ] : wfTimestampNow();
- $editTime = (array_key_exists( 'wpEdittime', $this->mOptions ))
? $this->mOptions[ 'wpEdittime' ] : '';
-
// set up a normal edit page
// we'll feed it our data to simulate a normal edit
$editor = new EditPage( $article );
- // set up simulated form data
- $data = array(
- 'wpTextbox1' => $targetContent,
- 'wpSummary' => $summary,
- 'wpStarttime' => $startTime,
- 'wpEdittime' => $editTime,
- 'wpEditToken' => $wgUser->isLoggedIn() ?
$wgUser->editToken() : EDIT_TOKEN_SUFFIX,
- 'action' => 'submit',
+ // set up form data:
+ // merge data coming from the web request on top of some
defaults
+ $data = array_merge(
+ array(
+ 'wpTextbox1' => $targetContent,
+ 'wpSummary' => '',
+ 'wpStarttime' => wfTimestampNow(),
+ 'wpEdittime' => '',
+ 'wpEditToken' => $wgUser->isLoggedIn()
? $wgUser->editToken() : EDIT_TOKEN_SUFFIX,
+ 'action' => 'submit',
+ ), $this->getRequest()->getValues()
);
// set up a faux request with the simulated data
--
To view, visit https://gerrit.wikimedia.org/r/63114
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3bf24ac4d383b782182e52d065c8b23429084eba
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>
Gerrit-Reviewer: Foxtrott <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits