CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • profile image dir stored wrong in the db
Pages: [1]

Author Topic: profile image dir stored wrong in the db  (Read 914 times)

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
profile image dir stored wrong in the db
September 08, 2010, 06:27:47 am
I get this error when trying to view a profile image:
warning: getimagesize(http://<domain>/sites/site26627/web/sites/default/files/civicrm/custom/TF_banner002_98bf4b5a7203fd48984c2b51a832cb68.jpg)

which is wrong, the image IS stored on the filesystem, but is in
http://<domain>/sites/default/files/civicrm/custom/TF_banner002_98bf4b5a7203fd48984c2b51a832cb68.jpg

I found these settings in "Settings - Update Directory Path and URL" which where created by the install, I did not change it:
Old Base Directory     /home/sites/site26627/web/sites/default/files/
Old Base URL     http://<domain>/
Old Site Name     /sites/site26627/

The first and second one seem normal. This IS the place of the "files" dir
But the last is weird: I would think it should be
/sites/default/

But if I enter it there I get only WSOD's
In the error logging I find then:
[Wed Sep 08 15:15:50 2010] [error] [client 80.57.107.214] Directory index forbidden by Options directive: /home/sites/site26627/web/sites/all/modules/civicrm/i/, referer: http://<domain>/civicrm/admin

So "Site Name" should be /sites/site26627/ as it was. But how can I get the right image dir stored in the DB?

Settings in "Settings - Resource URLs" seem normal.

ANY idea??

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: profile image dir stored wrong in the db
September 09, 2010, 01:41:43 am
wowie, that was a difficult search, but I found it.

IF your server is set up like this where the drupal root is something like
/home/sites/<site_id>/web/

then function getRelativePath does not work properly (in CRM/Contact/BAO/Contact.php).
For Drupal sites it will not return the /sites/ dir within the drupal root, but the /sites/<site_id/web/sites/* dir outside drupal root.
Not sure how often this kind of server setup occurs, but CiviCrm should look within the "drupal root" and not outside.

I will make a report in the Issue Tracker.

« Last Edit: September 09, 2010, 01:48:19 am by CatorgHans »

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: profile image dir stored wrong in the db
January 26, 2011, 11:29:48 am
Trying to track down the source of a problem, I came across this field today in Civi 3.3.3.

So did you indeed set that value to /sites/default

Or does it really matter in a non-multi-site installation?

Just /sites/domain.org really does not exist, so that is a bit disturbing. I do not recall that field in Civi 2.0.x which we started with.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: profile image dir stored wrong in the db
March 21, 2011, 07:23:46 pm
I am having the same error.  Should sites be part of this on a multisite install?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • profile image dir stored wrong in the db

This forum was archived on 2017-11-26.