[Building Sakai] EmailTemplateService

Steve Swinsburg steve.swinsburg at gmail.com
Wed Jul 18 17:03:35 PDT 2012


Hi Brian,

Are you on Oracle? If so, you might have found the cause of this bug:
https://jira.sakaiproject.org/browse/SAK-21835

Do you have multiples in your database? It seems like an intermittent problem so it would be good to put this one to rest.

cheers,
Steve

references:
http://collab.sakaiproject.org/pipermail/sakai-dev/2011-September/014132.html
https://jira.sakaiproject.org/browse/SAK-20987
https://jira.sakaiproject.org/browse/SAK-20825


On 19/07/2012, at 12:55 AM, Brian Jones wrote:

> Hi everyone,
> 
> I've been doing some work with the EmailTemplateService, and noticed some
> strange behaviour; specifically with the templateExists() method.
> 
> Let's say I added a template with a key of 'templateKey' and the local is an
> empty string (translated to null in the DB).
> If I call any of the following:
> 
>   emailTemplateService.templateExists( "templateKey", null );
>   emailTemplateService.templateExists( "templateKey", new Locale( "" ) );
>   emailTemplateService.templateExists( "templateKey", Locale.getDefault()
> );
> 
> They all return 'false', even though I'm literally looking at the template
> in the database; it's definitely there! I can do the following as a
> workaround:
> 
>   EmailTemplate origTemplate = emailTemplateService.getEmailTemplate(
> "templateKey", new Locale( "" ) );
>   if( origTemplate != null ) { // Do some stuff }
> 
> This will return me the actual email template; but I don't understand why
> the templateExists() function isn't returning 'true'.
> 
> Any ideas?
> 
> Thanks in advance,
> 
> Brian Jones
> Applications Development
> Information Technology Services
> Support Services Building, Room 4326
> Western University
> (519) 661-2111 x86969
> bjones86 at uwo.ca
> 
> 
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120719/b459993e/attachment.html 


More information about the sakai-dev mailing list