Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » DatePickerField not popping up calendar

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 5795 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: DatePickerField not popping up calendar Link to this post

    This is bizarre. Shawn, what is the difference in the output of using BaseHref() vs leaving it out in terms of the path it creates in your source code?

    When I use something like:

    Requirements::javascript("jsparty/some_file.js");

    The result in my source code is:

    <script src="http://www.mysite.com/jsparty/some_file.js"></script>

    So it shouldn't make a difference. The Requirements class must be thinking that file doesn't exist for some reason.

    Just humor me, and get the result of Director::fileExists('jsparty/jquery/jquery.js'); for me. My expectation is that it will come back false.

  • Shawn Parr
    Avatar
    Community Member
    60 Posts

    Re: DatePickerField not popping up calendar Link to this post

    I know, it is totally crazy.

    I changed the DatePickerField.php file to this:

    function Field() {
    Requirements::javascript("dataobject_manager/javascript/jquery-ui-1.6.js");
       Requirements::javascript($this->BaseHref() . "jsparty/jquery/plugins/livequery/jquery.livequery.js");
       Requirements::javascript("dataobject_manager/code/date_picker_field/datepicker.js");
       Requirements::javascript("dataobject_manager/code/date_picker_field/datepicker_init.js");
          Requirements::css("dataobject_manager/css/ui/ui.all.css");   
          
          if(Director::fileExists('jsparty/jquery/jquery.js')) {
             Requirements::customScript("alert('File Exists')");
          } else {
             Requirements::customScript("alert('File does not exist')");
          }

    The result was 'File Exists.' I then removed it from there and added it to DataObjectManager.php and got 'File Exists.' Which makes absolutely no sense whatsoever.

    If you would like me to do anything else, or format the code differently, please let me know. I'm fairly open for this stuff today, as I'm working on integrating some javascript things and not under specific deadlines today or tomorrow.

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: DatePickerField not popping up calendar Link to this post

    Hi!

    In my case, this error ('jQuery is not defined') was only happening in my 'live' shared host and not in the local WAMP server I use for development. I found it when trying to attach images from the Assets folder to pages through a ImageDataObjectManager: the Assets dropdown was showing up, but selecting a folder did not triggered the loading of the images.

    Hope it helps,
    Juan

  • UncleCheese
    Avatar
    4085 Posts

    Re: DatePickerField not popping up calendar Link to this post

    Right, I get what the error is and when it happens, but what I'm trying to figure out is why it only happens on some systems. Are there any notable differences between your dev and production environments?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: DatePickerField not popping up calendar Link to this post

    Hi!

    I don't know what is the relevant information concerning configuration differences, but I know that to install SS in my shared host I have to manually modify some lines of ManifestBuilder (replacing $baseDir with '//'), something related to PHP running in safe_mode with open_basedir = '/'.

    Also my local development server is WAMP (WampServer 2.0) and the live one is LAMP, but I don't think it matters.

    Best regards,
    Juan

  • UncleCheese
    Avatar
    4085 Posts

    Re: DatePickerField not popping up calendar Link to this post

    Well, guys. The fix is in. I've decided to stop wondering why and just go with what works. Thank you all so much for your diligent testing.

  • Jeramie
    Avatar
    Community Member
    34 Posts

    Re: DatePickerField not popping up calendar Link to this post

    I also had this issue on Silverstripe 2.3.3 with event calendar r83. I followed the solution at http://www.silverstripe.org/dataobjectmanager-module-forum/show/268609?start=8#post268755

    Thanks for everyone posting and testing this. I guess I should have dug deeper prior to my posting it as a separate problem. Thanks!

  • edeis
    Avatar
    Community Member
    4 Posts

    Re: DatePickerField not popping up calendar Link to this post

    I am getting the same problem with the DatePickerField not displaying. Javascript errors throw the error "jQuery is not defined".

    I am running the following:

    -Silverstripe 2.3.7 (was having the same error in 2.3.3 and thought may upgrading would fix it, but no)
    -event_calendar-r88
    -dataobject-manager-r388
    -blogmodule

    5795 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.