Kipcool has submitted this change and it was merged.
Change subject: is_the_job bug and POST regeneration
......................................................................
is_the_job bug and POST regeneration
Change-Id: Ida97760a2b730afae78494764ce39519dc6ba4ee
---
M includes/jobs/OWOwdListJob.php
M includes/specials/SpecialOWDownloads.php
2 files changed, 38 insertions(+), 3 deletions(-)
Approvals:
Kipcool: Verified; Looks good to me, approved
diff --git a/includes/jobs/OWOwdListJob.php b/includes/jobs/OWOwdListJob.php
index 2761722..909df6d 100644
--- a/includes/jobs/OWOwdListJob.php
+++ b/includes/jobs/OWOwdListJob.php
@@ -395,7 +395,7 @@
JobQueueGroup::singleton()->push( $job ); // mediawiki
>= 1.21
} else { // complete job
// record transaction_ids
- $transactionId =
Transactions::getLanguageIdLatestTransactionId( $languageId );
+ $transactionId =
Transactions::getLanguageIdLatestTransactionId( $languageId, array(
'is_the_job' => true ) );
fwrite( $fhini,
'transaction_id: ' . $transactionId . "\n"
);
diff --git a/includes/specials/SpecialOWDownloads.php
b/includes/specials/SpecialOWDownloads.php
index 6383f64..732cf8b 100644
--- a/includes/specials/SpecialOWDownloads.php
+++ b/includes/specials/SpecialOWDownloads.php
@@ -270,8 +270,8 @@
$wldJobs = new WldJobs();
$jobExist = $wldJobs->downloadJobExist( $jobName );
if ( !$jobExist ) {
- // $action = '<a href="' . $wgServer . $wgScript .
'?title=Special:Ow_downloads&update=' . $line . '">Regenerate</a>' . "\n";
- $action = '<a href="' .
"$wgServer$wgScript/Special:Ow_downloads?create-" . $this->type . '=' .
$languageId . '">Regenerate</a>' . "\n";
+ // $action = '<a href="' .
"$wgServer$wgScript/Special:Ow_downloads?create-" . $this->type . '=' .
$languageId . '">Regenerate</a>' . "\n";
+ $action = $this->postAction( $this->type,
$languageId );
$status = $this->getStatus( $languageId, $line
);
} else {
$action = ' ';
@@ -331,6 +331,41 @@
return 'latest';
}
+// $action = '<a href="' .
"$wgServer$wgScript/Special:Ow_downloads?create-" . $this->type . '=' .
$languageId . '">Regenerate</a>' . "\n";
+// $action = postAction( $this->type, $languageId );
+
+ protected function postAction( $prefix, $languageId ) {
+ global $wgServer, $wgScript;
+
+ $form = '';
+ $formOptions = array(
+ 'method' => 'POST',
+ 'action' => "$wgServer$wgScript/Special:Ow_downloads"
+ );
+ $form .= Html::openElement( 'form', $formOptions );
+
+ $form .= Html::element(
+ 'input',
+ array(
+ 'type' => 'hidden',
+ 'name' => 'create-' . $prefix,
+ 'value' => $languageId
+ )
+ );
+
+ // submit button
+ $form .= Html::element(
+ 'input',
+ array(
+ 'type' => 'submit',
+ 'value' => 'Regenerate'
+ )
+ );
+
+ $form .= Html::closeElement( 'form' );
+ return $form;
+ }
+
protected function createNewForm( $prefix ) {
global $wgServer, $wgScript;
--
To view, visit https://gerrit.wikimedia.org/r/86786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ida97760a2b730afae78494764ce39519dc6ba4ee
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 <[email protected]>
Gerrit-Reviewer: Kipcool <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits