Answers.Body: <p>UPDATE:
  A fix for multisites and Aegir setups will come out in CiviCRM 4.7.21.
  See <a href="https://issues.civicrm.org/jira/browse/CRM-193" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-193</a></p>
  
  <hr>
  
  <p>The fix for our problem ended up being somewhat multidimensional.</p>
  
  <p>The patch in <a href="https://issues.civicrm.org/jira/browse/CRM-19303" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-19303</a> solved the issue of the autogenerated path for the [civicrm.files] variable in 'Settings - upload directories' differing from the URL path generated in 'Settings - Resource URL'.</p>
  
  <p>Though the issue doesn't seem completely solved, the patch has very recently been merged <a href="https://github.com/civicrm/civicrm-core/pull/9409" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/9409</a></p>
  
  <p>(There is a bit of a rabbit hole that leads to <a href="https://github.com/civicrm/civicrm-core/pull/9053" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/9053</a>).</p>
  
  <p>But this did not totally fix the problem for CKEditor as the CKEditor config file is being placed in the persist directory (instead of persist/contribute) and the persist directory kept returning  a 403 error. Until CRM-19303 is fixed we circumvented it by allowing the vhost to read the persist directory instead of persist/contribute. We temporarily patched hosting_civicrm to do this. </p>
  
  <p>Aegir was also throwing some file permission errors when creating new sites, and appears to be a different issue, see <a href="https://www.drupal.org/node/2791953" rel="nofollow noreferrer">https://www.drupal.org/node/2791953</a>. We applied the patch which will likely get committed.</p>
  
  <p>We had to enable the Aegir fix_permissions and fix_ownership modules for this, which are experimental, but somewhat necessary here.</p>
  
  <p>For now you still need to manually run a Verify on the site after creating it.</p>
  
  <p>Thanks to Kainuk (<a href="https://civicrm.stackexchange.com/users/110/kainuk">https://civicrm.stackexchange.com/users/110/kainuk</a>) for his pointer and to Guillaume Boudrias from praxis.coop (<a href="https://www.drupal.org/u/gboudrias" rel="nofollow noreferrer">https://www.drupal.org/u/gboudrias</a>) for going down the rabbit holes to fix the problem.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-01T10:03:00.383Z
Answers.LastActivityDate: 2017-07-04T15:40:26.330Z
Answers.LastEditDate: 2017-07-04T15:40:26.330Z
Answers.UserDisplayName: Davy Ivins
Body: <p>Drupal-7.54 , CiviCRM-4.7.16
  Multi-site / Aegir platform.</p>
  
  <p>On a clean Drupal+CiviCRM instal the autogenerated path for the [civicrm.files] variable in 'Settings - upload directories' differs from the URL path generated in 'Settings - Resource URL'.</p>
  
  <p>In Settings- Upload Directories the civicrm.files variable is: var/aegir/platforms/platform_name/sites/<strong><em>siteURL</em></strong>/files/civicrm</p>
  
  <p>In Settings- Resource URL the civicrm.files variable is: h t t p://siteURL/sites/<strong><em>default</em></strong>/files/civicrm/</p>
  
  <p>The problem does not arise in a non-multi-site environment, where both paths point to 'sites/default/files/civicrm (as confirmed on the sandbox demo).</p>
  
  <p>This also seems to affect the path to the files/civicrm/persist directory. </p>
  
  <p>One effect of this seems to be on CKEditor: when the CKEditor configurator is used it creates files (e.g. crm-ckeditor-civimail.js) in the persist directory. But these files are ignored when CKEditor is used in Civimail (see <a href="https://civicrm.stackexchange.com/questions/17220/how-do-i-allow-all-tags-in-ckeditor">Solved: How do I allow all tags in CKeditor</a>, and <a href="https://civicrm.stackexchange.com/questions/16641/4-7-15-breaks-civimail-styles-and-templates-fullpage-doesnt-help">4.7.15 breaks civimail styles and templates (fullPage doesn&#39;t help)</a> and maybe <a href="https://civicrm.stackexchange.com/questions/16536/civimail-template-format-in-html-not-saving">CiviMail template format in HTML not saving</a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-22T11:22:45.377Z
Comments.Text: https://issues.civicrm.org/jira/browse/CRM-19303
Comments.UserDisplayName: Kainuk - CiviCooP
Tags: <drupal><issues><ckeditor><drupal-multi-site>
Title: Solved: Is this a bug - [civicrm.files] variable
ThreadText: # Solved: Is this a bug - [civicrm.files] variable
  
  (Asked by: username_0 on 2017-02-22)
  
  Drupal-7.54 , CiviCRM-4.7.16
  Multi-site / Aegir platform.
  
  On a clean Drupal+CiviCRM instal the autogenerated path for the [civicrm.files] variable in 'Settings - upload directories' differs from the URL path generated in 'Settings - Resource URL'.
  
  In Settings- Upload Directories the civicrm.files variable is: var/aegir/platforms/platform\_name/sites/***siteURL***/files/civicrm
  
  In Settings- Resource URL the civicrm.files variable is: h t t p://siteURL/sites/***default***/files/civicrm/
  
  The problem does not arise in a non-multi-site environment, where both paths point to 'sites/default/files/civicrm (as confirmed on the sandbox demo).
  
  This also seems to affect the path to the files/civicrm/persist directory.
  
  One effect of this seems to be on CKEditor: when the CKEditor configurator is used it creates files (e.g. crm-ckeditor-civimail.js) in the persist directory. But these files are ignored when CKEditor is used in Civimail (see [Solved: How do I allow all tags in CKeditor](https://civicrm.stackexchange.com/questions/17220/how-do-i-allow-all-tags-in-ckeditor), and [4.7.15 breaks civimail styles and templates (fullPage doesn't help)](https://civicrm.stackexchange.com/questions/16641/4-7-15-breaks-civimail-styles-and-templates-fullpage-doesnt-help) and maybe [CiviMail template format in HTML not saving](https://civicrm.stackexchange.com/questions/16536/civimail-template-format-in-html-not-saving)
  
  **Tags:** drupal, issues, ckeditor, drupal-multi-site
  
  > **Comments:**
  > **username_1**: https://issues.civicrm.org/jira/browse/CRM-19303  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-03-01. Score: 1
  
  UPDATE:
  A fix for multisites and Aegir setups will come out in CiviCRM 4.7.21.
  See <https://issues.civicrm.org/jira/browse/CRM-193>
  
  ---
  
  The fix for our problem ended up being somewhat multidimensional.
  
  The patch in <https://issues.civicrm.org/jira/browse/CRM-19303> solved the issue of the autogenerated path for the [civicrm.files] variable in 'Settings - upload directories' differing from the URL path generated in 'Settings - Resource URL'.
  
  Though the issue doesn't seem completely solved, the patch has very recently been merged <https://github.com/civicrm/civicrm-core/pull/9409>
  
  (There is a bit of a rabbit hole that leads to <https://github.com/civicrm/civicrm-core/pull/9053>).
  
  But this did not totally fix the problem for CKEditor as the CKEditor config file is being placed in the persist directory (instead of persist/contribute) and the persist directory kept returning a 403 error. Until CRM-19303 is fixed we circumvented it by allowing the vhost to read the persist directory instead of persist/contribute. We temporarily patched hosting\_civicrm to do this.
  
  Aegir was also throwing some file permission errors when creating new sites, and appears to be a different issue, see <https://www.drupal.org/node/2791953>. We applied the patch which will likely get committed.
  
  We had to enable the Aegir fix\_permissions and fix\_ownership modules for this, which are experimental, but somewhat necessary here.
  
  For now you still need to manually run a Verify on the site after creating it.
  
  Thanks to username_1 (<https://civicrm.stackexchange.com/users/110/username_1>) for his pointer and to Guillaume Boudrias from praxis.coop (<https://www.drupal.org/u/gboudrias>) for going down the rabbit holes to fix the problem.
  
  
  ---
  
  