Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » LiveQuery not being required properly?

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 2226 Views
  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    LiveQuery not being required properly? Link to this post

    Hi UncleCheese!

    I'm running the latest checkout of DOM together with the latest checkout of branches/2.4 and started getting errors about livequery not being a function. It's worked before I updated so I'm wondering if something's changed in your code or in theirs?

    Anyways the to fix this for me was to make sure that DataObjectManager requires the file in the __construct() function and that DatePickerField requires it in its Field() function (in case DatePickerField gets used on a page that doesn't have the DOM on it).

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: LiveQuery not being required properly? Link to this post

    Bumping this. I had to add:

    Requirements::javascript('sapphire/thirdparty/jquery-livequery/jquery.livequery.js');


    to line 115 of DataObjectManager.php as a temporary fix.

    Any chance of getting this fixed 0:-)

    Thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: LiveQuery not being required properly? Link to this post

    What version of SS are you guys running? I can't replicate this.

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: LiveQuery not being required properly? Link to this post

    I'm running on the latest SVN checkout from branches/2.4 and the 398 release of DOM. Everything was working until very recently and if I remember correctly it happened after an SVN update from branches/2.4 and not when updating the DOM. I'm not sure though.

    Anyways shouldn't the datepicker field require livequery just in case the DOM isn't loaded on a page using it? datepicker_init.js is depending on it being there. I'll hopefully have time to do some digging and see if I can figure out what and how this was caused.

  • UncleCheese
    Avatar
    4085 Posts

    Re: LiveQuery not being required properly? Link to this post

    Until a recent rev of SS 2.4, livequery was bundled in with LeftAndMain, so that's the reason it's omitted.

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: LiveQuery not being required properly? Link to this post

    So is that recent rev the reason we're getting the error in the DOM as well?

  • UncleCheese
    Avatar
    4085 Posts

    Re: LiveQuery not being required properly? Link to this post

    Yeah, most likely. There was a recent changeset that said livequery had been removed from LeftAndMain because it was not used in CMSMain or AssetAdmin..

    Can you confirm that if you add Requirements::javascript(THIRDPARTY_DIR.'/jquery-livequery/jquery.livequery.js'); to the DOM constructor and the DatePickerField::FieldHolder() method that everything works as expected? I don't have any trunk versions of SS set up.

    Dependency management is such a headache!

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: LiveQuery not being required properly? Link to this post

    There is no FieldHolder() function for DatePickerField, so i added the requirement to Field() instead (line 70)

    I also added the requirment to line 115 of DOM class and both work fine now - though i will not i dont use the date picker field much so havent had a huge test.

    Lastly, i'm not running trunk, i'm running the 2.4 branch (like Smurkas). So this isn't an entirely fringe issue.

    Cheers.

    2226 Views
Page: 1 2
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.