From 9f4a7c6da1cb328a32bd1cf66ae7095b4493a2c0 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Sat, 12 Dec 2020 23:44:22 +1100 Subject: [PATCH 1/2] MDL-70459 core_payment: use array_merge to merge currencies --- payment/classes/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payment/classes/helper.php b/payment/classes/helper.php index f0792b1c932..b5dc3c17471 100644 --- a/payment/classes/helper.php +++ b/payment/classes/helper.php @@ -49,7 +49,7 @@ class helper { /** @var \paygw_paypal\gateway $classname */ $classname = '\paygw_' . $plugin . '\gateway'; - $currencies += component_class_callback($classname, 'get_supported_currencies', [], []); + $currencies = array_merge($currencies, component_class_callback($classname, 'get_supported_currencies', [], [])); } $currencies = array_unique($currencies); From 22dfcb10297756752d52298df6f31dd4717b6f17 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Wed, 16 Dec 2020 22:26:44 +1100 Subject: [PATCH 2/2] MDL-70459 enrol_fee: Sort the list of currencies when displaying --- enrol/fee/classes/plugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/enrol/fee/classes/plugin.php b/enrol/fee/classes/plugin.php index 78cbbcd4546..549247cd7a0 100644 --- a/enrol/fee/classes/plugin.php +++ b/enrol/fee/classes/plugin.php @@ -45,6 +45,10 @@ class enrol_fee_plugin extends enrol_plugin { $currencies[$c] = new lang_string($c, 'core_currencies'); } + uasort($currencies, function($a, $b) { + return strcmp($a, $b); + }); + return $currencies; }