0

I have CiviCRM 5.18 running with Wordpress on a server where the Wordpress instance is managed by Cloudron (https://cloudron.io). Several other web applications being used as well on the same server, and handling all the updates is greatly simplified by using Cloudron. The CiviCRM settings needed to be tweaked slightly to get it to work: essentially from what I can see the Wordpress code sits in a directory /app/code (which is managed by Cloudron) apart from the wp-content directory which sits in /app/data/ with a symlink.

so, in my civicrm.settings.php file I have:

$civicrm_root = /app/data/wp-content/plugins/civicrm/civicrm/

CiviCRM reports:

[cms.root] as /app/code

[civicrm.root] as /app/data/wp-content/plugins/civicrm/civicrm

[civicrm.files] as /app/data/wp-content/uploads/civicrm

So far so good, and CiviCRM appears to be working flawlessly, with one exception: the WYSIWYG editor isn't loading.

For example, on the 'Memberships' tab of a contribution page, where I would expect to see rich text editor fields for the message text for new memberships and renewals, I'm just seeing standard text fields.

My browser console reports a 404 error on these pages, saying that it failed to load the resource at https://mydomain.org/app/data/wp-content/plugins/civicrm/civicrm/js/wysiwyg/crm.ckeditor.js?r=UgnWN

The URL it should be using is https://mydomain.org/wp-content/plugins/civicrm/civicrm/js/wysiwyg/crm.ckeditor.js?r=UgnWN so for some reason it is incorrectly constructing the URL.

I'm thinking that I could/should be able to override this URL in civicrm.settings.php and so avoid the issue, but I'not sure what variable I need to be setting there. Can anyone advise?

1
  • Kindly check resources url Commented Jan 15, 2020 at 15:33

1 Answer 1

1

This is because your cms.root doesn't match properly with civicrm.root variable and you might be using variables in Resource url for 'CiviCRM Resource URL'.

For such cases you add below two line at the end of the file you will need to change

$civicrm_root = '/app/data/wp-content/plugins/civicrm/civicrm/'; to $civicrm_root = '/app/code/wp-content/plugins/civicrm/civicrm/';

$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . 'wp-content/plugins/civicrm/civicrm';civicrm/';                                                                                                     
$civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . 'wp-content/plugins/civicrm/civicrm';civicrm/';

Thanks

Pradeep

11
  • thanks Pradeep. My Resource URL is currently set in my settings file as mydomain.org/wp-content/plugins/civicrm/civicrm
    – Graham
    Commented Jan 15, 2020 at 16:14
  • Did you try adding above line in civicrm.settings.php? Commented Jan 15, 2020 at 16:28
  • Yes. Added the two lines too civicrm.settings.php. Ensured no trailing slash for CIVICRM_UF_BASEURL. I can see in the browser console that the URL for the creditor js file looks right, but I'm still getting a 404 on that URL. Wondering if Wordpress is at fault there. Looking into it.
    – Graham
    Commented Jan 15, 2020 at 19:31
  • can you please confirm if global $civicrm_root, $civicrm_setting, $civicrm_paths; is present in your civi settings php file on top of the file? Commented Jan 15, 2020 at 19:36
  • 1
    Updated my answer to add '/' at the end of userFrameworkResourceURL and civicrm.root Commented Jan 15, 2020 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.