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 CiviReport (Moderator: Dave Greenberg) »
  • Links in Emailed Reports are Relative not Absolute
Pages: [1]

Author Topic: Links in Emailed Reports are Relative not Absolute  (Read 1187 times)

Keith

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Links in Emailed Reports are Relative not Absolute
May 19, 2011, 10:49:41 am
I have set up a number of automatically emailed reports, including reports constituent report and activity report.

The reports come through just fine.

However, all the links in all reports are relative links, i.e, '/index.php?.....' rather than 'http://oursite.com/index.php?....'

E.g.
Code: [Select]
<a title="View Contact Summary for this Contact" href="/index.php?q=civicrm/contact/view&amp;reset=1&amp;cid=3257">
It should be
Code: [Select]
<a title="View Contact Summary for this Contact" href="http://mysite.com/index.php?q=civicrm/contact/view&amp;reset=1&amp;cid=3257">
I understand that absolute reports are not required when viewing the report from within Civi. However, when clicking on the link from within an email, it will give an error.

What is most interesting is that the link to the report in civi (at the top of the email), is correctly formatted!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Links in Emailed Reports are Relative not Absolute
May 19, 2011, 01:08:35 pm

This is a bug. Would be great if you can investigate and help patch this bug.

Seems like the reporting framework should always create absolute links when in "email" mode.

Ping us on IRC if you need help getting started

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Keith

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Re: Links in Emailed Reports are Relative not Absolute
May 19, 2011, 01:55:38 pm
I'd be happy to give it a try.

Could you give me hints as to where to look? I am familiar with PHP but not with the civicrm framework.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Links in Emailed Reports are Relative not Absolute
May 19, 2011, 03:40:15 pm

Most of the report code is in: CRM/Report/Form

the url function called is: CRM_Utils_System::url

The third argument should be true to generate an absolute url. The couple of cases i checked, it seemed to do the right thing. maybe you can trace one specific report and figure out whats happening and why

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Links in Emailed Reports are Relative not Absolute

This forum was archived on 2017-11-26.