Bug 6225

Summary: PHP Fatal error when attempting to install locale
Product: OHS Reporter: James MacGregor <jmacgreg>
Component: GeneralAssignee: Alec Smecher <alec>
Status: ASSIGNED ---    
Severity: normal CC: pkp-support
Priority: P3    
Version: 2.3.2   
Hardware: All   
OS: All   
Version Reported In: 2.3.1 Also Affects:
Attachments: Patch against Harvester 2.3.1

Description James MacGregor 2010-11-19 10:50:00 PST
Nicolas is translating the Harvester into fr_FR (see http://pkp.sfu.ca/support/forum/viewtopic.php?f=4&t=6836&p=26526#p26526). After I add the files to the system and attempt to install the locale from the Site Admin -> Languages page, I get the following PHP error (and the locale is not installed):

PHP Fatal error:  Call to undefined method EmailTemplateDAO::installEmailTemplateData() in /Users/jmacgreg/git/harvester/lib/pkp/classes/i18n/PKPLocale.inc.php on line 297, referer: http://git/harvester/index.php/admin/languages

At first I thought that converting the email_templates_data.xml file into an emailTemplates.xml file using the xslt script Alec provided a while ago might solve the issue, but it doesn't. (The en_US locale hasn't moved to an emailTemplates.xml file either.) I can't seem to find anything on the forum in Bugzilla related to this; I suspect it's just that the Harvester isn't as up-to-date as the other apps.
Comment 1 Alec Smecher 2010-11-19 13:29:34 PST
Created attachment 3344 [details]
Patch against Harvester 2.3.1

Please try the attached patch against OHS 2.3.1. It may be necessary to reload the languages on the administrator's languages page.

Note that this changes the way email templates are stored; you'll need to convert dbscripts/xml/data/locale/fr_FR/email_templates_data.xml to a new format and store the result in locale/fr_CA/emailTemplates.xml -- you can generate the new format by passing the old file through the XSL file at http://pkp.sfu.ca/bugzilla/attachment.cgi?id=2200 (see bug #4153).

This is new code, and only briefly tested, so please report your results back and I can help debug further if needed.
Comment 2 Alec Smecher 2010-11-19 13:30:03 PST
(NOT COMMITTED until we get feedback -- leaving open until then.)
Comment 3 Alec Smecher 2010-11-19 14:42:07 PST
(Never mind comment #2 -- committed to git. Waiting for feedback anyway.)