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 (Moderator: Dave Greenberg) »
  • Problem with date picker
Pages: [1]

Author Topic: Problem with date picker  (Read 10885 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Problem with date picker
July 09, 2008, 08:23:30 am
I just moved a site to a new hosting provider. Ran into an issue with the date picker on the new location. I get the following error in firebug when the date picker is clicked:

Calendar._TT is undefined
[Break on this error] this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];

I've confirmed my dates are all set in global settings. It's definitely reaching the necessary dojo and js files. But for some reason it's not retrieving this value from js/lang/calendar-en.js

Any ideas? I thought it might be a permissioning problem, because my file ownership got a little messed up with the transfer. But I've traced everything back in the js and dojo directories, and they appear to be fine.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problem with date picker
July 09, 2008, 08:58:27 am
Hi,

Are you really sure all the js are loaded (don't remember the detail, but I had this issue)

check with firebug if all the js requested are really loaded

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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Problem with date picker
July 09, 2008, 09:28:13 am
It definitely appears they are all loaded. I'm not getting any errors to the contrary. And the firebug error references the file and line specifically, which would indicate it's accessing the file.

I did have a problem earlier where not all dojo files were loaded, but it was a permissioning problem, and they are now loading correctly.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Problem with date picker
July 09, 2008, 11:24:44 am
Quote from: lcdweb on July 09, 2008, 08:23:30 am
I just moved a site to a new hosting provider. Ran into an issue with the date picker on the new location. I get the following error in firebug when the date picker is clicked:

Calendar._TT is undefined
[Break on this error] this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];

I've confirmed my dates are all set in global settings. It's definitely reaching the necessary dojo and js files. But for some reason it's not retrieving this value from js/lang/calendar-en.js

The calendar shouldn’t be including the js/lang/calendar-en.js file, it should be including the js/lang/calendar-lang.php file with the locale of en_US specified after a question mark.

Can you check whether your setup returns the proper file when accessing the proper URL (in my case: http://localhost/civicrm/trunk/sites/all/modules/civicrm/js/lang/calendar-lang.php?en_US) and that the returned file is served as Content-Type: application/x-javascript?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Problem with date picker
July 09, 2008, 12:41:49 pm
Yes, you're correct, it is pulling that file. I didn't look closely enough when I quoted the file earlier. The following are included:

Code: [Select]
<script type="text/javascript" src="http://domain/administrator/components/com_civicrm/civicrm/js/calendar.js"></script>
<script type="text/javascript" src="http://domain/administrator/components/com_civicrm/civicrm/js/lang/calendar-lang.php?en_US"></script>
<script type="text/javascript" src="http://domain/administrator/components/com_civicrm/civicrm/js/calendar-setup.js"></script>

There's actually two errors rendered by firebug:

Code: [Select]
Calendar._TT is undefined
Calendar(null, Wed Jul 09 2008 00:00:00 GMT-0400 (Eastern Daylight Time), onSelect(cal), function())calendar.js (line 32)
(?)()calendar-setup.js (line 211)
[Break on this error] this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Problem with date picker
July 10, 2008, 10:20:24 am
Hm, I’m not a JavaScript wizard, but these files are included in the <head> of the HTML document, so their inclusion order shouldn’t matter; they aren’t called there.

Can you please check whether http://domain/administrator/components/com_civicrm/civicrm/js/lang/calendar-lang.php?en_US actually displays the Calendar._TT-defining JavaScript, and whether it’s served as Content-Type: application/x-javascript?

If you have cURL, you can do the latter like this:

Code: [Select]
shot@devielle:~$ curl -Is http://localhost/civicrm/trunk/sites/all/modules/civicrm/js/lang/calendar-lang.php?en_US
HTTP/1.1 200 OK
Date: Thu, 10 Jul 2008 17:19:59 GMT
Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.2 with Suhosin-Patch
X-Powered-By: PHP/5.2.4-2ubuntu5.2
Expires: Fri, 11 Jul 2008 10:19:59 -0700
Last-Modified: Thu, 10 Jul 2008 17:19:59 GMT
Cache-Control: max_age=86400
Content-Type: application/x-javascript; charset=utf-8
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Problem with date picker
July 10, 2008, 12:16:26 pm
Hmmm... no, it's not reaching the file. Getting a 500 error. Here's what I'm getting:

Code: [Select]
HTTP/1.0 500 Internal Server Error
Date: Thu, 10 Jul 2008 19:10:25 GMT
Server: Apache/2.2.8 (CentOS)
Connection: close
Content-Type: text/html; charset=UTF-8
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Problem with date picker
July 10, 2008, 03:48:21 pm
Does http://domain/administrator/components/com_civicrm/civicrm/js/calendar.js work? If not, then you have something wrong with your CiviCRM settings.

If it works (which I assume it does, otherwise it wouldn’t complain about Calendar._TT in the first place) then you need to figure out why it doesn’t; your Apache’s logs should be a hint here.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

nithya1

  • Guest
Re: Problem with date picker
February 01, 2009, 06:01:25 pm
Hello

I'm experiencing the exact same problem. The one thing that I noticed is that the js is loaded in the body portion of the page, not in the head. It is served as type "text/javascript" .

<script src="http://domain/administrator/components/com_civicrm/civicrm/js/calendar.js" type="text/javascript">
</script>
<script src="http://domain/administrator/components/com_civicrm/civicrm/js/lang/calendar-lang.php?en_US" type="text/javascript">
</script>
<script src="http://domain/administrator/components/com_civicrm/civicrm/js/calendar-setup.js" type="text/javascript">

Thanks
Vivek
« Last Edit: February 01, 2009, 06:20:14 pm by nithya1 »

nithya1

  • Guest
Re: Problem with date picker
February 01, 2009, 10:59:10 pm
By the way, can I know where you would execute 'curl'? Which command prompt is it? How would you access this for a joomla webserver?

Thanks
Vivek

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Problem with date picker
February 02, 2009, 04:32:39 am
If you try to reach the file directly, per Piotr's suggestion, does it pull up?
I don't recall how I resolved the issue I was experiencing at the time. I would go through your global settings and make sure the url settings are correct, as that's where the reference to javascript libraries are set.

Curl is a reference to either a cron job or SSH.


support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

nithya1

  • Guest
Re: Problem with date picker
February 02, 2009, 10:11:51 am
Hi,
   Thanks for the response. I tried to click the script file name in Firebug and found that it didn't load up. I did as Firebug suggested. I went to the Error Log on Cpanel to find that my Calendar-lang.php in the /administrator/components/com_civicrm/civicrm/js/lang folder had wrong permissions (it was at 0666) (error: file is writable by others:). I changed it to (0644). It works fine now.

No need for SSH for that one now :)

Thanks again
Vivek

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Problem with date picker

This forum was archived on 2017-11-26.