Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » $ is not a function

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3
Go to End
Author Topic: 3339 Views
  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    $ is not a function Link to this post

    After adding the DOM, swfupload and image_gallery modules into a fresh SS 2.4.0 install i started getting '$ is not a function' javascript errors.
    As a result I'm unable to use the SimpleHTMLEditorField in a popup.

    Any ideas what could be causing this?
    I can't disable DOM as i need a WYSIWYG in a popup and drag & drop re-ordering.

  • UncleCheese
    Avatar
    4085 Posts

    Re: $ is not a function Link to this post

    Is it just when you use SimpleHTMLEditorField? Or is this happening everywhere? Any other Javascript plugins that might be colliding?

  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    Re: $ is not a function Link to this post

    I don't have access to that code right now, so i'll have to look into that tonight.
    Best guess though: it happens even without SimpleHTMLEditorField.
    Errors are not limited to the SimpleHTMLEditorField, but they also popup in other JS files.

    My reason for pointing out SimpleHTMLEditorField is that because of the errors the fields don't work.
    Rest of the application seems to work fine, with and without the error.

    If i remember correctly the errors did disappear when i disabled DOM and IG and removed any DOM fields in custom code.
    This i will also double check tonight.

    As far as any other javascript, I don't have any other modules installed or any custom code using JS.

    p.s.
    I'm using the latest trunk versions of the modules.

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: $ is not a function Link to this post

    The problem is a JQUERY conflict.
    Use NoConflict function of Jquery.

  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    Re: $ is not a function Link to this post

    Just did some testing.
    The error appears whenever i try to edit a DataObject using DOM.
    I think it's due to the fact that you clear all requirements and add the JS in your own way.

    DataObjectManager.php line 752, class DataObjectManager_Popup
    You add jQuery and prototype in there, which i suspect is causing the problem.
    I tried adding a file containing jQuery.noConflict(); after the main jQuery file, but i still got the error.

  • UncleCheese
    Avatar
    4085 Posts

    Re: $ is not a function Link to this post

    I can't replicate this on the demo site. This popup contains an html editor, and several other js plugins including tabs, and I'm not getting the error.

    http://dataobjectmanager.carlinowebdesign.com/admin/cms/EditForm/field/StaffMembers/add

    admin/password

  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    Re: $ is not a function Link to this post

    I can't replicate the error on your demo site either (although I'm on a different computer at the moment).
    Also my setup differs a bit from yours.

    CustomPage
    -- CustDataObject (managed by DOM, should contain 2 WYSIWYG editors)
    ---- CustFileDataObject (managed by FDOM, seperate tab in the CustDataObject form)

    Also which versions are you using?
    I'll try to setup an online demo tonight if the issue still hasn't been resolved.

  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    Re: $ is not a function Link to this post

    Sorry it took so long but had a busy weekend.
    So here's the online demo:
    http://loomanskeukens.madclog.nl/admin/show/5#Root_Content_set_Kitchens
    admin / password

    UC, if you need the files hit me up with an address where i can sent them to.
    The entire module consists of 3 DataObject and 2 templates (front-end only), then you'd be able to run the module on your own installation.

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