Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.5
-
Fix Version/s: 1.5
-
Component/s: Internationalisation
-
Labels:None
Description
When I attempt to clear the templates_c and upload directories, with the following URI. I get errors saying the template file doesn't exist. It is attempting to clear the locale specific template dir which was not created or being used. Should this locales specific template directories exist? If so why are they not being used created?
http://localhost/civicrm/admin?sessionReset=2&directoryCleanup=3
- user error: Smarty error: the $compile_dir '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US' does not exist, or is not a directory. in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1095.
- warning: Smarty::include(/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%E6/E6C/E6C10C43%%js.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1871.
- warning: Smarty::include() [function.include]: Failed opening '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%E6/E6C/E6C10C43%%js.tpl.php' for inclusion (include_path='.:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm//packages:.:/usr/local/lib/php') in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1871.
- user error: Smarty error: the $compile_dir '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US' does not exist, or is not a directory. in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1095.
- warning: Smarty::include(/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%06/069/0693F89E%%drupal.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1871.
- warning: Smarty::include() [function.include]: Failed opening '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%06/069/0693F89E%%drupal.tpl.php' for inclusion (include_path='.:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm//packages:.:/usr/local/lib/php') in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1871.
- user error: Smarty error: the $compile_dir '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US' does not exist, or is not a directory. in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1095.
- warning: Smarty::include(/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%93/938/938D45F8%%Subject.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1265.
- warning: Smarty::include() [function.include]: Failed opening '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%93/938/938D45F8%%Subject.tpl.php' for inclusion (include_path='.:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm//packages:.:/usr/local/lib/php') in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1265.
- user error: Smarty error: the $compile_dir '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US' does not exist, or is not a directory. in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1095.
- warning: Smarty::include(/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%A6/A67/A6754B0A%%Shortcuts.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1265.
- warning: Smarty::include() [function.include]: Failed opening '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c/en_US/%%A6/A67/A6754B0A%%Shortcuts.tpl.php' for inclusion (include_path='.:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/:/var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm//packages:.:/usr/local/lib/php') in /var/www/www.staging.gbcacm.org/htdocs/drupal/modules/civicrm/packages/Smarty/Smarty.class.php on line 1265.
I found that the locale specific templates_c directory, does not exist and is expected to be there but not created. Here are the two important configuration options from mt civicrm.settings.php file.
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/www.staging.gbcacm.org/drupal_files/civicrm/templates_c' );
define( 'CIVICRM_LC_MESSAGES' , 'en_US' );
In CRM/Core/Config.php the templateCompileDir is set and created.
if (defined('CIVICRM_TEMPLATE_COMPILEDIR'))
{ $this->templateCompileDir = CIVICRM_TEMPLATE_COMPILEDIR; // make sure this directory exists CRM_Utils_File::createDir( $this->templateCompileDir ); }Later on in Config.php, if CIVICRM_LC_MESSAGES is set, it is added to the templateCompileDir.
if ( defined( 'CIVICRM_LC_MESSAGES' ) )
{ $this->lcMessages = CIVICRM_LC_MESSAGES; // reset the templateCompileDir to locale-specific and make sure it exists $this->templateCompileDir .= DIRECTORY_SEPARATOR . $this->lcMessages; CRM_Utils_File::createDir( $this->templateCompileDir ); }