Le 28/11/2013 11:55, Daniel Berteaud a écrit :
Le 28/11/2013 11:15, Yuri D'Elia a écrit :
Notification messages are created with the same locale that was used
when creating the ticket.

Check the 'locale' column in the ticket/grant table.
Is it fr_FR also there?

Just checked the backup of my MySQL DB before the purge, and this ticket had the locale set to fr_FR


Ok, got it, and here's patch.

The problem is that the expire.php script needs to be run from include/scripts (because it require_once("../init.php")), but the switchLocale function expects to be in the top directory, because it inits gettext using a relative path :

T_bindtextdomain('messages', 'include/locale');


The attached patch simply detects the top directory, and chdir into it before running everything else. With this, you don't need to worry about the current dir of your cron job, I just use this for example:

#!/bin/sh
su -s /bin/bash - www -c "/usr/bin/php /usr/share/dl/include/scripts/expire.php"

Regards, Daniel

--
Daniel Berteaud
FIREWALL-SERVICES SARL.
Société de Services en Logiciels Libres
Technopôle Montesquieu
33650 MARTILLAC
Tel : 05 56 64 15 32
Fax : 05 56 64 15 32
Web : http://www.firewall-services.com

diff -Nur -x '*.orig' -x '*.rej' dl-0.12/htdocs/include/scripts/expire.php mezzanine_patched_dl-0.12/htdocs/include/scripts/expire.php
--- dl-0.12/htdocs/include/scripts/expire.php	2013-11-22 22:32:25.000000000 +0100
+++ mezzanine_patched_dl-0.12/htdocs/include/scripts/expire.php	2013-11-29 13:56:14.960314303 +0100
@@ -1,7 +1,9 @@
 #!/usr/bin/env php
 <?php
 if(!isset($argc)) die("not running from the command line\n");
-require_once("../init.php");
-require_once("admfuncs.php");
+$top=dirname(dirname(dirname(__FILE__)));
+chdir($top);
+require_once("include/init.php");
+require_once("include/admfuncs.php");
 if($gcInternal === false) runGc();
 ?>

Reply via email to