From 31a3bcc93331823318736078ea372b06ac165902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Thu, 6 Dec 2012 00:03:25 +0100 Subject: [PATCH] MDL-37003 Fix repeated line in update notification email There was a problem experienced after 2.4.0 release because the version of the 2.4.0 release was the same as 2.5dev release. So the version value matched twice in the loop and the line was repeated in the email. --- lib/pluginlib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pluginlib.php b/lib/pluginlib.php index 25d480cec31..b740093d906 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -1250,9 +1250,15 @@ class available_update_checker { foreach ($componentupdates as $componentupdate) { if ($componentupdate->version == $componentchange['version']) { if ($component == 'core') { - // in case of 'core' this is enough, we already know that the - // $componentupdate is a real update with higher version - $notifications[] = $componentupdate; + // In case of 'core', we already know that the $componentupdate + // is a real update with higher version ({@see self::get_update_info()}). + // We just perform additional check for the release property as there + // can be two Moodle releases having the same version (e.g. 2.4.0 and 2.5dev shortly + // after the release). We can do that because we have the release info + // always available for the core. + if ((string)$componentupdate->release === (string)$componentchange['release']) { + $notifications[] = $componentupdate; + } } else { // Use the plugin_manager to check if the detected $componentchange // is a real update with higher version. That is, the $componentchange