Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent conflicts on templates_c CRM-16604 #286

Closed
wants to merge 2 commits into from

Conversation

tttp
Copy link

@tttp tttp commented Jun 2, 2015

http://civicrm.stackexchange.com/questions/2923/civicrm-does-not-have-permission-to-write-temp-files/2937#2937

Prevent "CiviCRM does not have permission to write temp files in ... templates_c/..." error messages.
"Drush command terminated abnormally due to an unrecoverable error"

Two users are trying to access the temp files (where, for instance, the compiled templates are stored): www-data (when it's accessed from the website) and the sysadmin that run drush commands

By default, all these temporary files can only modified by the user that created it, so sometimes it's the sysadmin, sometimes it's the webserver user


@@ -1453,6 +1454,9 @@ function _civicrm_init($fail = TRUE) {
}
// include settings file
define('CIVICRM_SETTINGS_PATH', $civicrmSettingsFile);
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {//override the templates_c to avoid conflict
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be defined before including the civicrmSettingsFile? (otherwise, the civicrm.settings.php defines the constant, so the condition will never be true?)
Coding style: the comment should be on a separate line, above the line concerned.

@totten
Copy link
Member

totten commented Jun 3, 2015

When doing drush cvapi system.flush or drush cvupdb, won't this prevent us from flushing the actual templates_c cache?

@tttp
Copy link
Author

tttp commented Jun 3, 2015

@totten indeed, having separate caches is making the clear cache from command line pointless ;(

PR isn't usable as it is then. Plan B?

Can we test if it's a command that actually needs to access the main template_c cache (eg. system.flush or cc cvupdb)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants