CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • One solution to javascript or jquery problems
Pages: [1]

Author Topic: One solution to javascript or jquery problems  (Read 4086 times)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
One solution to javascript or jquery problems
September 30, 2011, 04:58:04 pm
After finding that post upgrade to 3.4.6 we could not expand any accordions in Adv Search nor access eg Settings on Manage Contribution Pages with problems identified via 'inspect element' as eg
Uncaught ReferenceError: cj is not defined

on IRC kurund suggested following which proved to be the solution in our case

- regarding jquery failures, if you have jquery_update module, try disabling it ..
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: One solution to javascript or jquery problems
October 01, 2011, 12:58:05 pm
http://issues.civicrm.org/jira/browse/CRM-8774
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: One solution to javascript or jquery problems
October 07, 2011, 12:27:44 am
Peter,

Here is the patch for fixing issues with jquery_update module: https://fisheye2.atlassian.com/changelog/CiviCRM?cs=36592

Once you apply the patch you will need to disable / re-enable CiviCRM module.

Do let me know if it works for you.

Thanks
Kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: One solution to javascript or jquery problems
October 12, 2011, 02:45:01 pm
this patch fixed the issue for me.   folks out there: either apply the patch or replace the civicrm.install and civicrm.module files with the complete versions from the patch above.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

jhood

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
    • My business website
Re: One solution to javascript or jquery problems
October 18, 2011, 05:52:48 am
I just recently upgraded from 3.1 and ran into this same issue. Your advise to overwrite civicrm.install and civicrm.module with the patched versions linked to above worked for me!

If it helps anyone, on Drupal those two files are in the sites/all/modules/civicrm/drupal folder

Thanks!

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: One solution to javascript or jquery problems
May 24, 2012, 04:58:07 am
Is this still an issue, or has this solution been incorporated into a stable release?

I ask because I've just upgraded a Drupal site to CiviCRM 4.1.2 from 3.3, and had to disable jQuery Update for it to work.
Graham Mitchell
http://mc3.coop

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: One solution to javascript or jquery problems
July 10, 2012, 04:04:46 am
I just upgraded a Drupal 6 multisite from CiviCRM 3 to CiviCRM 4.1.3 the jQuery Update module indeed still causes the cj is not defined error.

EDIT: My mistake. Seems that running the Drupal database upgrader fixes this problem.
« Last Edit: July 10, 2012, 11:40:09 am by Hershel »
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: One solution to javascript or jquery problems
September 26, 2012, 09:35:48 am
Does the line
Code: [Select]
if ($config->userFramework == 'Drupal') {near the bottom of CRM/Upgrade/Incremental/php/ThreeFour.php also need to include a check for framework = 'Drupal6' ?

I did an upgrade on Drupal 6 from 3.3 to 4.2 and the weight didn't get updated. Manually updating it didn't solve my specific problem, but I stumbled onto that code while looking into it.

In my case CRM-8774 causes custom js added during a hook to now get added AFTER the noconflict call, and changing the weight doesn't help because the hook always runs later. Changing *some* of the cj's to $'s in the custom code seems to fix it but why only *some* confuses me - will have to play with that *some* more.

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: One solution to javascript or jquery problems
October 01, 2012, 09:07:32 am
Just for anyone looking for this where your custom javascript inserted during a hook is no longer working because of the new placement of noconflict, it's probably because of a reference to the jQuery object directly in your javascript. Changing just that part to "cj" seems to work, and then you can leave any $ signs and other references to cj as is.

Also updated the upgrade code to check for Drupal6. (http://issues.civicrm.org/jira/browse/CRM-10958)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • One solution to javascript or jquery problems

This forum was archived on 2017-11-26.