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 »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP
Pages: [1]

Author Topic: Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP  (Read 2837 times)

nt81

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7
  • MySQL version: MySQL client version: 5.0.51a
  • PHP version: 5.2.9
Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP
June 01, 2012, 07:13:08 pm
I have installed CiviCRM 4.1.1 on Joomla 1.7, running on a Windows XP Pro SP3 sandbox with static IP <sandbox-host-IP> and XAMPP 1.7.7 for Windows.

When accessing Components > CiviCRM from the Joomla backend on the sandbox, using http://<sandbox-host-IP>/joomla17/administrator on IE 8, things work as intended.

When accessing Components > CiviCRM from the Joomla backend using other workstations on the organization network, using http://<sandbox-host-IP>/joomla17/administrator on IE 8, the pages open with errors and the UI is not displayed as intended. As such:

1. The common horizontal CiviCRM menu at the top of all CiviCRM pages (Home, Search, Contacts, Contributions, ..., Logout) does not appear at all!

2. The CiviCRM logo (localhost/joomla17/administrator/components/com_civicrm/civicrm/i/logo_words_small.png) does not appear at all!

3. The "Create New" button under the CiviCRM logo, appears as text and the content of the context menu (Individual, Household, Organization, etc.) that would open up if you click this button, are rather listed in bullets. If I hover over these links, the status bar reads http://<sandbox-host-IP>/joomla17/administrator/...

4. To navigate to the CiviCRM » Administer CiviCRM, Settings - Resource URLs page, for example, I would have to copy the URL (http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1) from the IE address bar of the sandbox and paste it into the address bar of my workstation.

5. Even when the CiviCRM » Administer CiviCRM, Settings - Resource URLs page opens up on my workstation (after copy/pasting the URL from the sandbox), the UI opens up with errors and, in addition to the characteristics above, the buttons on these page refer to localhost; e.g. the "Cancel" button refers to localhost/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url which yields an "Internet Explorer cannot display the webpage" error as my workstation doesn’t have a site hosted locally!

6. Last but not least, and using the CiviCRM » Administer CiviCRM, Settings - Resource URLs page as an example, I get the "Done, but with errors on page" IE error with the following error details:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.2)
Timestamp: Sat, 2 Jun 2012 01:49:17 UTC


Message: 'jQuery' is undefined
Line: 69
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 71
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 257
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 286
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 410
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 453
Char: 5
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 627
Char: 2
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 648
Char: 2
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 660
Char: 2
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 673
Char: 2
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 693
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 700
Char: 2
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: Object expected
Line: 727
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1


Message: 'jQuery' is undefined
Line: 732
Char: 1
Code: 0
URI: http://<sandbox-host-IP>/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1

As noted earlier, when CiviCRM is accessed through the Joomla backend from the sandbox with IE 8, the CiviCRM UI opens up as intended.

When CiviCRM is accessed through the Joomla backend from other workstations on the organization network IE 8 (the intended way for CiviCRM to be used in our organization) using the sandbox/host IP address, the UI opens up incorrectly: I believe the whole problem is to get the site to refer to everything by its IP address or hostname, instead of just 'localhost'.

Any help to resolve this issue would be greatly appreciated.

Thanks in advance.

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: Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP
June 01, 2012, 08:03:22 pm

U should be consistent and either use localhost OR IP-Address on all pages.

Civi cannot deal with both of them at the same time (missing feature)

Might want to follow these steps:

http://wiki.civicrm.org/confluence/display/CRMDOC41/Moving+an+Existing+Installation+to+a+New+Server+or+Location

to ensure that you have the same setting in all files and DB tables

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

nt81

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7
  • MySQL version: MySQL client version: 5.0.51a
  • PHP version: 5.2.9
Re: Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP
June 01, 2012, 10:14:46 pm
Thanks Lobo for your prompt response to my inquiry.

Consistency is what we try to achieve; yet due to our limited knowledge of CiviCRM we’re not sure how to achieve that.

Note that the sandbox (the Windows XP Pro SP3 hosting server) is located on our organization network and only IT members in my organization have access to its Windows UI.

Additionally, both Joomla 1.7 and CiviCRM 4.1.1 were installed from scratch on this sandbox; i.e. they were not moved from an existing installation to a new server or location.

As far as accessing the backend is concerned, whenever we want to access things directly from the sandbox, we use http://<sandbox-host-IP>/joomla17/administrator/ rather than localhost/joomla17/administrator/

For all other users on the network (who do not and should not have access to the Windows UI of the sandbox), the only way to access the backend is, also, http://<sandbox-host-IP>/joomla17/administrator/ through IE8. Of course, this is where the issues described in my initial post came to surface.

So as far as accessing the backend is concerned we are consistent.

Coming to the settings, given the way things are behaving, I’m afraid that somewhere in our settings we have used both <sandbox-host-IP> and localhost.

Of course, prior to posting my question, and with my limited knowledge of CiviCRM, I have done the following troubleshooting:

1. In CiviCRM » Administer CiviCRM, Settings - Resource URLs, the first two URLs are referenced using localhost.

2. Using PHPMyAdmin, I have done a search in all the tables of the Joomla17 database with the civicrm prefix for the <sandbox-host-IP> string and nothing was found.

At this point, I’m not sure where else (database tables or files) to look for to find the <sandbox-host-IP> that’s causing this inconsistency. Additionally, if you think using the <sandbox-host-IP>, instead of localhost, in our CiviCRM settings is the right way to go then I would appreciate you letting me know.

Your help in this regard, would be greatly appreciated.

nt81

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Joomla 1.7
  • MySQL version: MySQL client version: 5.0.51a
  • PHP version: 5.2.9
Re: Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP
June 02, 2012, 01:09:23 am
While I haven’t tested my site thoroughly to verify the validity of my solution, I could gladly verify that all the issues in my initial post have been resolved.

In case someone runs into a similar issue, here is how things started and got resolved in our environment.

Of course, thanks to Lobo’s link, I got to read http://wiki.civicrm.org/confluence/display/CRMDOC41/Override+Server+Directory+and+URL+Settings which gave me enough lead to get to the following solution.

At first, before posting my initial post on this thread, I used to get a time stamped error "[client <sandbox-host-IP>] File does not exist: F:/xampp/htdocs/joomla17/\xc2\xadministrator, referer: http://localhost/joomla17/administrator/index.php?option=com_civicrm" in my F:\xampp\apache\logs\error.log file every time I would open the Components > CiviCRM page from the Joomla backend.

To resolve this issue, under CiviCRM > Administer CiviCRM > Settings > Resource URLs (http://localhost/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1) I made the following changes:

1. CiviCRM Resource URL:

From: http://<sandbox-host-IP>/joomla17/\administrator/components/com_civicrm/civicrm/

To: http://localhost/joomla17/administrator/components/com_civicrm/civicrm/

2. Image Upload URL:

From: http://<sandbox-host-IP>/joomla17/\media/civicrm/persist/contribute/

To: http://localhost/joomla17/media/civicrm/persist/contribute/

Of course, this by itself did not resolve the issues mainly when accessing the sandbox from other workstation on our organization’s network and, hence, I initiated this post.

After going through the link provided by Lobo as well as the hints I got from the content of http://wiki.civicrm.org/confluence/display/CRMDOC41/Override+Server+Directory+and+URL+Settings I made the following changes, which resolved all the issues in my initial post.

Under CiviCRM > Administer CiviCRM > Settings > Resource URLs (http://localhost/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1) I made the following changes:

1. CiviCRM Resource URL:

From: http://localhost/joomla17/administrator/components/com_civicrm/civicrm/

To: http://<sandbox-host-IP>/joomla17/administrator/components/com_civicrm/civicrm/

2. Image Upload URL:

From: http://localhost/joomla17/media/civicrm/persist/contribute/

To: http://<sandbox-host-IP>/joomla17/media/civicrm/persist/contribute/

Note that in order to make these changes successfully (i.e. be able to save the changes), I had to access the backend using http://localhost/joomla17/administrator/ instead of <sandbox-host-IP>/joomla17/administrator/; after all, up until this point, my save button would refer to a link on localhost not <sandbox-host-IP>. Applying the save button, which was referring to localhost while logged in with <sandbox-host-IP>/joomla17/administrator/ would not save the changes.

Similarly, under CiviCRM > Administer CiviCRM > Settings > Upload Directories (http://localhost/joomla17/administrator/?option=com_civicrm&task=civicrm/admin/setting/path&reset=1) I made the following changes:

1. Temporary Files:

From:  F:\xampp\htdocs\joomla17\media\civicrm\upload/

To: F:\xampp\htdocs\joomla17\media\civicrm\upload\

2. Images:

From: F:\xampp\htdocs\joomla17\media\civicrm\persist/contribute/

To: F:\xampp\htdocs\joomla17\media\civicrm\persist\contribute\

3. Custom Files:

From: F:\xampp\htdocs\joomla17\media\civicrm\custom/

To: F:\xampp\htdocs\joomla17\media\civicrm\custom\

These last three changes were made for consistency purposes. Note that all of these paths are local sandbox paths not URLs.

Last but not least, as part of the hints I picked from the http://wiki.civicrm.org/confluence/display/CRMDOC41/Override+Server+Directory+and+URL+Settings article, and after carefully inspecting its content, I made the following change in F:\xampp\htdocs\joomla17\administrator\components\com_civicrm\civicrm.settings.php.

Prior to making the change below to the content of civicrm.settings.php, I logged out of Joomla, stopped both Apache and MySql from the XAMPP Control Panel and created a civicrm.settings.php.original backup.

In civicrm.settings.php, I located the line:

define( 'CIVICRM_UF_BASEURL'      , 'http://localhost/joomla17/administrator/' );

and changed it to:

define( 'CIVICRM_UF_BASEURL'      , 'http://<sandbox-host-IP>/joomla17/administrator/' );

After saving the modified civicrm.settings.php, restarting both Apache and MySql from the XAMPP Control Panel, cleaning the cache of my IE 8 web browser and logging into the Joomla backend Components > CiviCRM page, all the menus appeared correctly, all the missing images appeared correctly and all the buttons would refer to <sandbox-host-IP>.

This was tested by accessing the backend from IE 8 using http://<sandbox-host-IP>/joomla17/administrator/, both locally on the sandbox as well as from other workstations on our organization network.

Thanks to Lobo for the reference and hopefully this would be of use to someone.
« Last Edit: June 02, 2012, 01:17:14 am by nt81 »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Joomla! Installations (Moderator: Deepak Srivastava) »
  • Certain CiviCRM UI links/buttons refer to localhost; others refer to the host IP

This forum was archived on 2017-11-26.