--- classes/plugins/PKPPlugin.old.inc.php 2011-05-24 13:33:43.000000000 -0700 +++ classes/plugins/PKPPlugin.inc.php 2011-05-24 12:35:13.000000000 -0700 @@ -543,11 +544,18 @@ $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO'); $sql = $emailTemplateDao->installEmailTemplates($this->getInstallEmailTemplatesFile(), true, null, true); - if ($sql) { - $result = $installer->executeSQL($sql); - } else { + + if ($sql === false) { + // The template file seems to be invalid. $installer->setError(INSTALLER_ERROR_DB, str_replace('{$file}', $this->getInstallDataFile(), Locale::translate('installer.installParseEmailTemplatesFileError'))); $result = false; + } else { + // Are there any yet uninstalled email templates? + assert(is_array($sql)); + if (!empty($sql)) { + // Install templates. + $result = $installer->executeSQL($sql); + } } return false; }