Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

LiveQuery not being required properly?


Go to End


12 Posts   3466 Views

Avatar
MarcusDalgren

Community Member, 288 Posts

27 May 2010 at 3:07am

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).

Avatar
dhensby

Community Member, 253 Posts

28 May 2010 at 11:21pm

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

29 May 2010 at 1:48am

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

Avatar
MarcusDalgren

Community Member, 288 Posts

29 May 2010 at 2:21am

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.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

29 May 2010 at 2:55am

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

Avatar
MarcusDalgren

Community Member, 288 Posts

29 May 2010 at 3:57am

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

29 May 2010 at 4:58am

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!

Avatar
dhensby

Community Member, 253 Posts

30 May 2010 at 5:40am

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.

Go to Top