Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7135

Contact Image does not save correctly in localized environment because ImageURL is saved with language suffix.

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2.4
    • Fix Version/s: 3.2.6
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When using CiviCRM in a localized environment where the language is indicated by the suffix to the URL, it is impossible to add an image to the contact profile, because the ImageURL is saved with the language suffix, i.e. /es and this causes a 404 error, as the program can't access the image with the language suffix.

      I fixed this problem for my installation by adding:

      $relativePath = str_replace('/es/', '/',$relativePath);

      to the end of the getRelativePath function in CRM/Contact/BAO/Contact.php (aprox line 768).

      This is obviously an unsatisfactory hack, as it only works for Spanish.

      I don't know if a better fix would be to leave the suffix intact here and correct the referencing of the image location to ignore the language suffix.

      Thanks for the help as always!

        Attachments

          Activity

            People

            • Assignee:
              priya Priya Prajapati
              Reporter:
              leonardwestermeyer Leonard Westermeyer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified