Browse files

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.
  • Loading branch information...
1 parent d2713ef commit fa1415f193ec9eb285ee75d354759aca903954a5 @mudrd8mz mudrd8mz committed with stronk7 Dec 6, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/pluginlib.php
View
12 lib/pluginlib.php
@@ -1250,9 +1250,15 @@ protected function cron_notifications(array $changes) {
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

0 comments on commit fa1415f

Please sign in to comment.