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 »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error with using drop downs and actions box in Civicrm
Pages: [1]

Author Topic: Error with using drop downs and actions box in Civicrm  (Read 1051 times)

SandyEllingson

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 1
  • I want to make a difference!
    • Sandy Social Strategist
Error with using drop downs and actions box in Civicrm
April 01, 2015, 06:03:04 am
I am using Civicrm 4.5.8 on Wordpress.  When I try to expand an area on a contact like "Address" or when I try to select records in a search and use the action box, nothing happens. I have tried all browsers. I see this error:
TypeError: CRM.formatMoney is not a function but that function is defined here:

/wp-content/plugins/civicrm/civicrm/js/Common.js   

and it's there AND the site loads that file. I'm not sure what the problem is and I don't know how to fix it.  Thoughts?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 06:37:31 am
Can you check http://forum.civicrm.org/index.php/topic,35850.0.html
Try asking your question on the new CiviCRM help site.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 07:14:44 am
I investigated this site and first replaced the CiviCRM code with a fresh upload, just in case there was an problem there, and I reinstalled to make sure the settings file is OK.

When I visit the CiviCRM home page  /wp-admin/admin.php?page=CiviCRM I see in Firebug:

Code: [Select]
TypeError: $.fn.select2 is undefined

$.fn.select2.defaults.dropdownCssClass = $.ui.dialog.prototype.options.dialogCla...

Common.js?r=2l3ua (line 196, col 2)


TypeError: CRM.formatMoney is not a function

CRM.formatMoney('init', "$ 1,234.56");

admin.p...r=2l3ua (line 14, col 2)

In the source code of the page I see this:

Code: [Select]
<script type="text/javascript">
var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":false}};
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/jquery-1.11.1.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/jquery-ui/jquery-ui.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/backbone/lodash.compat.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/select2/select2.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.tableHeader.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.textarearesizer.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.form.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.timeentry.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.blockUI.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/DataTables/media/js/jquery.dataTables.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.validate.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.pack.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/js/Common.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/js/crm.ajax.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.menu.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.jeditable.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.notify.min.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/js/jquery/jquery.crmeditable.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/js/crm.optionEdit.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/ajax/l10n-js/en_US&amp;r=2l3ua">
</script>
<link href="/wp-content/plugins/civicrm/civicrm/packages/jquery/css/menu.css?r=2l3ua" rel="stylesheet" type="text/css"/>
<link href="/wp-content/plugins/civicrm/civicrm/packages/jquery/jquery-ui/jquery-ui.min.css?r=2l3ua" rel="stylesheet" type="text/css"/>
<link href="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/DataTables/media/css/jquery.dataTables.min.css?r=2l3ua" rel="stylesheet" type="text/css"/>
<link href="/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/select2/select2.css?r=2l3ua" rel="stylesheet" type="text/css"/>
<link href="/wp-content/plugins/civicrm/civicrm/css/civicrm.css?r=2l3ua" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/js/jquery/jquery.dashboard.js?r=2l3ua">
</script>
<script type="text/javascript" src="/wp-content/plugins/civicrm/civicrm/js/noconflict.js?r=2l3ua">

So /wp-content/plugins/civicrm/civicrm/js/Common.js is there and if I visit that page directly I see the code

 
Code: [Select]
CRM.formatMoney = function(value, format) {   
As it should be. Everything looks fine. I don't know why it should give the error CRM.formatMoney is not a function.

All I can think of is that maybe some of this code:

Code: [Select]
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel='stylesheet' href='/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=dashicons,admin-bar,wp-admin,buttons,wp-auth-check&amp;ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='simplemap-admin-css'  href='/wp-content/plugins/simplemap/inc/styles/admin.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='open-sans-css'  href='//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&#038;subset=latin%2Clatin-ext&#038;ver=4.1.1' type='text/css' media='all' />
<!--[if lte IE 7]>
<link rel='stylesheet' id='ie-css'  href='/wp-admin/css/ie.min.css?ver=4.1.1' type='text/css' media='all' />
<![endif]-->
<link rel='stylesheet' id='wp-cta-admin-css-css'  href='/wp-content/plugins/cta/css/admin-style.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='lp-admin-css-css'  href='/wp-content/plugins/landing-pages/css/admin-style.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='wpleads-global-backend-css-css'  href='/wp-content/plugins/leads//css/wpl.global-backend.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='wpmediacategory-css'  href='/wp-content/plugins/wp-media-library-categories/css/wpmediacategory.min.css?ver=1.5.0' type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css'  href='/wp-includes/js/thickbox/thickbox.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='inbound-admin-css'  href='/wp-content/plugins/cta/shared/assets/admin/css/global-inbound-admin.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='inbound-metaboxes-css'  href='/wp-content/plugins/cta/shared/assets/admin/css/inbound-metaboxes.css?ver=4.1.1' type='text/css' media='all' />

is causing a problem.

SandyEllingson, can you disable some of these plugins and see if that helps?
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.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 07:20:09 am
If one of the plugins or themes on the site ships with select2, this issue might offer the solution: https://issues.civicrm.org/jira/browse/CRM-16154
Try asking your question on the new CiviCRM help site.

SandyEllingson

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 1
  • I want to make a difference!
    • Sandy Social Strategist
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 12:09:29 pm
Thanks Hershel.  I went in and disabled the plugins one at the time and isolated the issue to:

Calls to Action
Display Targeted Calls to Action on your WordPress site.

Version 2.3.0 | By InboundNow | View details
There is a new version of Calls to Action available. View version 2.3.3 details or update now.

I did not want to do an update while we are troubleshooting so I can do that if you want me to and see if it fixes it.

Thanks so much for the help.

Sandy

SandyEllingson

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 1
  • I want to make a difference!
    • Sandy Social Strategist
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 12:37:27 pm
I updated the version of Call to Action and this did not resolve the issue. I also followed Inbound's instructions of testing the issue with one of the basic themes to rule out theme conflict.  That did not resolve it.  I have left a message in their forum and will post any solutions I find when they are received.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 12:52:11 pm
As I had guessed, select2 is the problem. The calls to action plugin includes select2, therefore it collides with the version shipped in CiviCRM.
You can fix this right now by replacing civicrm/civicrm/packages/jquery/plugins/select2/select2.js with this: https://github.com/colemanw/select2/archive/stable/3.5.zip
Try asking your question on the new CiviCRM help site.

SandyEllingson

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 1
  • I want to make a difference!
    • Sandy Social Strategist
Re: Error with using drop downs and actions box in Civicrm
April 01, 2015, 01:04:07 pm
Awesome, I will try this. Thanks so much.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error with using drop downs and actions box in Civicrm

This forum was archived on 2017-11-26.