MDL-42292 fix blockversion reading after migration to config table

This commit is contained in:
Petr Škoda 2013-10-11 09:53:12 +02:00
parent f8eff10319
commit c66b839a14

View File

@ -294,7 +294,11 @@ function get_component_version($component, $source='installed') {
// block
if ($type === 'block') {
if ($source === 'installed') {
return $DB->get_field('block', 'version', array('name'=>$name));
if ($CFG->version < 2013092001.02) {
return $DB->get_field('block', 'version', array('name'=>$name));
} else {
return get_config('block_'.$name, 'version');
}
} else {
$blocks = core_component::get_plugin_list('block');
if (empty($blocks[$name]) or !is_readable($blocks[$name].'/version.php')) {