Long List of CiviDiscount Codes Needs Management How do you manage a long list (100+) of CiviDiscount codes?

We hold an annual conference and make about 70 codes per conference - so the list adds up.

Can I remove old discount codes without affecting contribution records? seems to be possible, although deleting them seems to be not the best practice?

Ideas:

How difficult would it be to implement a quick filter at the top that toggles the view to show active and inactive (or both) codes?

Or, what about a quick filter for 'Event' the codes are attached to? (or something like that?)

Alternatively - could a Drupal view handle this? Thanks!

You can disable the codes and then sort by what is still active. I also recommend coming up with a naming convention that makes it easier to sort.

You could also set up an automatic discount for certain memberships per certain events, which would cut down on the need for so many codes.


How to prevent a form submission on a CiviCRM form with jquery? I have a custom field set and then added to a profile, where the text input is shown based on selection of radio button via jquery. Within the profile, the radio is a required field but the text input is not.
I was able to show input based on the condition of radio selection and make the input a required field if visible. But when I click the submit button although I see the alert but it does not stop the form submission.
How can I prevent the form submission until my input is validated? Any help would be appreciated. Here's my jquery in the extension..
    CRM_Core_Resources::singleton()->addScript("
        CRM.$(function($) {
            showInput();
              function showInput() {
                $('.CRM_Event_Form_Registration_Register input[name=custom_280]').change(showInput);

            if ($('.CRM_Event_Form_Registration_Register input[name=custom_280][value=1]').is(':checked')){
                $('div#editrow-custom_281 input').val('')
                $('div#editrow-custom_281').slideDown('slow');
           }
            else {
                  $('div#editrow-custom_281').slideUp('slow');
                }
            }
    //on click of proceed btn
            $('button#_qf_Register_upload-bottom').on('click', function(e) {
    //check if the checked value is 1
          if ($('input[name=custom_280]:checked').val() === '1') {
            if (!$('div#editrow-custom_281 input').val()) {
              $('div#editrow-custom_281 input').focus();
// Prevent submit
              e.preventDefault(e);
                          Swal.fire({
                      icon: 'error',
                    });
            } else {
                    return;
                  }
          }
            });
       });
    ");

I would add validator method via js which would stop the submit until the validator returns true
CRM.$(function($) {
  $.validator.addMethod('concessionaryError', function(value, element) {
    let isValid = true;
    if (value == '') {
      isValid = false;
    }
    return isValid;
  });
  $('#custom_39').addClass('concessionaryError valid');
  $.extend($.validator.messages, {concessionaryError:'please correct the error'});
});

HTH
Pradeep


How can I print out samples of message templates? I want to be able to compare various messages for inconsistencies in messaging.

One tool that can help is the Transactional Email extension by Fuzion which ensures that anything that goes out, including receipts etc, are recorded in civicrm as an Activity so you can 'see' what went out.

Currently civi doesn't offer a way to 'preview' the System Message Templates.

NOTE: recent blog about above extension here.


CiviDiscount Navigation URL broken on Joomla After upgrading to Joomla 3.6.5 (from, I forget which - should have made a note) the CiviDiscount navigation URL is broken (sends me to the CiviCRM dashboard). I also did a more minor update of CiviCRM to 4.7.14 (from 4.7.10ish) immediately after.

This question deals with a similar problem in Drupal. This is the URL that I am sent to from the menu:
http://[site]/administrator/?option=com_civicrm&task=civicrm/cividiscount

What should it be instead?

After I discovered that the CiviVolunteer menu URLs were also broken, I updated to the most recent version of CiviVolunteer. That fixed the CiviVol broken URLs, and the CiviDiscount URL is also fixed.


How do I get pictures entered into fields in contact records to be viewable in the contact record? And not just present as file names, or require that the file be opened to view the picture?

Welcome! That's a CiviCRM Core Contact Field -> so simply hit Edit on the Contact Record and look for the field: Browse/Upload Image


Reporting on contribution amounts when added to a membership page We've added the option to accept additional donations when initiating or renewing a membership by enabling the Contribution Amounts section on a contribution page but there doesn't seem to be a way to report on these additional contributions. For example, if a member renews a family membership for $35 and makes a $20 donation, Civi records a $55 membership. We then have to go through each membership and each contribution to figure out how much they donated along with their membership fee. We've tried the ExtendedReport extension which has some great ways to view Price Set info but we can't use contribution price sets on membership pages :-(. Has anyone figured out a way to get this info into a report?
cheers ... :) gn

i would do the following. use a single price set based on Memberships. add the donation line item in to it with its own financial type.
then the Extended Report extension should solve your last issue of how much is donation v member fee


Which SMS provider would you recommend? We want to implement a SMS gateway for a client and we are wondering about which one to choose.
I found and read this post from 2016 and I'd like to know if there are new solutions or positive feedbacks with one of the four providers mentioned.
SMS would be sent / received in France.

I guess its based on which provider you choose based on the budget or sms gateway fees. There few extension provided by Organization that integrates with SMS gateway

Clickatell
Twilio
Message Media
My sms myntra

You may also find more if you try to search for SMS gateway name with CiviCRM.
We have few clients using Twilio and have positive response so far, few others use different providers because of budget constraint and SMS charges, so we have implemented extension to support that(very simple to integrate).


Notice: Undefined index: value in noverwrite_civicrm_buildForm() I have the no overwrite extension installed latest version.
Civi 5.2.2
I get the message on bringing up a profile form

the message gives a notice, that is a low level message that does not signify a "real" problem, rather that the program should do an additional check to make sure it meets the syntax rules.

So although the notice can be fixed, I would recommend you log the issue on the actual extension repository (https://github.com/TechToThePeople/noverwrite/issues) and rest assured that the notice does not present an urgent problem that needs fixing immediately.


Repeatable Custom groups w/ required field I am unable to save a contact with a that has 2 or more repeatable custom groups with a required custom field. The validation fails.

I am using CiviCrm 4.7.9. Has anyone else experienced this?

I've just tried this out on the demo sites (WordPress and Drupal) CiviCRM 5.5.alpha1 and its still not working. I'll look into reporting it as a bug, but I have found a partial work round (though this isn't what I want).

The problem only occurs with the custom field set using the inline option, so you could use tab or tab with table.


Civicrm Upgrade to 4.7.23 I am planning to upgrade civicrm from version 4.2.9 to 4.7.23. For this can I directly upgrade it from 4.2.9 to 4.7.23? Or any other version I have to upgrade first and then to move to 4.7.23. Please suggest me steps for this.

Thanks in advance.

Yes. But make sure you are on 4.2.9, because

  "If you are starting from a version prior to 4.2.9 you should upgrade to the latest 4.2 version as an interim step, as the latest version does not contain upgrade code going back that far."

and

  "You can make big jumps in one upgrade (e.g. 4.5.2 to 4.7.20) without
  needing to apply all the upgrades in between."

The above quotes are from, and see more at:  https://docs.civicrm.org/sysadmin/en/latest/upgrade/ .


Smarty code not working Writing as a self-answered question since it may help others...

I am adding smarty code to a mail template. Including:

{capture assign=designation}{contribution.contribution_source}{/capture}

Later in the page, I call the variable as such:

{if $designation}, for {contribution.contribution_source}{/if}

But the template breaks when I try to use it. The code looks good as far as I can tell. What's the problem?

The problem is that the space in the if-statement is &nbsp; rather than a normal space. For this reason, it's worth writing your smarty statements while viewing the Source code in the template editor.


How do I change price after X years? I'm setting up a Civi install and i'm wondering how to go about these requirements:

Residents who join in their first year pay $40 for the duration of their graduate medical training program. Residents who are in their 2nd or last year of their training program pay $20 each year.
Medical students who join in their first year pay $20 for the duration of their undergraduate medical training program. Students who are in their 2nd or last year of their training program pay $10 each year.

Can we dynamically change the membership amount somehow?

Thanks

I'm a little unclear about the requirements, but if the status of a contact's year is known then perhaps you can use CiviDiscount.

Automatic discounts can be applied to existing members and contact types.


How to manually trigger update hook for an extension? Question:
When upgrading an extension from the UI on Site A it will update the files and run the update hook. How do I manually execute the update hook for the extension on the other Site B, C, etc?

The extension directory on our server is shared between all the sites. This means that when I "upgrade" an extension on Site A the files will be updated for all the sites. However, the "update" hook is only executed on Site A. The result is that the extension files are up-to-date for ALL sites and CiviCRM perceives that Site B, C, etc no longer need to update the extension. This means that I cannot execute any update functions. Is there a way to manually trigger the update function?

Configuration Information:

CiviCRM 5.8
Drupal 7
Each of our sites has a separate database (they are not shared).
Each site is configured in drupal_root/sites/subdomain.domain.org
Extensions are installed in a directory shared by all sites (drupal_root/CustomExtensions).

How about make a backup of the extension folder before the first update, then do on site A, then restore the backup folder, then do site B, etc...


How often does the Status Report expect Cron to run? I am on CiviCRM 5.33.1.  The system Status Report gives warnings like this, taken about 90 minutes later at 12:26.  Cron is deliberately set to run slowly since this is a development system.  How often does one need to run cron to avoid this message - or is there a bug somewhere?

It expects it at least once an hour. See https://github.com/civicrm/civicrm-core/blob/5.33.0/CRM/Utils/Check/Component/Env.php#L317


Unable to Upgrade from CiviCRM 4.6.16 to 4.7 (Wordpress) When attempting to upgrade from CiviCRM 4.6.16 to any of the 4.7 releases, I receive the following error message:

Error: Migrate "on behalf of" information to module_data

Debug info says: "Unknown column 'for_organization' in 'field_list'

This is the first time I've encountered any issues during the upgrade process. I have been using CiviCRM since version 4.4.

Screenshot is below. Thank you for your help!
Darron

Problem is old field was lost in the upgrade. Try updating this file:

CRM/Upgrade/Incremental/php/FourSeven.php

with code at this GIT pull request.

This post here explains it in more detail.


CiviCRM 'Detailed Logging' removes former 'Changelog' entries on contacts CiviCRM 4.7.x

We used CiviCRM for many years and relied upon the normal 'changelog' then we enabled 'Detailed Logging' a few weeks ago, and the old entries from the tab disappeared. Do they still exist in the DB or a file, and are they recoverable and able to be displayed?

They should still exist in the civicrm_log table if you have access to the DB.


Is there a way NOT to email if a report with no result I need to email a report weekly to a department within organisation. Report usually sent via scheduled job in Pdf format.
If there's no result an email still gets sent. Is there way NOT to email an empty PDF? thanks

As suggested by Demerit you can use alterMailParams to abort the email if the report has 0 rows. It will work on simple use case but would be difficult or need to add more logic you passing any additional parameters when running cron job or through url to filter the result since the ReportTemplate.getrows api will return the results which is saved in the database but not on fly.

However you can using hook_civicrm_alterReportVar and set $this->_sendmail to FALSE when $rows are empty.

HTH

Pradeep


Civicrm5.4-add a cash donation fails after update Running on Linx hosted system with latest WP. I just updated from Civi 4.7 to 5.4, now when i try to record a cash donation ('New Contribution') I get a message that the 'site is experiencing technical difficulties'.  Paid events are processed.  This is not even including an email receipt.  Any ideas?

Please cancel! I found the problem. sorry to bother


civix civicrm:ping error [Exception] Failed to locate civicrm.settings.php I just installed CiviCRM BuildKit using the instructions here

After accessing the bash shell of the container with:

docker-compose exec -u buildkit civicrm bash

I try running the command

civix civicrm:ping

in the /src folder, I get the error

  [Exception]
  Failed to locate civicrm.settings.php. By default, this tool searches the parent directories for a standard CMS (Drupal, WordPress, etal) and standard civicrm.settings.php. Symlinks and multisite configurations may interfere. To customize, set variable CIVICRM_SETTINGS to point to the preferred civicrm.settings.php.

How can I get the command(s) to work correctly?

Cool - in the drupal site root of the site  you should see a folder "sites" and be able to see a file at sites/default/civicrm.settings.php  can you try running the command from the same directory as the civicrm.settings.php file.


How to tie multiple event registrations to a single (non-monetary) transaction? We're using the API to create multiple event registrations via a single form, then send the user to Quickbooks Payments after submission for those who wish to pay a deposit online. The bookkeeper sends the back office staff a weekly QB report of all payments received that week (online, checks, cash, etc), which they then enter into Civi manually.

Is there an "invoice number" or some other unifying ID we could use to help staff easily find the appropriate payments from the bookkeeper's report and create them on the correct Civi registrations? I see a Cart ID in the civicrm_participants table, but the cart functionality doesn't have an API, so I can't insert in a safe way. Should I just go with the Source field, or a custom field?

Why don't you create a contribution (using the api) and connect the participant to it?

I'd create that contribution with the right financial type and status pending and update with the QB report. On that topic, it probably needs some tuning and work to import the file, but https://github.com/Project60/org.project60.banking would make it possible to automatically match most of the payments and let your staff focus on the ones that are a bit weird (eg. where the amount or reference quite doesn't match)


HELP! civiCRM Administration Area Not Showing! [Joomla 3.6.5] [civicrm 4.7.16] I'm using CiviCRM version 4.7.17 on Joomla version 3.65. I changed my civicrm resource URL hoping it would load the civicrm.css file but instead I can no longer access my administration area. Please see phone of what I am receiving when I try to access the civiCRM component. How do I get back to the system settings area so I can change it back?

You could try to go the page directly

www.yoursite.org/administrator/?option=com_civicrm&task=civicrm/admin/setting/url&reset=1

If you have sql access you could change them back.  They are stored in civicrm_settings

SELECT name, value FROM civicrm_setting WHERE group_name = "URL Preferences"

You'll see the url between quotes in the value field.


What is the best way to track Business Development and Donor Intel I work for a nonprofit and we are trying to figure out the best way to document and track business development work such as Intel into potential donors or conversations various execs have had with an individual and keep it in Civi. For instance, if my CEO goes to talk to Mr. Smith and Mr. Smith gives us all kinds of information about Foundation ABC even if they don't work there then what is the best way to keep track of all of that information? Is it through activities and then just adding all mentioned parties as contact with? Or is there an extension or organization method that my CEO could just click on Foundation ABC and find all relevant notes to that FOundation to help make the ask that much better?

We are hoping to use Civi not only for our donor tracking but also business and grant development too and we can't seem to find the best way to organize to make that happen.

Any advice is appreciated!

I would recommend the use of Activities. This enables you to then track converations, and have different Activity Types for different 'types' of leads etc.


How to explore API from command line? Is there a way to explore the API from the command line instead of going to mycivicrmsite.localhost/civicrm/api in a web browser?

I wasn't able to learn much from the cv help.  For example, you can cv api contact.get... but what else can you cv api contact.do?

I know I can just go over to the web browser and pull up that page, but I just wanna hang out in my terminal :)

The graphical api explorer actually fetches all its information about the api from the api. Since the CiviCRM api is available from the command line, you can explore it using the same methods.

Fetch the list of entities:

$ cv api Entity.get
List available actions for an entity:

$ cv api Activity.getactions
Get fields for an entity/action:

$ cv api Activity.getfields action=create


Edits to mail.php for Bluehost still necessary? Per this thread, I've been editing our /administrator/components/com_civicrm/civicrm/packages/Mail/mail.php like so to resolve a mail not sending issue:

// if (!empty($headers['Return-Path'])) {
//     $from = $headers['Return-Path'];
// }

I've been doing this since v4.4.4, and it is a bit of a hassle. We're on Bluehost, which apparently doesn't offer VERP (whatever that is). I successfully run dozens of Joomla sites on Bluehost and have no intention of moving.

Has anyone found an alternative solution here? Does Bluehost actually offer VERP and I'm just not finding it?

Thanks much.

So VERP means that the "technical" sender (smtp envelope) is different for each mail sent. the benefit is that if a bounce comes back to this unique address, we know what email/contact it is (something that is impossible otherwise, as the invalid email might be hidden behind a mail forward)

To make it work, you need two things from your hosting provider:

being able to set the technical sender to be different than the visible from email
being able to receive the VERP emails back (the trick is usually to have emails servers that can handle "+" notation, so you@yoursite.org receives email sent to you+something_unique@yoursite.org, something gmail for instance offers, but not exchange servers)

The code you comment out seems to hide the problem 1., but it does not fix it. Does the bounce processing work on your site? I would suspect that civicrm isn't aware that some of your recipients have invalid emails and doesn't flag them automatically as bounced. Are you receiving the bounces and doing it by hand?

Anyway, as the solution, having a host that allows VERP is the best option, but another one would be to develop/sponsor a mode that doesn't rely on VERP but on additional email headers. I did implement the first part and every email sent contains extra headers (X-CiviMail-Bounce), what is missing is the second one:

changing the bounce processor to use this extra header
changing the mail sending job to only set the header but not the VERP sender
add a setting to allow to switch to that "mail header only, no VERP" mode

Would you be able to contribute to that code or sponsor that development?

Unfortunately so far, those having the capacity to make it happen found faster and cheaper to switch to a more feature complete host rather than investing into adding that "header only" mode.


I want Theme developer to have admin access to WP but not civicrm, is that possible? I am using WP, and I have a theme developer helping me with a few issues in a buddypress forum, and then I have another plugin developer I would like to help me with another issue having to deal with super security. Anyway, I don't want so many people having access to my civicrm database as they don't need to touch civicrm in order to fix WP or plugin issues.

Is there a way to limit WP admin access to NOT allow access to civicrm?

Thanks?
If not, does anyone know a developer who knows WP, Civicrm, Thrive Theme, and BPS Security? I tried a Civi911 developer and they couldn't help me with all these WP plugin/theme/forum issues.

I wouldn't hire an IT person who thinks it's ok to do  development on a live site. You always do development and testing on a COPY of the site. See also https://codex.wordpress.org/Running_a_Development_Copy_of_WordPress

One of many reasons is that the dev copy can have fake or anonymized data in it - I assume your concern is the devs seeing the real data.


CiviEvent Participant Import I have about 4,500 rows of participant that I would like to import.  In each row is a column for the  CiviCRM internal ID and columns for the requisite information about the event.

When I upload the CSV file about 400 rows are imported and for each of the other rows I get this error "Matching Participant record not found for Participant ID 10180. Row was skipped." Of course the ID number changes for each row.

I have cross-checked several rows and the IDs are valid.

The file is a CSV file so Excel formatting should not make a difference but I tried changing the field format and a few other things in Excel. Nothing has worked.

There are many duplicates in the list but not 4,000.  I have the duplicate setting set to update.

I appreciate any help.

I re-ran the import with skip for duplicates and it worked perfectly.  For my case this fixed the problem.

-Josh


Civiengage pieces not showing despite being activated- Drupal, CiviCRM 4.7.15 Can't see custom data forms, can't make surveys or phone banks or walk lists etc.

Civicampaign is set up and configured.

Civiengage module is activated.

]2

Drupal permission was checked, but additional Drupal configuration was not. This is not clear in the manual.

Thank you both for your attention!

S.


Syncing Drupal Roles from CiviCRM Smart Groups (Drupal 7.52 CiviCRM 4.6.24)

I am trying to make sense of a work-around for keeping Drupal roles in sync with a smart group.

The Smart Group takes into account:

Contact Type in Organisation
Contact SubType
Membership Type of SubType is "Full Member"
Membership Type is New, Current, Grace
Contact with a (custom) Relationship Type of "Associate of:"

When the smart group is created it will only permit Mailing List rather than Access Control (by design, I understand)

So; I want this Smart Group to have permissions for Drupal under a role "Associate"

How do I do this? I understand that CiviGroup Roles Sync does not work with Smart Groups.

The reason I set it up like this is that when organisation memberships lapse or are revoked; I want the Associates to lose access with automation.

You could in a custom module, implement hook_user_login()

Then you could make an API call to get the contact id for the user...

Then you can do an API lookup to see if the contact is in the group (In this example I have a smart group with id 6. Then if the contact is in the group, and the user account doesn't have the role, add it....if the contact is not in the group and has the role, then remove the role. Easy peasy

function YOURMODULE_user_login(&$edit, $account){
  civicrm_initialize();

  $result = civicrm_api3('UFMatch', 'get', [
    'sequential' => 1,
    'uf_id'      => $account->uid,
  ]);

  if ($result['count']) {
    $contact_id = $result['values'][0]['contact_id'];
  }

  // replace 2 with the rid of the role Associate
  $rid = 2;
  if (!empty($contact_id)) {
    $contact_result = civicrm_api3('Contact', 'get', [
      'sequential' => 1,
      'group'      => 6, // replace with your smart group, group id
      'id'         => $contact_id,
    ]);

    if ($contact_result['count']) {
      if (!user_has_role($rid, $account)) {
        $account->roles[$rid] = 'Associate';
        user_save($account);
      }
    }
    else {
      if (user_has_role($rid, $account)) {
        unset($account->roles[$rid]);
        user_save($account);
      }
    }
  }
}


Filter event reports by facilitator Currently if I want to collate a report on events facilitated by a particular individual (or, say, run by a partner organisation, or any contact with a custom role), I have to go to each event from their contact record, or add each event title to the event 'is one of' filter - it's not possible to filter the event participant list report by a facilitator without limiting the data to that facilitator, and the other event reports (e.g. event summary) can't be filtered by an individual.

Is it possible to build a report to filter in this way? i.e. for a list of events filtered by one contact record, provide data on all event participants.

(I had considered just adding the facilitator as a custom contact reference field, but unfortunately that only allows me to add one contact per field, and there's sometimes more than one facilitator per event.)

I had a client with a similar issue.  They resolved it by not adding a facilitator to any events they didn't facilitate.

Assuming that's not a workable workaround for you - it IS possible to generate reports like you're describing, but you'd need to either a) code it (or find someone to code it), or b) use an (often pricey) third-party reporting tool.  Come join us at https://chat.civicrm.org if you'd like to discuss custom reporting options - either doing it yourself or finding someone to do them.


How do I fix this in CiviCRM System Status - sites/default/civicrm/extensions is not writable Please change your file permissions? I'm getting a warning message in CiviCRM System Status while setting up 4.7 - "sites/default/civicrm/extensions is not writable. Please change your file permissions." What should I do?

if you want to be able to download and install extensions automatically, you need to either change the owner of your folder sites/default/civicrm/extensions to www-data and/or change its access rights so www-data can write into it


Automated emails generated from activities from address Is there a setting by which all emails from civi will have the same 'from' address? Specifically I am thinking of activity emails, where an activity is added by someone, and currently all emails sent out related to that activity show as being from that person, rather than from the default site email address. Is there a way to change this?

Even when a different person makes a change to an activity, the contact the activity was added by is used for the from address in the email alert.

This is especially relevant when someone leaves an organization, but there are still activities in progress that were added by that person. Of course the data that this person is who added/initiated the activity is valuable, but having emails sent from that person that is no longer in the organization is a problem.

Is there any method that could be employed in the UI that could address this? Or will we need to develop a patch to change what from email address is used for activity updates?

I think civicrm uses the setting from civicrm/admin/setting/smtp?reset=1, i.e, Administer -> System Setting -> Outbound Email

If the above setting is enabled, civi uses the creator of the activity as a from address in all the email notification.

Set this to No in order to fix this problem.

Note that the above setting acts on your complete site and cannot be configured only for activities.


How do I permanently disable the "Similar Contacts Found" pop up? Whatever name I enter into the first name field I get a pop up of dozens of "similar contacts found" that takes up half the screen, so I have to hit x to close it so I can continue entering into the fields. Can I disable this feature?

You can turn it off totally if you need although you probably want to tweak the rules as Pete has highlighted. If you did want to turn it off you can get to display settings and turn off the display (by setting to never) of possible matching contacts.


Drupal 7,x campaigns I'm just getting started with civicrm and I've noticed that campaigns are mentioned in a lot of instructional resources

However, I downloaded the latest instillation of civicrm and there's no campaign feature in the menu, and I can't find any campaign module that I've seen mentioned.

How do I activate campaigns?

You may need to enable the Campaigns component:  go to Administer > System Settings > Components and make sure CiviCampaign is enabled


Is there an automated way to check if a list of extensions is compatible with a version of Civi? I'm going to go through a list of installed extensions manually at civicrm.org/extensions and check, one by one, if each is compatible with CiviCRM 4.7.x , per the Q and A here .

However, is there any way to automate that tedious process, from within the Civi UI and/or on the civicrm.org website? Extensions listed here all show CiviCRM Compatibility version info.

Can a filter be added to the webpage to search by CiviCRM version compatibility, for say, just CiviCRM 4.7? A compact view created with the Extension names and a checkbox to select a subset of results?

Thanks!

If you go to the CMS independent tab within the extensions direcotry  page, there's a field to filter by "CiviCRM Compatibility". Here are the extensions compatible with CiviCRM 4.7


Can't administer cividiscount afer upgrade to 4.7.7 I've recently upgraded to 4.7.7 and it seems this has caused me to be unable to administer cividiscount. Current discounts are working, the extension is listed properly, there are/were no errors at any point. It's just when you go to the cividiscount URL you get the main civiCRM dashboard!

Previous version was 4.7.4, cividiscount version in 3.2 running on Drupal 7.43

I have noted a similar question here same sounding problem on a different version, no solutions.

How do I even start finding out what this is? do I need to turn on some sort of debugging and look at lots of logs?

I was having the same issue (Joomla 3.5/CiviCRM 4.7.8) after a tests on my local install, I found that activating the debug (Administer > System Settings > Debugging & Error Handling), browsing the CiviDiscount loaded. Turned off debug and loaded. Hope this may help.


Include more than 2 profiles in Contribution Pages I would need to know if it's possible to include more than 2 profiles in a Contribution page, extending the core functionality.
Does someone of you know whether there is any extension available that adds this feature?
Thank you very much in advance.

i do not think this is available. It has come up for discussion several times. CiviEvents offers it and having the same for Contributions would be a good contribution but I gather it is a reasonable effort and no one has taken it on as a community project yet, or fundraised to get it built.


How to permanently delete contact with API? I'm creating an automated test script. It creates a test contact, does some stuff, then cleans up after itself by deleting the contact.

However this still leaves the contact in the "Trash".

How can I either just delete the contact fully with one API call?

You can pass the skip_undelete parameter to the API, ie.

$result = civicrm_api3('Contact', 'delete', array(
  'sequential' => 1,
  'id' => 9999999999999999999, // replace with your contact's Id.
  'skip_undelete' => 1,
));

Obviously a lot of care has to be taken over specifying the id to delete...


Add New Organization Option to Public Autocomplete Extension Hey everyone we've just installed the public autocomplete extension https://civicrm.org/extensions/public-autocomplete-of-organisation-names but are having some difficulty getting it to "add new" or the "new organization" button to display (as it does when logged in as admin, editing a record and selecting "Current Employer") while also still creating the Employer-Employee relationship

(this is for anon users) also we'd like to restrict the list that displays by group and contact type

in other words, create new org similar to webform-civicrm or within civicrm.

trying acls, adding code per the video athttps://civicrm.org/extensions/public-autocomplete-of-organisation-names

but nothing works yet.

We are using civicrm 4.7 so any thoughts or feedback , greatly appreciated!

H

p.s. similar maybe not identical to Enabling 'New Organisation' button for Current Employer field in View Contact

The issue could be that you have to set the "access AJAX API" permission for the relevant roles


regen.sh - Call to undefined function db_query() So I was following this doc to add a new setting which asked me to run bin/regen.sh script. But running the script failed with the following error:

PHP Fatal error:  Call to undefined function db_query() in /opt/buildkit/build/mytestbuild/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php on line 303

Now I cannot access CiviCRM at all. I get the following message. Drupal works fine though.

The website encountered an unexpected error. Please try again later.
Error message
CRM_Core_Exception: Found installation canary. This suggests that something went wrong with tracking installation process. Please post to forum or JIRA. in Civi\Core\InstallationCanary::check() (line 53 of /opt/buildkit/build/mytestbuild/sites/all/modules/civicrm/Civi/Core/InstallationCanary.php).

There seem to be two concerns here - how to get mytestbuild working again - and how to get regen.sh to work.

Get mytestbuild working

The quickfix is to drop the table civicrm_install_canary.

The more general fix is to put your codebase to a pristine state (e.g. no local changes/patches; check out the official upstream branch; git scan status may help). Then you can create a pristine DB using one of these commands:

civibuild restore mytestbuild - This is faster -- it loads a SQL snapshot from the last time you ran civibuild.
civibuild reinstall mytestbuild - This is slower -- it drops the Drupal+Civi databases, deletes any config files, and recreates them.

Get regen.sh working

This appears to be a regression affecting regen.sh. To determine this, I did a few things:

Checkout the latest code from master and run regen.sh. See the same problem.
Clear out uncommitted changes (e.g. git checkout -- sql/civicrm_generated.mysql)
Repeat above, but checkout tag 4.7.0 instead of branch master. (When jumping among different versions, I usually use ./bin/givi checkout <TAG> because that checks out corresponding tags in packages/, drupal/, etc. The need to )

After spot-checking a few tags, I determined the problem arose somewhere after 4.7.0 and before 4.7.2. Since the context involves bin/ and the error involves CRM/Utils/System, we can make an educated guess that there was a change in one of those folders and skim the log:

git log 4.7.0..4.7.2 bin/
git log 4.7.0..4.7.2 CRM/Utils/System
git log -p 4.7.0..4.7.2 bin/
git log -p 4.7.0..4.7.2 CRM/Utils/System

I'm pretty sure that the regression occurred due to https://github.com/civicrm/civicrm-core/commit/40d5632a25086d7c963538f2b6daf2a2546e16a6 ; undoing that patch allows regen.sh to run,  but you'd need to read/think a bit more figure out a proper fix.


Collecting Facebook, LinkedIn profiles Collecting Twitter handles from users is straightforward: create a custom field, ask for the handle. But collecting links to Facebook or LinkedIn profiles is more tedious, since most people don't remember their shortlinks offhand, and probably even more people aren't even aware that they can choose a shortlink in the first place. Thus, their profiles have long, immemorable URLs like

http://us.linkedin.com/pub/john-doe/921/487/383
https://www.facebook.com/profile.php?id=907087534832176

We want to be able to link to these pages from membership directories, participant reports, and so on, but the challenge for the membership manager is how to collect them efficiently.

We encouraged with one group for people to add the URL of their LinkedIn or Facebook profile as a "website" field, but there was little or no uptake. Worse, we felt it disrupted the membership application process by sending someone not only offsite, but to a distracting social network where they might forget about their signup.

Is there an extension or other mechanism whereby someone could click, on a profile, click on a button and have their profile ID for either service entered? Or on the flip side, is there any way for a profile to pull Facebook or LinkedIn information, so that data like name, email address, employer, and birthdate could be pre-populated during event or membership registration?

There's some CodeCamp 2007 code and Social CRM ideas from 2011 on the wiki, but doesn't seem to be much that's been built.

To clarify, the ultimate goal is to allow members to provide a link to their Facebook and LinkedIn profiles on a "member profile" page on a Drupal site, though a CMS-agnostic solution would naturally be preferable. It does not have to be the Fb shortcut; the unique user ID number is fine and even preferable; it just needs to be someone we can use to create a URL that a button can link to.

Importing OAuth information from the CMS seems to be the way to go, though this complicates matters when trying to list people who do not want to use delegated authentication on the site.

The http://Attentive.ly CiviCRM integration automatically returns the social media accounts that match with over a hundred social media sites including Twitter, LinkedIn, Facebook, Google+, Klout, etc., as well as social listening on relevant recent posts to Twitter and Facebook. It does a lot more to help improve your organization's online engagement with top influencers (meaning those that have a high Klout score). The service is not free, and works best for organizations that have at least 25,000 - 50,000 contacts. See https://civicrm.org/extensions/attentively-integration.


Is there a process to tidy the tables created by logging? I've successfully improved the performance of the 'Change Log' by taking Eileen's advice here, converting 5 tables to InnoDB and adding indexes. In so doing, I almost blew the space limit on the host site as one table log_civicrm_group had almost 4 million rows. (The site has only 3.500 contacts but 1.3 million activities) I solved the problem by emptying this table, with what appears to be no ill effect (!). The upside of better performance having the advantage over not being able to look at the change log at all.  So the question arises - as Civi is used year on year these logging tables must grow and grow - so is there a process to keep them tidied, and stop them blowing a space limit? A parameter or setting somewhere? Or is there a need to write some code to remove rows over a certain age?  I guess the same question applies to activities but I'm interested in logging for now.

Writing "code" could be as simple as a cron script that runs daily and does mysql -u user -ppassword -e "DELETE FROM log_civicrm_group WHERE log_date < DATE_SUB(NOW(), INTERVAL 2 MONTH)" databasename, which deletes records older than 2 months.

EDIT: To address your comment, if you want to completely disable logging but just for this table, you could drop the associated triggers. This might get turned back on during an upgrade if there's a change to the trigger, but can deal with that then.
e.g.

SHOW TRIGGERS LIKE '%civicrm_group%';
DROP TRIGGER civicrm_group_after_insert;
DROP TRIGGER ...

Repeat and replace civicrm_group_after_insert with the various triggers.


Unserialize error when viewing a contact I think this has something to do with a bad database table although I'm not sure how I would go about finding out where or how it happened so any advice would be greatly appreciated!

I have seen questions about a similar error on reports but this is whenever I view a contact so I'm not sure how related they are.

This error gets flagged up several times when I go to view any contact:

Notice: unserialize(): Error at offset 247 of 426 bytes in Civi\Core\SettingsBag->loadValues() (line 153 of /home/vabarnsley/public_html/sites/all/modules/civicrm/Civi/Core/SettingsBag.php).

I'm using CiviCRM version 5.13.5 and Drupal 7 on PHP 7.1.

I apologise for being a little vague but I'm hoping it makes more sense to someone that has seen it better or knows how to help.

This would happen if you have an invalid value in your civicrm_setting table, if someone tried to manually edit one of the serialized values stored in there.

If you're not sure which value(s) might be problematic in that table, you can try editing the file at `Civi/Core/SettingsBag.php and insert this right after line 153 (note this is untested):

if ($dao->value !== NULL && !unserialize($dao->value)) {
  CRM_Core_Error::debug('bad setting', $dao->name);
}

That should print the name of the bad setting on your screen.


How do Cividiscount codes work when used with a price set? I may be missing something obvious here, but...

I create a contribution page that makes use of a price set. The price set includes  a number of radio button price options.
I create discount code that provides a discount against one of these price options.
When I view the live contribution page, there is no field displayed where I can enter my discount code.
I can recreate this on the demo site at http://dmaster.demo.civicrm.org

When I view the live contribution page, there is no field displayed where I can enter my discount code.

Make sure the contribution page uses the Membership section. There is no discount functionality for only Donation pages as far as I can see from the usage section.

Also see Can CiviDiscount be used on a Contribution Page without Membership


CiviCRM error on Joomla 3.x - There are no public mailing list groups to display After a successful backend installation on latest Joomla platform CiviCRM does not seem to work when I try to publish any page. i get this same error message on all pages:

  Sorry but we are not able to provide this at the moment.
There are no public mailing list groups to display.

Return to home page.

Can anyone tell what this is and how to remedy it? here are links to the other pages with the same message:

http://www.livewisely2020.com/index.php/homepage/mailing-list

Check your directory and resource URL in the Administer CiviCRM section.
Make sure your permissions are correct for the user.
Clear the cache folders in Media TemplateC
Make sure your going to http:// or https:// not to http://.www


Does CiviRules work with smart groups? I've tried to create a rule where an email gets sent when a contact is "added" to a smart group.  By "added" I mean the condition that smart group is based upon is met.

As far as I can tell it doesn't.  It seems like it would be hard to do.

Contacts don't really get 'added' to a smart group - it's more that when the smart group is used, a search is run to find who currently meets those criteria (glossing over some complex rebuild and caching details...)  So there is no specific event for CiviRules to react to in a post trigger.

You might be able to base something on the 'Daily trigger for group members' cron trigger and maybe modify it for a more frequent run.  See https://docs.civicrm.org/civirules/en/latest/trigger/


Unable to locate folder xml under the civicrm root directory I am new to civicrm and trying to build extension. The extension is build and activated. The stage where I got stocked is when I trying to add entity for my civicrm extension. I am following the  Official Documentation from the civicrm website.

Point 4.c has mentioned to edit the file <civiroot>/xml/schema/Schema.xml but I am unable to file with that name and neither the path under the <civiroot>

Please Note: my civicrm root directory that I am following with Drupal7 installation is as <DruaplRoot>/sites/default/files/civicrm

Please help to get out of this problem as I am unable to add new entity.

I'm thankful to you in advance.

It sounds like perhaps you are developing your extension within a normal CiviCRM installation instead of a development installation. If this is the case, you'll need to set up a development installation in order to get the xml folder (and other things too).

The best way to set up a development installation is to use the civibuild tool which you will get if you install buildkit.


Can you prevent invoices from being sent via Pay Later? I'm setting up a Contribution Page to act as a sales desk at a silent auction. An operator will use the page to enter people's details and the payment that they made for any items, along with a textarea for recording item details.

In order to keep everything in the system, I have renamed "Pay Later" as "Cash Sale". Then afterwards we'll go through and mark all those items as Completed, which will e-mail through the receipts. (while it would be nice to avoid this step it's only a small inconvenience)

The only problem with this solution is that as soon as we use the Pay Later mechanism, an invoice is e-mailed through to the buyer. This is unnecessary and will be confusing.

Is there any way to prevent invoices from being sent when we use the Pay Now for a particular Contribution page? Any settings that I have missed, or even hooks?

Note that I'm not keen on doing the data entry in the back end (CiviCRM console) as the operator would have to create new Contact records for each person before the sale, and overall that would be far more work.

Thanks,
Stephen

If the invoice generation is linked to specific financial types, then in that the case you could create a new financial type which isn't linked to automatic invoice generation.


Queue runner must be configured before execution. When trying to upgrade in wordpress What is the logic behind that? I can't upgrade, I am just not familiar enough with this codebase... Why is there no queueuRunner in the session
public static function instance($qrid) {
    if (!empty($_SESSION['queueRunners'][$qrid])) {
      return unserialize($_SESSION['queueRunners'][$qrid]);
    }
    else {
      return NULL;
    }
  }

Does not find queueRunners in the session, returns null... thus the error message in title... When are those queueRunners created?
Thanks

There's some docs about queues at https://docs.civicrm.org/dev/en/latest/framework/queues/ but I don't think that helps you here.
You might try upgrading via command line instead: cv upgrade:db. See https://github.com/civicrm/cv if you don't have cv installed.


tags inserted in rich text fields custom fieldsets when displayed as tabs I am looking at a site where there is an extra <br> tag being inserted between all elements in rich-text fields in custom fieldsets, including between list items! And two being inserted between paragraphs. The html is clean in the editor, but this is how it's being rendered on the front-end. This is only happening when the fieldset is set to display as a tab. As soon as you move it 'inline', the problem goes away. Site is using default CKEditor.

Any ideas about why this could be happening and how to fix it? Thank you.

Oh I get it now. You mean
 tags in the html source when you are in view mode causing extra line spacing to appear on the screen, not the literal
 appearing as a visible string
 on the screen.

So I personally agree that's not a faithful representation of the stored html which normally ignores whitespace when displayed, but it looks like it's been that way for a long time. Where this is coming from is https://issues.civicrm.org/jira/browse/CRM-11598 which doesn't specifically say it but I'm assuming it's referring to when you choose TextArea as the type for the Note field, where you would want this. The code looks like it's here: https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Custom/Page/CustomDataView.tpl#L90

So ideally it would also check to see whether it's TextArea or RichText. You can file a bug report at https://lab.civicrm.org/dev/core/issues


How do I fix class not found in custom extension after upgrade? I have just upgraded civicrm to 4.6.11 and am getting a Class Not Found error.

Fatal error: Class 'CJT_Page_EmrJournaltracking_JournalControls' not found in ... CRM/Core/Invoke.php

The class is in the system

 web/sites/all/modules/custom/civicrm/extensions/net.interlated.emrjournaltracking/CJT/Page/EmrJournaltracking/JournalControls.php

and defined as follows

require_once 'CRM/Core/Page/Basic.php';

class CJT_Page_EmrJournaltracking_JournalControls extends CRM_Core_Page_Basic {

The source for this extension is available at https://github.com/jrobens/civicrm-extension-emrjournaltracking

Fixed by changing all the classes to be in the CRM namespace. e.g.

class CJT_Page_EmrJournaltracking_JournalControls

Becomes

class CRM_Page_EmrJournaltracking_JournalControls

Disable and re-enable the extension to load the changes.


Command line import error message I'm using the command line import, following info provided here:

How do I import contacts through the command line?

https://forum.civicrm.org/index.php?topic=34033.0

But getting the following error message:  Invalid file format for filepath/filename.csv. It must be a valid csv with separator ',' or ';'

My file is a valide csv, downloaded using Google Docs to csv, which has been an acceptable way to create clean csv files.  Not sure why the import.php won't accept this file.

I found the problem.  My csv file was on a staging server that required a user name and password for access.  The error message was misleading, nothing wrong with the csv file.  Once I put the file on the server in a place that is not password protected, it worked fine.


How can I make custom (participant attendees) reports with inline editing functionality? How can I make custom (participant attendees) reports with inline editing functionality?
Larger Challenge/Background
I want to create an overview for managing all attendees for (all future) events.
So far I have reports where Columns are names, ..., Participant-roles, Status, and some additional custom fields, such as: "leaves early", "age approved by staff".
The idea is, that our staff can - after people registerd for an event - manually check the attendees list. Sometimes a backup call is needed. This information should be then entered (dropdown) into the participant data. To save time and the annoying steps to go from the attendees list into each participant data, just to check off a marker or change the status e.g. from pending to attending, I want to do that inline.
I view those with reports. That works perfectly.
I looked into the extension "Extended Reports" (nz.co.fuzion.extendedreport). It claims to do that. And the predefined templates for Event and Activities are running and are working perfectly as intended! (basicly what is explained here: https://youtu.be/AyWwu7HoOkI?t=1732 at 28:52) I - however - cannot manage to make it available for a particapant attendees report.
Specific Question

What am I missing?
How can I make custom inline editing reports (with the Extended Reports extension)?

thx for the help, Stefan

I am running:

Drupal 7.x
CiviCRM 5.23.4 (could update though, just haven't done that yet)
ExtendedReport (nz.co.fuzion.extendedreport) version 5.1

To clarify - the nz.co.fuzion.extendedreport extension offers Editable Reports for Activities and Events - but not for Participants.
Eg with the Events report you get fields like this

Another option would be to try Drupal Views and Views Bulk Operations. I am pretty sure we have made it work for an 'event register' ie have a list of folk who are Invitees, and then tick those who show up and VBO will change their Attendee Status (don't recall if we added the necessary so that the Status is a dropdown or you have to enter the status ID)


Shortlisting contacts with complete address How do I search in the contacts search / Advanced search that I get only contacts with complete postal address?

I have many contacts in civicrm. Some have only city and country names, which is not very useful in terms of sending postal mailings. So how do I get the results in which I get the contacts with complete address?

You can use the search builder to search for empty fields, e.g. Steet-Address or ZIP Code. From the result, you could create a (smart) group and then exclude contacts in that group from the mailing.


Automated contact filtering for event attendees? Is there a way to perform automated actions when people sign up to events based on their profile info?

For example:
- if someone has already attended an event in the last month, put them on the waiting list
- if someone belongs to a particular organisation, automatically mark them as registered

I'm using Civi 4.2.27 on Wordpress.

You can write a plugin that hooks into civicrm_post that will allow you to do anything you like with the newly-registered contact.

add_action( 'civicrm_post', 'my_do_stuff_after_registration', 10, 4 );
function my_do_stuff_after_registration( $op, $objectName, $objectId, $objectRef ) {
    if ( $op != 'create' ) return;
    if ( $objectName != 'Participant' ) return;
    $contact_id = $objectRef['contact_id'];
    // ... do anything you like with this contact
}


What is the correct return from payment provider URL? I'm developing a payment plugin for SwipeHQ (a New Zealand based online credit card processor) for my clients Drupal website running CiviCRM.

Currently a user will make a purchase and be redirected to the correct payment provider page, but is currently (incorrectly) being redirected to the IPN notification page on completion. The IPN end point should be used by the payment provider to notify the server of success or otherwise, but when the client is redirected here none of this information yet exists so it throws an exception. How do I instead redirect to the completion page ("hi your purchase is successful pending payment") - I have tried passing the URL in the format

civicrm/event/register?_qf_Confirm_display=true&e436769547477d10db6253a97538b92a_7705
But it complains about not being able to find the id..

I guess what I'm asking is, is there an easy way, given a transaction id or something similar (which I can hake the payment provider pass back to me) I can close the users current transaction?

welcome to CiviCRM - we had some communications with a potential client who had an in-house developer that did some work on SwipeHQ. Suggest you try getting in touch with him via this question or give me a buzz and I will put you in touch if that is helpful. Adding a SwipeHQ tag


Bad redirection after registration for free event I struggle a lot with this issue, and couldn't find anything to help me so I hope here could:
I did set up an event, with different fees, and one of them is free. When people check not free, everything is going fine, but when they check free, they are not redirected correctly after "confirm your choice": the page is bugged and they do not receive any confirmation email. They are redirected on an error page (HTTP ERROR 500)
So, even though they are registered, they cannot see it and try again and again, registering each time.
The payment method is Paypal.
The CMS I am on is Joomla, and I use version 4.7.25 of CiviCRM.
This is a big problem and I don't see any way out, so thank you for your help.

Some screens :

Its a known bug, and there is a patch to fix it. You can follow the following steps to fix it:

Open file: civicrm/CRM/Core/Payment/PayPalImpl.php
Search for:

$sub = empty( $params['is_recur'] ) ? 'xclick' : 'subscriptions';

Replace with:

$sub = empty( $params['is_recur'] ) ? 'cgi-bin/webscr' : 'subscriptions';

It should be around line number 404

Hope it helps.


How to create new custom event page in the admin area I have set the "Custom PHP Directory" as [civicrm.files]/custom_php/
Under custom_php/ I have created the folders CRM -> Event -> Page -> SessionTypes.php
I have added the menu as a hook under Events (in the admin area) which points to /wp-admin/admin.php?page=CiviCRM&q=civicrm/sessiontypes but the page does not get hit.
What am I missing? Below is the content of the SessionTypes.php

require_once 'CRM/Core/Page.php';
class CRM_Event_Page_SessionTypes extends CRM_Core_Page {
  function run() {
    die('innn');
    parent::run();
  }
}

Alongside with civicrm_navigationMenu (which only creates the menu item) I had to use the hook civicrm_xmlMenu which is where you specify the xml file that manages the record for civicrm_menu. This is where civicrm knows what the page_callback is for every path i.e. civicrm/sessiontypes


What versions of PHP are used in CiviCRM's internal QA? The wiki currently states that CiviCRM has bare minimum (5.3.10) and recommended (>= 5.4) PHP requirements.

Knowing what CiviCRM has been tested with can help identify what should be expected to work reliably.

As of today, what versions of PHP do CiviCRM's test infrastructure test with?
This question will become out of date over time; for future reference, is there a better place to check this information?
For orgs who aren't able to match the PHP versions that CiviCRM is tested with internally, what other options are available?

At time of writing, all PRs tests and scheduled tests run under Ubuntu 12.04 (PHP 5.3.10). There is an effort underway to introduce a test node for Ubuntu 16.04 (PHP 7.0) (although details are still a bit in flux).
When you inspect the results of a test run, you can get some details (such as the node name and console output). The node names follow a convention -- test-ubu1204-5 is running Ubuntu 12.04 (precise); test-ubu1604-1 is running Ubuntu 16.04 (xenial).

This tells you the general platform and hints at the PHP version. I'd like to keep these generally aligned with upstream versions.
As a somewhat stronger statement, I want to keep the test nodes aligned with civi-download-tools --full, which autoinstalls system requirements on some common builds of Ubuntu/Debian. If you know the target platform, you can lookup a more specific list of packages.


Allocate money from Donor to student i doing customize CiviCRM 5.29.1 for Wordpress 5.5.1 last version.
i have create 2 contact type individual: Donor, Student
Donor donation money for student. Donation money allocate to student. student have money for study
Ex:

Donor(Tomy) donation $500 for student(David) in 2019

Donor(Tomy) donation $500 for student(David) in 2020

Donor(Tomy) donation $500 for student(David) in 2020

....

Donor(Nancy) donation $200 for student(Olive) in 2019

Donor(Nancy) donation $400 for student(Olive) in 2020
...

I want when view student then see all history donation from Donor.
and when view Donor then see all history donation for student.
How can do that?
i try create new Contribution but i only see contribution from Donor but i not see Contribution allocate to Student.
please help me, sorry my english not good. hihi
i attached new Contribution

+++++++++
Soft Credit have maximum 10 row for each contribution. but Donor donation $10,000 for 100 students.

You can use soft credit section of the contribution form...
Create a contribution for donor but under soft credit section include student contact
Ref: https://docs.civicrm.org/user/en/latest/contributions/soft-credits/
If you need more than 10 soft credit record for payment than implement preprocess hook via civicrm extension or wp plugin to add the number of count, something like
function modulename_civicrm_preProcess($formName, &$form) {
  if ($formName == 'CRM_Contribute_Form_Contribution') {
    $form->setVar('_softCreditItemCount', 100);
  }

}

or install the extension in civicrm and add below line in end of civicrm.settings.php file
$civicrm_setting['CiviCRM Preferences']['contributionsoftcredit_limit'] = 100;


Why am I getting no values when using REST api? I've mainly used the php apis in the past but I would like to use the REST API. I added an api key to the contact record, and I attempted to use the really simple example in the documentation.  Yet I just keep getting

{"is_error":0,"version":3,"count":0,"values":[]}"

I'm using really simple examples like

entity=Contact&action=get
(of course with the base url and rest.php? and then the keys at the end). I'm pretty sure the url is right since it says there is no error (and if I change things I definitely get an error response). If I use the php api I get data, so it's not that there is no data.

Update 2

Actually I think I was wrong about at least where the problem is because clearly the checking for a valid CMS user record is happening.  If I use a url like this:

http://example.com/administrator/components/com_civicrm/civicrm/extern/rest.php?entity=Contact&action=get&group_id=6&options[limit]=25&options[offset]=50&json=1&key=4d0b3527f437210aa4479ca8fa4936eb&api_key=654321'

I get (along with a good apache response)
{"is_error":0,"version":3,"count":0,"values":[]}

However if I add a var_dump($apiResponse); right before the return in run()  in Civi\API\kernel.php I definitely get the data  and count is not 0. And that array comes through just fine to \api\api.php. So whatever is going wrong is happening somewhere after that.

This is going to be a fuller answer eventually but for right now it is a partial answer that addresses how to get publicly available data via REST.

The REST API works differently than the PHP or other versions of the API. Some of this is documented and some is not.

The most important difference between the rest API and the others is that the REST API does not instantiate an authenticated user as the current user in a Joomla! environment. Therefore it cannot use any of the Joomla access controls when determining what data to provide or what actions to allow. Also  because the current user is not an authenticated user, CiviCRM roles (such as the default Authenticated User and Administrator) are not available.  Therefore the only role that is available is Everyone.

However this does not literally mean that everyone (in the sense of the unregistered public) can see.  This is because there must be a contact record with an api_key value and a registered Joomla user associated with that contact.

This also does not mean that Everyone can see everything. An ACL record still must be created. That is you must create ACL for each kind of data that you want to have accessible to the REST interface.

For GET the basic approach should be to create a group that contains the records you want to return. Call this, for example, MyGroup. To reiterate: This is not the group of users who have access to the interface, it is the group of users about whom data will be returned.

In the ACL interface click on Manage ACL.

For Role: Everyone
Action:View
Type of Data: A group of contacts
Group: MyGroup

These settings will allow you to use the REST interface to return data on one or more users in the MyGroup group, with data based on the URL you craft.

If you have a Joomla front end and you want to access a list of contacts via the rest interface you need to include a number of steps. This includes reading the keys, crafting the URL, and creating the request.

If you have a civicrm.settings.php file you can obtain the site key with the following code:

require_once JPATH_ROOT . '/administrator/components/com_civicrm/helpers/api.php';
CivicrmHelperApi::civiInit();
echo CIVICRM_SITE_KEY;

However, if you don't have access to the helper you can just require_once the settings file and that will define the site key constant.

You also need to to access the individual user level API key. Most likely it would make the most sense to  to store that in a file locally and read it in. Call that CIVICRM_API_KEY.
Then you can craft a request url, which will have three parts, the base, the api parameters, and the keys.

// Of course this should be https if possible.
$restbase  = 'http://example.com/jooomla-cms/administrator/components/com_civicrm/civicrm/extern/rest.php?';
$restkeys = '&key='. CIVICRM_SITE_KEY .  '&api_key=' . CIVICRM_API_KEY;
$restvars = 'entity=contact&action=get&json={"sequential":1,"return":"first_name"}';

// Make the request
$http = new JHttp();
$return = $http->get($restbase2 . $restvars  . $restkeys);

// Do something with the data
$body = $return->body;
$values = json_decode($body)->values;

foreach ($values as $value)
{
    echo '<div>' . htmlspecialchars($value->first_name) . ' </div>';
}

Some notes

There are many combinations of actions and entities which cannot be created in the ACL settings.

Depending on what you are envisioning you may want to create a Joomla user to be the one that provides access or you could register a user for each application that will be allowed to access publicly available data via the REST API.

These include most post and delete actions. In these cases there is sometimes checking of specific Joomla permissions such as access Civicrm but it does not work as expected. At least at this point the authorization process always returns false unless you have given the public permission to do these things via Joomla ACL. Not a good idea.

Update

I sent a pull request for a fix for this so that now permissions will be checked. You can apply this as a patch and it will work the way the documentation says (or at least it has been for me -- would love a few people to test it).


Foreign key violation on creating new Financial Type I've got a 5.8.2 install on Drupal 7.61. When I try to add a new Financial Type, from /civicrm/admin/financial/financialType?reset=1, and click Add Financial Type button, after I enter the info and hit Save, what I see in the GUI is that the spinner spins forever, never returning control to the user. The debug log shows (I've put some hard newlines in for readability):

[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=""
info="INSERT INTO civicrm_financial_account (name , contact_id , financial_account_type_id , account_type_code , description ,
is_header_account , is_deductible , is_tax , is_active , is_default )
VALUES ('New Fin Type' ,  1 ,  3 , 'INC' , 'New Fin Type descript' ,  0 ,  0 ,  0 ,  1 ,  0 )
[nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`drupals_uherocrm2`.`civicrm_financial_account`,
CONSTRAINT `FK_civicrm_financial_account_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]"]

What this seems to show is that it is trying to create a new Financial Account (which I don't really understand because I thought I was only creating a Fin Type), but the Account needs to be linked to an existing Contact, and it's using contact_id=1 as a generic default? But I don't have a Contact with this id=1 in my system.

Any clues what's going on here? The GUI for creating a Fin Type is simple and doesn't given any clues about being linked to a Fin Account, at least not at creation time. Thanks.

Edit: Here is a pastebin of part of my error log, including two examples (which should be equivalent and redundant) of the constraint violation, along with a whole bunch of other junk besides the backtrace, whose value I wasn't sure of, so it was safer to include it. I've edited the file a little to remove my real domain name, just for a little more anonymity. Hope this helps to clarify: https://paste.pound-python.org/raw/15EPAPfiKEuG7T3in945/

Looks like the Default organization contact is missing in your database. Try to resave the contact by navigating to CiviCRM >> Administrator >> Communications >> Organization Address and Contact Info


Sync between different Civicrm dbs We are looking for a way for multiple branches of our organization to maintain separate CiviCRM installs while syncing a particular group of contacts with each other. WE thought of using Mailchimp to hold the master list and have each install sync with that. BUt the current extension only seems to handle fname,lname and email fields.

Long ago some posted this:
https://forum.civicrm.org/index.php%3Ftopic=3070.0.html
which describes a similar need.

Is there any code already developed for this?

I don't believe there is any shared code for this currently. We are working with a client in Aus to build such a system for them which would involve sharing (pushing/pulling) data from the 'parent' crm to various 'child' crm databases.

If you need a solution then we may be able to extract the work we have done that relates to just the features you need but would clearly need to charge and would provide an estimate if you were interested. You can contact me via https://www.fuzion.co.nz/helping-those-who-do-good-do-better or https://chat.civicrm.org/civicrm/messages/@petednz-fuzion


CiviCRM + Wordpress + Contact 7, how to get it to work I am trying to make sense of this WP plugin:
https://wordpress.org/plugins/contact-form-7-civicrm-integration/

I have installed it, set the API details, and am now setting it up. The emails get sent, but there is no addition to civicrm.
Right now the civicrm options of contact 7 via this plugin are:

Entity: Contact
Action: create
(all good here, I guess)

Additional parameters (the standard ones given): contact_type=Individual&source=Wordpress
What if I wanted to add this user to a specific group too? I'm not sure about what to write.

In any case, by filling the form an email gets sent, but no addition to CiviCRM is made...! This would be quite important to me, so if anyone had any idea or has any experience with contact 7, any help would be really, really appreciated.

On a secondary note: how do I know the standard names of all "fields"? In the plugin page they give "first_name" and "last_name" as samples, but what if I want to add a phone number and/or email? What standard CiviCRM names should I use? I have not found a list yet, and I've searched for a while...

If anyone had any idea, it would be awesome :) thank you in advance, and sorry for being a bit noobish.

You must also install a CiviCRM extension on the other end - see this blog post for details.

Note that this plugin is NOT very mature, and isn't recently updated.  Its killer feature is the ability to post data to a remote CiviCRM.

If the CiviCRM you're trying to post to is installed on the same WordPress site, then you'll want to use Caldera Forms with its CiviCRM integration.  This is the plugin of choice for CiviCRM/WordPress developers and is receiving active support.


How to insert youtube link in Civimail, like in mailchimp? I am trying to send a newsletter with a youtube video link. How to insert youtube link in Civimail, like in mailchimp?

Just copy and paste the link into the body of the template.

You can embed it in html so that it opens inside the message - youtube provides "embed" code to do that. When you paste this in, click the "source" button and paste it there before saving.

Hope this helps,

John


Inconsistency with date fields in the API I've been working on an extension for civicrm and am using the API to retrieve fields to be used in forms presented to the end user.

I am using the 'html.type' returned to determine which type of html form input to display (text, textarea, select, etc.).

The first issue is that the returned values don't match up with html input types, for example:

CRM.api3('Contact', 'getfield', {
  "sequential": 1,
  "name": "birth_date",
  "action": "get"
})

returns

"values": {
    "name": "birth_date",
    ...
    "html": {
        "type": "Select Date"
    }
}

but Select Date is not an html input type. This isn't too much of a problem as long as Civi is consistent with what it calls a date field. But in the above example, the field birth_date expects a date without a time.

But calling

CRM.api3('Event', 'getfield', {
  "sequential": 1,
  "name": "event_start_date",
  "action": "get"
}

returns the same 'html.type' value:

"values": {
    "name": "start_date",
    ...
    "html": {
        "type": "Select Date"
    },
    ...
}

and yet this field expects a datetime, not just a date.

So if you're trying (as I am) to have an extension operate on a list of fields which can be selected by the user and so aren't known in advance, I can't see any way to differentiate between the two cases.

I may be missing something obvious, but I can't work out what.

We've worked this out to handle form creation for civicrm fields in the CiviCRM entity project. https://drupal.org/project/civicrm_entity

We use the 'type' property returned from a getfields api call like so:
This code here we determine what widget to use:
checkout civicrm_entity.module
civicrm_entity_get_field_widget()
the section pertaining to dates:

 if (isset($field_spec['type'])) {

        switch($field_spec['type']) {
          case 4:
            $widget = array('widget' => 'date_select','format' => 'Y:m:d');
            break;
          case 8:
            $widget = array('widget' => 'date_select','format' => 'H:i:s');
            break;
          case 12:
            $widget = array('widget' => 'date_select','format' => 'Y:m:d H:i:s');
            break;
        }
      }

so the '#type' of the form element is set to 'date_select' and the format is used to set the '#format' property
this does require the date_api module from the Date project


What does the error mean when enable honoree in contribute I get an error CiviCRM 4.6.8 CiviCRM 4.6.8: When I enable honoree in contribute (even with the default setting: Honor type: "In honor of", "in memory of " and Honoree profile: "Honoree Individual " ) I get a warning:
"warning the selected profile is using a custom field which is not assigned to the 'Contribution' being configured"

What does that mean?

Oddly I can use the test-drive link but not the live link.
I can disable the honoree section and it works too.

What do I do wrong?

I tried it on the demo site http://d45.demo.civicrm.org but it seem to work there. (different version)

This is quite complicated, but as @pkeogan explains above, it all comes down to your profile using a custom field. To see custom fields that are restricted to specific contribution types, go to Administer > Customize Data and Screens > Custom Data. Then you can see the allowed types for each fieldset in the Type column. You need to locate the one that your Honouree profile uses, but which does NOT include your contribution type in the Type column. (If you're unsure, go to Administer > Customize Data and Screens > Profiles, and see for the fields in your profile.) Then, on the page at Administer > Customize Data and Screens > Custom Data, click ”more” on the relevant row, and then ”Settings”. There, see for the label ”Used For” to choose the types you need.

To understand this better, read the pages Creating Custom Fields and Profiles in the CiviCRM documentation.


Network error unable to reach the server - wordpress Recently I got the error "Network error unable to reach the server" in my wordpress website's dashboard while accessing CiviCRM. I have php 7.0 verson.
How can I resolve this issue.

Issue is resolved now...it was base url without www in civicrm.setting file.


CiviVolunteer enabled but not showing in navigation I'm attempting to get CiviVolunteer up & going on our wordpress installation of CiviCRM 4.5.8

It's enabled but not showing in the navigation.

Thanks for any help.

When a new Extension or Component is added you may find there are Permissions that need to be enabled, and that might be why you don't see it in the menu.

Alternatively go to Administer > Customise > Navigation Menu, check if it is in that list, if it is, but not showing, right click on it and 'save' and then you should see a new option on the screen that says "Click here to reload the page and see your changes in the menu bar above. " and that might be enough of a nudge.


Is CIviCRM compatible with Concrete5? Our website is built on the Concrete5 platform.  Is CiviCRM compatible with Concrete5?

Perhaps it isn't as clearly documented as would be expected (seeing nothing on front page or /about or /get-started actually talks about CMS) but nevertheless CiviCRM has been built to work with Drupal, Joomla! and WordPress.
Hence the answer is somewhere between 'no' and 'incredibly unlikely' ;-)


Files in the data directory (Upload | Custom)should not be downloadable. (Nginx) I am running a drupal site on nginx and I have a civicrm set-up on this site. Whenever I login and goto civicrm dashboard, I am getting this warnings. I have tried searching solution for this, not able to fix it.

Files in the data directory (/home/drupal7/sites/example.org/files/civicrm/custom/) should not be downloadable.

Read more about this warning

Files in the data directory (/home/drupal7/sites/example.org/files/civicrm/upload/) should not be downloadable.

Read more about this warning

I have tried this on my nginx configuration file.

    root /home/drupal7;

    location ~ /sites/example.org/files/civicrm/(custom|upload) {
        deny all;
        return 404;
    }

Your proposed solution in your nginx config looks about right; here's a tested & working example:

location ~* ^/sites/(.*)/files/civicrm/(ConfigAndLog|templates_c|upload|custom) {
    deny all;
}

Here are some things you could check.

Have you reloaded nginx since making the config change?
Pick a file in files/civicrm/custom/ and try to access it in a browser.

If you can, the nginx config needs fixing.
If you can't, the warning is spurious; it would be good to investigate why. Check your nginx access logs for the test requests that Civi makes to check access.

Is another location block in your nginx config taking precedence over this one? You can check this by temporarily enabling debug-level logging for the relevant virtual host, e.g.

error_log /path/to/log debug;

(Note that nginx needs to have been built with --with-debug .)
This will produce very verbose logging, so only enable it briefly while testing: enable debug, access a file under files/civicrm/custom/ , disable debug, then look through your error log for the request. From this, you should be able to see which location block matched the request.

You should also deny access to ConfigAndLog/ and templates_c/ as in the config above.

See checkUploadsAreNotAccessible.


Displaying Custom Contact Fields In Contact Dashboard What would be the best way to display custom contact fields in the contact dashboard (civicrm/user).

We're using custom fields to store waiver/agreement statuses and would like users to be able to get a quick view of all waivers from the dashboard.

If you are using Drupal, one option is to create a View as a Block and then set the Block to show at the Contact Dashboard page.

WP may have a similar solution based on using a CiviCRM Profile and having that set up (via some WP approach I do not know) to show at the Contact Dashboard path


"find out more..." link for civievents points to a page that does not exists I'm running civicrm 4.6.5 in WordPress 4.2.4. I'm using civievents to manage multiple events and would like to display these events on a WordPress Page.

I'm using the following short codes on the events page.
[civicrm component="event" id="17" action="info" mode="live" hijack="0"]
[civicrm component="event" id="18" action="info" mode="live" hijack="0"]

And they appear like this: https://lofcenter.org/events/

But when I click on either event to "find out more..." it points to https://lofcenter.org/civicrm/?page=CiviCRM&q=civicrm/event/info&reset=1&id=17
and gets the following error:

Am i missing a configuration option?
btw - I'm not running any Cache on this installation.

Any suggestions?

Those paths look correct, but they depend upon a page existing at the path /civicrm.  CiviCRM 4.6 creates one upon install, but maybe you renamed or removed it not knowing what it was for.

The simplest solution is to create a blank page called CiviCRM that has the URL https://lofcenter.org/civicrm

CiviCRM on WordPress takes a page, wipes the content, and sticks the CiviCRM content there when the "page=CiviCRM" parameter is set.  The page it uses is whatever's before the question mark in the URL, and you can set it in Administer > System Settings > CMS Database Integration.  However, any working page or post will do, so just to demonstrate, the link https://lofcenter.org/aboutus/?page=CiviCRM&q=civicrm/event/info&reset=1&id=17 works just fine.  You just need to make sure the page CiviCRM points to exists, so you can either set the base page to an existing page or create a base page where CiviCRM expects one should be.


Batch update cases - closing cases I was very excited to test out the new capability that you can batch update cases but I'm not sure I'm testing it as intended. I was hoping to be able to use it to close multiple cases at once. Here is what's happeneing:

Even though I can update the case statuses to a 'closed' status like "Resolved" it doesn't record an activity (with the date that the case was closed).
If I add the case end date to the profile, a undefined notice pops up on the batch edit screen and I can only select today's date. Notice: Undefined index: formatType in CRM_Utils_Date::addDateMetadataToField() (line 1878 of /srv/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/Date.php).
If I do process the update with today's date, I don't see anywhere that the date is referenced (aside from being able to search by end date, I don't see a reference inside the case itself.)

I'm assuming I'm expecting too much (mixing capabilities)? It is after all technically updating the case status and date.

(While I am currently in Civi 5.5.3 - I verified this behavior is also on the dmaster demo site.)

Seems like either it was unfinished or the usual tracking was maybe intentionally left out. More info here https://github.com/civicrm/civicrm-core/pull/11411


Has anyone got a recent example of a REST client under Drupal 9, possibly using AJAX? I am trying to work out a way of presenting contact information from CiviCRM to another server, but am struggling to work out how one would code it. Has anyone got an example of something that works under Drupal 9?
Running https://<server root>/civicrm/ajax/rest?entity=Contact&action=get&api_key=Userkey&key=Sitekey&json={%22contact_type%22:%22Individual%22,%22first_name%22:%22<firstname%22,%22last_name%22:%22lastname22}

gives
{"IP":"fe80::e00a:1010:c022:f80e%9","level":"security","referer":null,"reason":"CSRF suspected","is_error":1,"error_message":"SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api3()."}

so clearly it needs to be called from javascript, presumably on the client.
It would be really helpful if someone had an example of a working script.

You may need to add below line in .htaccess or nginx config to allow php file be executed
RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/[a-z]+\.php$

Copy extern directory from civicrm vendor folder into libraries
The rest api url for drupal would look like
https://sitename/libraries/civicrm/core/extern/rest.php


Is this the correct patch for CiviCRM version 4.6 here CIVI-SA-2016-23? After receiving the security announce, i have been trying to apply the patch given here CIVI-SA-2016-23 but had this error message patch -p1 < 9482.diff
patching file CRM/Utils/API/AbstractFieldCoder.php
Hunk #1 succeeded at 123 (offset -5 lines).
patching file js/Common.js
Hunk #1 succeeded at 445 (offset -15 lines).
Hunk #2 FAILED at 639.
Hunk #3 succeeded at 690 (offset -105 lines).
Hunk #4 succeeded at 716 with fuzz 2 (offset -119 lines).
Hunk #5 succeeded at 753 with fuzz 2 (offset -122 lines).
Hunk #6 FAILED at 898.
Hunk #7 FAILED at 1041.
Hunk #8 succeeded at 968 (offset -184 lines).

Can this patch also be used for version 4.6? because the reference Issue CRM-19709 says affected version is 4.7 and affected versions in security annouce are

4.7.13 and earlier
4.6.23 and earlier

Maybe I'm doing something wrong, i am using this procedure to apply the patch.

I'm on Civicrm 4.6.10.

Specific answer on patching CRM-19709 for 4.6.10

Go to the appropriate Github repo, civicrm-core
Select the branch you want to find a backported patch for, 4.6
Read the commit messages and find commit(s) you want to apply, 3a7376 and 675201
Append .patch to those commit URLs: 3a7376.patch, 675201.patch
Try a patch --dry-run dry-run to see if the patches apply, in the order they were applied to the 4.6 branch.
If that works (no errors), apply the patches by dropping the --dry-run option.

To perform the actual patch, I tend to use curl PATCHURL(S) | patch -p1, so the command I'd use to test if the patches will apply will be:

curl \
  https://github.com/civicrm/civicrm-core/commit/67520196442e493ea1c6ddfcd4954d0f3c7ab3fe.patch \
  https://github.com/civicrm/civicrm-core/commit/3a73760d967edab137fe8eae20fdf63967be9ecf.patch \
| patch -p1 --dry-run

Pulling patches directly from a URL saves a few steps, and means we don't end up with abcdef.patch left on disk after.

Please see also my separate answer on how to avoid getting into this situation :)


Paypal Standards IPN ERROR I'm having some problems with Paypal Standards.
I was originally getting an error #40710 that my return URL was no good, so I disabled Auto return in paypal.
Now I am getting this error: Sending a relative URL to PayPalIPN is erroneous. Please make your resource URL (in Administer » System Settings » Resource URLs ) complete.
I even disabled the IPN feature in paypal but still get the error and unable to make a donation through paypal.

How do I get Auto Return and IPN features working?

Did you check your resource url setting? If so, what is it?

It needs to be a complete url, as explained in the help for that field:

http://mysite.mydomain.com/sites/all/modules/civicrm/


VERP info not added to mail headers? I'm trying to set up the CiviMail return channel, and expect that, if I do it properly, headers like Reply-To and/or Return-Path will have values like bounces+verp-stuff@mydomain.com, but so far, that's not happening.

What I've done so far:

Created an email account bounces@mydomain.com through Google Apps, and verified it receives an email sent to bounces+123@mydomain.com
Edited the default mail account at /civicrm/admin/mailSettings?reset=1, with values (server, username, password, protocol, use ssl) that allow it to check email over IMAP on the bounces@mydomain.com and verified that some messages in that account get labeled with the inbox-civimail-ignored.
Also at /civicrm/admin/mailSettings?reset=1, set "Email Domain" = "mydomain.com" and "Used For?" = "Bounce processing".  Other fields in this form are blank.
Outbound Email (/civicrm/admin/setting/smtp?reset=1) is set to "mail()"

I then create a new scheduled mailing and send it out using the "Send Scheduled Mailings" job, and the mail arrives with these headers:

Delivered-To: me@example.com
Received: by a.a.a.a with SMTP id x3csp113516itf;
        Wed, 29 Jul 2015 10:06:44 -0700 (PDT)
X-Received: by b.b.b.b with SMTP id o40mr63319942qga.0.1438189604113;
        Wed, 29 Jul 2015 10:06:44 -0700 (PDT)
Return-Path: <b.94.15.1ff1d88a496eafde@mydomain.com>
Received: from mydomain.com (mydomain.com. [c.c.c.c])
        by mx.google.com with ESMTP id g9si32260106qgf.41.2015.07.29.10.06.43
        for <me@example.com>;
        Wed, 29 Jul 2015 10:06:44 -0700 (PDT)
Received-SPF: pass (google.com: domain of b.94.15.1ff1d88a496eafde@mydomain.com designates c.c.c.c as permitted sender) client-ip=c.c.c.c;
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of b.94.15.1ff1d88a496eafde@mydomain.com designates c.c.c.c as permitted sender) smtp.mail=b.94.15.1ff1d88a496eafde@mydomain.com
Received: by mydomain.com (Postfix, from userid 33)
    id D96011442D; Wed, 29 Jul 2015 17:06:43 +0000 (UTC)
To: Two Mice <me@example.com>
Subject: test 6fd
X-PHP-Originating-Script: 1001:mail.php
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_10b250b1b5a6af786cd9e0315548c9d9"
Reply-To: "My Site"
 <info@mydomain.com>
From: "My Site" <info@mydomain.com>
List-Unsubscribe: <mailto:u.94.15.1ff1d88a496eafde@mydomain.com>
job_id: 94
Precedence: bulk
X-CiviMail-Bounce: b.94.15.1ff1d88a496eafde@mydomain.com
Date: Wed, 29 Jul 2015 12:06:43 -0500
Message-Id: <20150729170643.D96011442D@mydomain.com>

--=_10b250b1b5a6af786cd9e0315548c9d9
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

Suspecting that our postfix setup might be messing with the headers, I set Outbound Email (/civicrm/admin/setting/smtp?reset=1) to "Redirect to Database", then created a new scheduled mailing and sent it out.  The mail was stored in the civicrm_mailing_spool table with these headers:

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_6f3fb5f7026a6aecc8d6a73af912a390"
Reply-To: "My Site"
 <info@mydomain.com>
Return-Path: b.100.16.af889b4c23dd0331@mydomain.com
From: "My Site" <info@mydomain.com>
Subject: test 7
List-Unsubscribe: <mailto:u.100.16.af889b4c23dd0331@mydomain.com>
job_id: 100
To: Two Mice <me@example.com>
Precedence: bulk
X-CiviMail-Bounce: b.100.16.af889b4c23dd0331@mydomain.com | --=_6f3fb5f7026a6aecc8d6a73af912a390
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

Question: What else should I do to get bounces to be directed to my bounces@mydomain.com address?

In the Mail Accounts entry you set up, you need to set bounces+ as the localpart.  Everything else looks good.

In your examples, you have b.94.15.1ff1d88a496eafde@mydomain.com as the return-path in the the first one and b.100.16.af889b4c23dd0331@mydomain.com in the second.  CiviMail just needs to know to tack "bounces+" on the front of those addresses, and that's where the localpart comes in.


Bug in 4.6.3 and 4.6.8 I performed a custom include/exclude search. When the results were returned, I checked the first record and the radio button '1 selected records only' was properly chosen. I selected a second record and it worked as well. I went to the next page and selected a third record and it worked as well.

I then performed the search again. This time, before selecting any records, I sorted by contact type. Again, I was able to select individual records. I then sorted by contact type again (to change the order) and when individual records were selected, the radio button showed '0 selected records only' and the action menu was disabled.

I saw this error in 4.6.3 and updated to 4.6.8 and the bug persists.

If this is not the right forum for bug reports, please direct em to the proper venue.

Thank you.

It sounds like you're experiencing a JavaScript-related bug.  This can happen for a lot of different reasons - some of which are tied to your setup (e.g. a conflicting Wordpress/Drupal module) or even your browser settings.

You should be able to troubleshoot this using the Troubleshooting JavaScript in CiviCRM advice.  Before doing that, I'd definitely follow choster's advice and test this on the demo site (https://civicrm.org/demo) to help isolate what might be causing the issue!


Change Log Tab Excrutiatingly Slow - Poorly Performing Query and Fix (from 8 minutes down to 4 seconds) The page takes about 8 minutes to return which is absurdly slow for anything expected to be remotely interactive. It is so slow that my client is referring to it as the "Triangle of Doom".
I tracked it down to this query:
INSERT IGNORE INTO civicrm_tmp_e_logsummary_ffa3ac146126d178ade367f2a5d17bf5
SELECT activity_id,  IF (entity_log_civireport.log_action = 'Insert' AND extra_table.activity_type_id = 51 , GROUP_CONCAT(entity_log_civireport.contact_id), 1) , entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_activity_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name

FROM            staging_civicrm.log_civicrm_activity_contact entity_log_civireport
JOIN            civicrm_contact modified_contact_civireport ON (entity_log_civireport.contact_id = modified_contact_civireport.id )
JOIN            staging_civicrm.log_civicrm_activity extra_table ON extra_table.id = entity_log_civireport.activity_id
LEFT JOIN       civicrm_contact altered_by_contact_civireport ON (entity_log_civireport.log_user_id = altered_by_contact_civireport.id)
WHERE           modified_contact_civireport.id = 338520 AND
                entity_log_civireport.log_action != 'Initialization'
GROUP BY        entity_log_civireport.log_conn_id,
                entity_log_civireport.log_user_id,
                EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date),
                entity_log_civireport.id
ORDER BY        entity_log_civireport.log_date DESC;

EXPLAIN shows:
+------+-------------+-------------------------------+--------+---------------+---------+---------+---------------------------------------------------+---------+-------------------------------------------------+
| id   | select_type | table                         | type   | possible_keys | key     | key_len | ref                                               | rows    | Extra                                           |
+------+-------------+-------------------------------+--------+---------------+---------+---------+---------------------------------------------------+---------+-------------------------------------------------+
|    1 | SIMPLE      | modified_contact_civireport   | const  | PRIMARY       | PRIMARY | 4       | const                                             | 1       | Using temporary; Using filesort                 |
|    1 | SIMPLE      | extra_table                   | ALL    | NULL          | NULL    | NULL    | NULL                                              | 3014020 |                                                 |
|    1 | SIMPLE      | entity_log_civireport         | ALL    | NULL          | NULL    | NULL    | NULL                                              | 5518537 | Using where; Using join buffer (flat, BNL join) |
|    1 | SIMPLE      | altered_by_contact_civireport | eq_ref | PRIMARY       | PRIMARY | 4       | staging_civicrm.entity_log_civireport.log_user_id | 1       | Using where                                     |
+------+-------------+-------------------------------+--------+---------------+---------+---------+---------------------------------------------------+---------+-------------------------------------------------+


CiviCRM Data not showing in Views - Drupal 9, Shared DB After running into problems setting up Views integration with CiviCRM installed on a separate database, I gave up and started my project over with CiviCRM installed on the same database as Drupal 9.  This has solved the privileges problem I was having.
Here's my old question about the Privileges problem (which I'd still love an answer to if anyone has one!)
However, I'm now running into an issue where CiviCRM fields aren't showing up as an option in Views. The documentation seems to suggest that if CiviCRM is installed on the same db as Drupal, this data should show up with no further configuration needed.

If your CiviCRM and Drupal are located within the same database the 12
steps below are not required.

Help!  What am I doing wrong?
EDIT:  At @KarinG's suggestion I installed and enabled the CiviCRM Entity module, which has fixed the problem where CiviCRM entities weren't showing up as options in Views.  However, I now have a problem where those entities are not showing up in the results. I've flushed Drupal's caches many times at this point.
EDIT:

No results are returned.
Thank you in advance for all your help! It really feels like there's just some silly box I've left unchecked somewhere.

Austin -> did you install and enable CiviCRM Entity Module?


Using data from CiviCRM to change filename Here is what I need to do:

The user uploads an image, and I need to change the filename of the image to be firstname_lastname.filtype.

The first and lastname are stored within CiviCRM, but the upload is occuring in Drupal 7.

I'm thinking I need to write some PHP that pulls in the data from CiviCRM, and then sets it as the file name.

I'm still pretty new to Civi, can anyone give me some guidance on how I could go about doing this?  How can I pull in the data from CiviCRM?

Or, is there a way to use CiviCRM tokens inside of Drupal?

I am assuming that you are a drupal coder (because the upload starts in Drupal). Information from CiviCRM can be used in Drupal by using the CiviCRM. This is documented in the Developer Guide.

An example for finding the first and last name of the current user in drupal is

$uid = $GLOBALS['user']->uid;   // get id current user

civicrm_initialize(); // needed for classloading

/* find the CiviCRM contact id using the drupal user
$contact_id = civicrm_api3('UFMatch', 'getvalue', array(
  'return' => "contact_id",
  'id' => $uid,
));

/* use contact id to find contact details */
$result = civicrm_api3('Contact', 'getsingle', array(
  'id' => $contact_id,
));

/* create the file name */
$file_name=$result['first_name'].'_'.$result['last_name'];