6

you are almost there: instead of using the tag name, use the tag id (eg 5 for Volunteers) CRM.api3('Contact', 'get', { "debug": 1, "sequential": 1, "return": ["tag"], "tag": "5" }).done(function(result) { console.log(result); }); And for performance reasons, we recommend to always set the return param with the list of fields you actually need (by ...


5

Rather than smarty, JavaScript will do the trick. Those tabs are all separate pages, and you can load any CiviCRM page/form as a snippet instead. First, in your extension, use a hook to include the Javascript and provide the contact ID for it: $r = CRM_Core_Resources::singleton() // Provide the contact ID (assuming you've got it handy) $r->addVars('...


4

There are many ways you can update email for contact Using Email api with create action CRM.api3('Email', 'create', {"email": "aaa@asas.comsdsd", "id": 201}).done(function(result) { // do something}); Using Email api with replace action CRM.api3('Email', 'replace', { "values": {"0":{"email":"asasa@asas.com","location_typ_id":"Home"}}, "...


3

The syntax is incorrect - and I just confirmed that the syntax generated by the API Explorer for Getvalue is incorrect, so you're not to blame! The culprit is this line: "return": ["custom_102"], In JSON, the square brackets indicate an array. "return" expects an array for a Get action, but Getvalue accepts only a single value (for the obvious reason). ...


3

Found the problem. Debugging was turned on. Once I turned it off "New Mailing" worked.


3

In case of an angular page use something like function myext_civicrm_angularModules(&$angularModule) { [...] $session =& CRM_Core_Session::singleton(); drupal_add_js(array('CurrentCiviUid' => $session->get('userID')), 'setting'); [...] } and access it in JS: var uid = Drupal.settings.CurrentCiviUid;


3

You're right, that was a bug. I poked around and found a spot for the js that doesn't break under aggregation: https://github.com/civicrm/civicrm-core/pull/7711


3

issues.civicrm.org is down right now - but I see this issue: CRM-12570 "Javascript error when mootools is loaded in Joomla backend". I'll also note that everyone reporting this problem is using Joomla. So my guess is that there's a Joomla plugin that's causing a jQuery conflict or similar. To troubleshoot this, I would: Disable all your other Joomla ...


3

Here's the detailed steps I took to move the angular extension from an extension and into core. if your angular files are not already name spaced, they should be changed. In the angularextension there should be a folder in ang/ named something similar to the module. Namespace this folder to crmModuleName. Outside of the crmModule folder, but inside the ang ...


3

I'm glad you found the cause of your problem. It does sound like something went wrong back when you originally created those dashlets, and it's not clear what that was. But it would be good to proactively repair this during the upgrade. I've created a PR to do so: https://github.com/civicrm/civicrm-core/pull/9672


3

In some CiviCRM pages/forms custom fields are loaded/reloaded via AJAX (you will notice that if you have a set of custom fields based on Activity type, the custom fields update/reload when changing the Activity type to show its correspondent set of custom field). With that in mind you should trigger you script on .ajaxComplete(), something along those lines:...


2

I wrote a Drupal module to do just that! https://www.drupal.org/project/civi_jquery It allows Drupal and CiviCRM to share the same copy of jQuery, and resolves redundant plugins so the browser has a lot less javascript to download and run. Maybe someone could do something similar for Wordpress?


2

To use the native datepicker of the mobile device, the field needs to have type="date". So your code to disable the datepicker popup and use the native device's instead might look like: (function($) { $.ui.datepicker.prototype.options.focus = "button"; $(document).on('crmLoad', function($region) { $('input.dateplugin', $region).each(function() { ...


2

You are experiencing CRM-16035 - Dashlet refresh can crash server. The default dashboard config is pretty close to maxing out the default Debian config for either Apache or PHP-FPM. Depending on your server setup (question says just Apache which typically suggests via mod_php) you probably need to increase either the number of connections Apache permits. ...


2

First - don't edit anything in the templates_c directory! These are cached pre-compiled copies of the template, and are frequently cleared out. Second - it's not advisable to edit the templates that ship with CiviCRM directly, because you'll have to apply your changes on every upgrade. The best practice is to install civix and create an extension, but in ...


2

For a Javascript-only solution, you can also make an API call using user_contact_id for the contact ID. For instance: $result = civicrm_api3('Contact', 'get', [ 'sequential' => 1, 'return' => ["id"], 'id' => "user_contact_id", ]);


2

The X-Content-Type-Options: nosniff header is a security measure that prevents the browser from attempting to detect the MIME type of a download automatically, as this behavior can be exploited for certain kinds of attacks. The browser will block requests for stylesheets and scripts which are not delivered with a CSS or Javascript MIME type, respectively. ...


2

Following my comment - You need to provide existing path in the resource url and directories page. Click the help icon to see the values of diferent global variables that you can make use of(civicrm.files, etc). You can override these values in civicrm.setting.php file according to your paths. More info at https://civicrm.stackexchange.com/a/19498/245


2

This code worked for me: CRM.$(function($) { $('input[type=text]', '#priceset').on('keyup', function() { if ($(this).val()) { $('input[type=radio]:checked', '#priceset').prop('checked', false).each(function() { calculateRadioLineItemValue(this); }); calculateText(this); } }); $('input[type=radio]', '#priceset').on('...


2

I can see the problem (I saw this myself recently), but I don't have a 100% answer. However, the solution is usually to rebuild your multilingual schema. This problem is characterized by: Multilingual mode is activated on your CiviCRM site. Error in the browser console show files not found at a path with the word "undefined" in it. Also, "DB Error: no ...


2

Generically: You have a Javascript error, so I would definitely consult the Troubleshoot Javascript errors post which describes additional steps to try. That said - I know what your problem is, and would like to give a step-by-step of how I worked it out. I see in your second line that you have a syntax error of some sort. A syntax error in JS will ...


2

Ok What's happening is this. If you look at your .crm-accordion-header css rules in an Inspector window in your browser, you will see there is a background-color !important rule earlier in the CSS cascade that is overriding anything you do in jQuery. I was testing this in the Console and drove me nuts too. jQuery does not recognise !important using .css so ...


2

Here's how we do it: We do the two sets of items in a separate price field on the same price set. So the paid options that are required would be in one field, the complementary in another (or several others). I set the price field for the required options to required. Then they are forced to choose one of them. We only have one item in the required section ...


2

I haven't found the answer to this question, but I can avoid it instead. These functions: CRM_Core_Resources::singleton()->addScriptUrl() CRM_Core_Resources::singleton()->addScriptFile() CRM_Core_Resources::singleton()->addStyleFile() all generate html that gets stored for later output, which is smart most of the time, so it can do some more ...


1

Also in the database in the 'url' column I see the url of the dashlet in the form: civicrm/report/instance/42?reset=1&section=2&snippet=5&context=dashlet and comparing entries with data in the name column I can see that the report instance number matches. So I replace the NULL entry with 'report/xx' where xx is the report instance number as ...


1

Great to hear you're using my extension! Since the extension works but the form doesn't, that strongly suggests the problem is with this form and not the database. From your video, it looks like a JavaScript issue. Here's what I would look at: Press F12 in your web browser to bring up the dev tools. Look at the "Console" tab. Are there errors that ...


1

We had the same problem for a Joomla install with Civi 5.7.2. Deubgging wasn't on, but Asset Caching was. Turning off Asset Caching fixed it for us.


1

Try enclosing your jquery code in: CRM.$(function($) { $(document).ready(function () { }); });


1

Where are you trying to add the script -- in the "Footer" editor window on the Event details page? If so, you probably need to add it in the Wordpress side (e.g. as an HTML/Text widget) rather than the CiviCRM editor to avoid these security notices. If you only want to have the widget show on CiviCRM pages, or SSL pages, etc. you may find this Q&A on ...


1

Since you are using 4.6, the answer is that you need to ensure templates/CRM/common/wysiwyg.tpl is being loaded and that the smarty variable $includeWysiwygEditor is set to true. Or since you are hacking around CiviCRM anyway, just keep it simple and stick something like this in your page source: <script type="text/javascript" src="/path/to/civicrm/...


Only top voted, non community-wiki answers of a minimum length are eligible