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

Change subject: Apply to view & purge action only
......................................................................


Apply to view & purge action only

also added additional check for potential non-existing key.

Change-Id: Ia9b8738e9615e74314af19bc638f6bd0b2c02dbf
---
M ElectronPdfService.hooks.php
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  WMDE-Fisch: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ElectronPdfService.hooks.php b/ElectronPdfService.hooks.php
index 224f285..0526818 100644
--- a/ElectronPdfService.hooks.php
+++ b/ElectronPdfService.hooks.php
@@ -27,7 +27,12 @@
                        return false;
                }
 
-               if ( $config->has( 'CollectionFormats' ) ) {
+               $action = Action::getActionName( $skin );
+               if ( $action !== 'view' && $action !== 'purge' ) {
+                       return false;
+               }
+
+               if ( $config->has( 'CollectionFormats' ) && array_key_exists( 
'coll-print_export', $bar ) ) {
                        $index = self::getIndexOfDownloadPdfSidebarItem(
                                $bar['coll-print_export'],
                                $config->get( 'CollectionFormats' )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9b8738e9615e74314af19bc638f6bd0b2c02dbf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ElectronPdfService
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: WMDE-Fisch <christoph.jau...@wikimedia.de>
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