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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.4 Release Testing »
  • Malformed URLs in resources - not seen before 4.4.0
Pages: [1]

Author Topic: Malformed URLs in resources - not seen before 4.4.0  (Read 1916 times)

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Malformed URLs in resources - not seen before 4.4.0
November 01, 2013, 03:37:09 am
We run CiviCRM on drupal 7, on an intranet server. Most of the time, most people access the server using just the server name, e.g. http://lcbru-test/ and this works fine, as does the canonical server name of http://lcbru-test.xuhl-tr.nhs.uk/

However, since upgrading to 4.4.0 we've discovered a problem - when accessing the server using the short version, the resource URLs formed internally to CiviCRM to bring in javascript and css do not get formed correctly. This was not a problem before 4.4.0 so I assume there is a change in the way these URLs are being constructed.

What we now see is:

Code: [Select]
<script type="text/javascript" src="http://lcbru-test/.xuhl-tr.nhs.uk/sites/all/modules/civicrm/packages/jquery/jquery-1.8.3.min.js?mvjnlx"></script>
Something is adding the domain to the server name, but only after a closing slash. Understandably, the web browsers do not process this correctly.

I've tried to track down where in the CiviCRM code this URL is built but I'm afraid I got lost in CRM/Core/Resources.php and the methods therein.

As a workaround, I've configured apache to redirect requests from the short form to the long form, and that works fine. But it might be worth checking out why the URL isn't being built correctly - ours might not be the only situation in which the URL is malformed.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Malformed URLs in resources - not seen before 4.4.0
November 01, 2013, 04:53:10 am
Can you go to the admin screen where you set the url for resource? I should be there that you change it.

I'm not sure why it was modified on the upgrade, but should be simple to fix.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: Malformed URLs in resources - not seen before 4.4.0
November 01, 2013, 07:37:46 am
Hi Xavier,

The CiviCRM Resource URL in that admin page is set correctly, even when accessing the site using the short form of the server name.

It says "http://lcbru-test.xuhl-tr.nhs.uk/sites/all/modules/civicrm"

My civicrm.settings.php has:
Code: [Select]
define( 'CIVICRM_UF_BASEURL'      , 'http://lcbru-test.xuhl-tr.nhs.uk/' );

So it appears that in 4.4.0 this Resource URL isn't being used for bringing in the jquery scripts, but instead something is being generated on the fly based on the server name and the domain being botched together.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Malformed URLs in resources - not seen before 4.4.0
November 01, 2013, 11:12:41 am
Just to clarify -- what version were you on before? The forum profile mentions Civi 4.2. (There were significant changes in 4.3 but fewer in 4.4, so I wonder which revision is more at issue.)

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: Malformed URLs in resources - not seen before 4.4.0
November 04, 2013, 04:36:58 am
It's complicated.

Our live system was updated all the way from 4.2.4 to 4.4.0 on Thursday, and it was the live system in which we noticed the behaviour first. We'd had no reports of the problem from people using the test system, which had been upgraded to 4.3.5 some weeks ago. This might suggest the problem was introduced later than 4.3.5, but it could just be that no-one had cause to use the test system via the short URL in the intervening weeks. Sorry, that's not very helpful. All I can say for certain is that I can't rule out a 4.3.x change being at fault.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.4 Release Testing »
  • Malformed URLs in resources - not seen before 4.4.0

This forum was archived on 2017-11-26.