Answers.Body: <p>Problem fixed overriding <code>['cms.root']['path']</code> on civicrm.settings.php file.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-06T17:31:31.393Z
Answers.LastActivityDate: 2023-12-06T17:31:31.393Z
Answers.UserDisplayName: marcelo2605
Answers.Body: <p>Can you check your resource URL settings?</p>
  <p>CiviCRM &gt;&gt; Administer &gt;&gt; System Settings &gt;&gt; Resource URL.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-06T15:35:45.007Z
Answers.Text: CiviCRM Resource URL: https://mysite.local/wp-content/plugins/civicrm/civicrm. Image Upload URL: [civicrm.files]/persist/contribute/
Answers.UserDisplayName: marcelo2605
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-06T15:43:17.340Z
Answers.Text: @Predeep Nayak, I believe the problem is `[civicrm.files]/persist/contribute/`. Inside file public_html/wp-content/plugins/civicrm/civicrm/packages/kcfinder/integration/civicrm.php, it's returning the wrong path (/-content/uploads/civicrm/persist/contribute/). But when I run the function `Civi::paths()->getUrl("[civicrm.files]/persist/contribute/")` in the functions.php of my theme, I got the correct path.
Answers.UserDisplayName: marcelo2605
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-06T15:23:32.530Z
Answers.LastActivityDate: 2023-12-06T15:23:32.530Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>When I click Browse Server within the Image Properties modal, I can see the list of images (the URL is correct). However, after clicking on an image to be added to the editor, the URL becomes incorrect. For some reason KCFinder removes <code>wp</code> from <code>wp-content</code>. The URL something like this: <a href="https://mysite.local/-content/uploads/civicrm/persist/contribute/images/image.png" rel="nofollow noreferrer">https://mysite.local/-content/uploads/civicrm/persist/contribute/images/image.png</a></p>
  
Tags: <wordpress><kcfinder>
Title: URL of images added by KCFinder are wrong
ThreadText: # URL of images added by KCFinder are wrong
  
  (Asked by: username_0 on 2023-12-06)
  
  When I click Browse Server within the Image Properties modal, I can see the list of images (the URL is correct). However, after clicking on an image to be added to the editor, the URL becomes incorrect. For some reason KCFinder removes `wp` from `wp-content`. The URL something like this: <https://mysite.local/-content/uploads/civicrm/persist/contribute/images/image.png>
  
  **Tags:** wordpress, kcfinder
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2023-12-06. Score: 2
  
  Problem fixed overriding `['cms.root']['path']` on civicrm.settings.php file.
  
  
  ---
  
  ### Answer by username_1 on 2023-12-06. Score: 0
  
  Can you check your resource URL settings?
  
  CiviCRM >> Administer >> System Settings >> Resource URL.
  
  > **Comments:**
  > **username_0**: CiviCRM Resource URL: https://mysite.local/wp-content/plugins/civicrm/civicrm. Image Upload URL: [civicrm.files]/persist/contribute/  
  > **username_0**: @Predeep username_1, I believe the problem is `[civicrm.files]/persist/contribute/`. Inside file public_html/wp-content/plugins/civicrm/civicrm/packages/kcfinder/integration/civicrm.php, it's returning the wrong path (/-content/uploads/civicrm/persist/contribute/). But when I run the function `Civi::paths()->getUrl("[civicrm.files]/persist/contribute/")` in the functions.php of my theme, I got the correct path.  
  
  ---
  
  