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

Change subject: Allow defining clousre for notification icon path
......................................................................


Allow defining clousre for notification icon path

In some cases, we need to add wgLang->getDir() for icon patch, but
wgLang is not yet fully initialized

Bug: 58705
Change-Id: I72fcb8e4cff9437d66ff9b60669701f572060389
---
M formatters/BasicFormatter.php
M includes/EmailFormatter.php
2 files changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/formatters/BasicFormatter.php b/formatters/BasicFormatter.php
index 8d3bce3..f9f1aa6 100644
--- a/formatters/BasicFormatter.php
+++ b/formatters/BasicFormatter.php
@@ -191,6 +191,10 @@
                        if ( !isset( $iconInfo['path'] ) || !$iconInfo['path'] 
) {
                                // Fallback in case icon is not configured; 
mainly intended for 'site'
                                $iconInfo = 
$wgEchoNotificationIcons['placeholder'];
+                       } else {
+                               if ( is_callable( $iconInfo['path'] ) ) {
+                                       $iconInfo['path'] = call_user_func( 
$iconInfo['path'] );
+                               }
                        }
                        $iconUrl = "$wgExtensionAssetsPath/{$iconInfo['path']}";
                }
diff --git a/includes/EmailFormatter.php b/includes/EmailFormatter.php
index 61b23e3..fcfba2c 100644
--- a/includes/EmailFormatter.php
+++ b/includes/EmailFormatter.php
@@ -177,6 +177,10 @@
                } else {
                        if ( !isset( $iconInfo['path'] ) || !$iconInfo['path'] 
) {
                                $iconInfo = 
$wgEchoNotificationIcons['placeholder'];
+                       } else {
+                               if ( is_callable( $iconInfo['path'] ) ) {
+                                       $iconInfo['path'] = call_user_func( 
$iconInfo['path'] );
+                               }
                        }
                        $iconUrl = "$wgExtensionAssetsPath/{$iconInfo['path']}";
                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I72fcb8e4cff9437d66ff9b60669701f572060389
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to