jenkins-bot has submitted this change and it was merged.

Change subject: Fix is cached template and rerender handling
......................................................................


Fix is cached template and rerender handling

Previously you would get an ugly unformatted and unclickable rerender
link if a document was cached. This now gives a formated and clickable
link. Also, we no longer fatal when we submit the rerender.

Change-Id: Ibc187acc0d95b6c10dd63e462e93df15ada3e8fe
---
M Collection.body.php
M Collection.templates.php
M i18n/en.json
3 files changed, 10 insertions(+), 6 deletions(-)

Approvals:
  Siebrand: Looks good to me, but someone else must approve
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Collection.body.php b/Collection.body.php
index cddfbb1..300b59e 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -1041,9 +1041,9 @@
 
                $query = 'bookcmd=rendering'
                        . '&return_to=' . urlencode( $request->getVal( 
'return_to', '' ) )
-                       . '&collection_id=' . urlencode( 
$response['collection_id'] )
-                       . '&writer=' . urlencode( $response['writer'] );
-               if ( $response['is_cached'] ) {
+                       . '&collection_id=' . urlencode( 
$response->response['collection_id'] )
+                       . '&writer=' . urlencode( $response->response['writer'] 
);
+               if ( $response->response['is_cached'] ) {
                        $query .= '&is_cached=1';
                }
                $this->getOutput()->redirect( SkinTemplate::makeSpecialUrl( 
'Book', $query ) );
diff --git a/Collection.templates.php b/Collection.templates.php
index f527b04..1d89aca 100644
--- a/Collection.templates.php
+++ b/Collection.templates.php
@@ -415,8 +415,12 @@
 echo wfMessage( 'coll-rendering_finished_text', $this->data['download_url'] 
)->parseAsBlock();
 
 if ( $this->data['is_cached'] ) {
-       $forceRenderURL = SkinTemplate::makeSpecialUrl( 'Book', 
'bookcmd=forcerender&' . $this->data['query'] );
-       echo wfMessage( 'coll-is_cached' )->rawParams( htmlspecialchars( 
$forceRenderURL ) )->parse();
+       $forceRenderURL = SkinTemplate::makeSpecialUrl(
+               'Book',
+               'bookcmd=forcerender&' . $this->data['query'],
+               PROTO_RELATIVE
+       );
+       echo wfMessage( 'coll-is_cached', $forceRenderURL )->parseAsBlock();
 }
 $t = Title::newFromText( $this->data['return_to'] );
 if ( $t && $t->isKnown() ) {
diff --git a/i18n/en.json b/i18n/en.json
index f77a99e..8b7986a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -91,7 +91,7 @@
     "coll-download_notfound_text": "The file you are trying to download does 
not exist:\nMaybe it has been deleted and needs to be regenerated.",
     "coll-download_failed_title": "Error during download",
     "coll-download_failed_text": "There was an error when downloading the 
file: $1",
-    "coll-is_cached": "<ul><li>A cached version of the document has been 
found, so no rendering was necessary.\n<a href=\"$1\">Force 
re-rendering.</a></li></ul>",
+    "coll-is_cached": "<ul><li>A cached version of the document has been 
found, so no rendering was necessary. [$1 Force re-rendering].</li></ul>",
     "coll-excluded-templates": "* Templates in category [[:Category:$1|$1]] 
have been excluded.",
     "coll-blacklisted-templates": "* Templates on blacklist [[:$1]] have been 
excluded.",
     "coll-book_title": "Order as a printed book",

-- 
To view, visit https://gerrit.wikimedia.org/r/149265
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc187acc0d95b6c10dd63e462e93df15ada3e8fe
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Mwalker <mwal...@wikimedia.org>
Gerrit-Reviewer: Cscott <canan...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: Mwalker <mwal...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to