0

I've been currently developing a module. Before it was working fine but as I started working on my module, the console throws an error every time I click a link in my Drupal admin menu.

For example:

enter image description here

When I click the "dashboard" link , it says:

enter image description here

When I click the "content" link, it says:

enter image description here

By the way, jquery-1.11.2.min.js is a JQuery library I added in my hook_init function to keep my module working.

function myid_init (){ 
    //Jquery Library
    drupal_add_js(drupal_get_path("module", "myid") . "/js/jquery-1.11.2.min.js");  
}

Im using drupal 7.34. Can anyone explain me, why is this happening and how to fix it? Thanks.

3

I would wager a guess it's because (or related to) Drupal including it's own version (1.4) of jquery, and you trying to include a second copy at version 1.11.2 - some functionality is deprecated in later versions of jquery, items that drupal and its modules are expecting to find. If you need to increase the version use something like the module Jquery Update instead of your own add_js and see if that solves it.

Upgrades the version of jQuery in Drupal core to a newer version of jQuery.

Updates...

Drupal 5 to jQuery 1.2.6

Drupal 6 to jQuery 1.3.2

Drupal 7 to jQuery 1.5.x, 1.7.x, 1.8.x, 1.9.x, 1.10.x and jQuery UI 1.10.2

Drupal 8: TBD

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy