title: How many organizations use CiviCRM?

text:
# Question
Title: How many organizations use CiviCRM?
This is a minor issue, but the count of organizations using CivCRM that is displayed on my civi home page seems to bounce around quite a bit. For a time it showed numbers over 10,000. Just now it says, "Used by over 6,273 organizations ..." Last week I am pretty sure it was even lower but I did not record the number.
The 2015 blog post on this topic said, "There are close to 9,000 nonprofit or governmental organizations worldwide relying on CiviCRM ..." The updated widget on the same page reports 11,061 organizations as of June 5, 2017. Just wondering if actual usage varies that much or if the measurement technique needs work.

# Answer
I am the maintainer of the statistics for CiviCRM. There are between 10,000 and 11,000 organizations actively using CiviCRM at the moment. We suffered a hardware failure on the stats server hence the little fluctuation. The statistics will soon be back to normal. More information at https://stats.civicrm.org. Thanks.
> 8 votes

---
Tags: core
---


# Question
Title: Drupal Webforms: Can I use the Conditions to control how the contacts are filtered?
I have a webform for staff members to record supervision with volunteers, and each staff member has approximately 10 volunteers that they are the named 'Link Worker' for. The webform has a field for the Staff member's name and a field for the Volunteer's name (both using autocomplete so that it allows users to select from contacts already in the database).

My question is, is it possible to filter the volunteer contacts by the Staff Member? (i.e. if we select "John Smith" as the Staff member, can we restrict the volunteers to those who John supervises?)

I think the answer is no, it's not possible, but just wondering if anyone has any suggestions....

# Answer
> 1 votes
We ran into the same issue and didn't want to customise the webform module as it is heavily relied on for a lot of data input and needs to be kept secure and easy to maintain.

So we built a Drupal view displaying the Volunteers based on their relationship to the Staff member (I'm assuming they are related in CiviCRM). When the Staff Member visits the page, it can restricted to show only those the have an active relationship to using a contextual filter to the Drupal User.

This post should help if you've not done this before: How to create a Drupal View with multiple CiviCRM relationships?

We then created a link (using the views Global Text field) to the webform to prepopulate the Volutneer as cid2 or contact 2 (assuming the staff member is cid1) which looks something like this: myorganization.org/node/1?cid2=\[id\] where \[id\] is the id of the volunteer.

---
Tags: drupal, webform-civicrm, relationships
---


# Question
Title: CiviHR/hrbank: Incorrect datetime value: '0' for column 'created_date
I'm trying to install the hrbank extension of CiviHR 1.3.0 on a CiviCRM 4.7.13/Ubuntu 16.04/Php7 stack. I get the error "DB Error: unknown error"

The stacktrace in the ConfigAndLog directory shows that a value 0 is used for the date\_created field of the civicrm\_custom\_group, and apparently that is not allowed:

```
Oct 25 08:45:09  [info] Creating canary table

Oct 25 09:10:01  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_display , help_pre , help_post , weight , is_active , table_name , is_multiple , collapse_adv_display , created_date , is_reserved ) VALUES ('Bank_Details' , 'Bank Details' , 'Individual' , 'Tab' ,  0 , '' , '' ,  12 ,  1 , 'civicrm_value_bank_details_9' ,  0 ,  0 ,  0 ,  1 )  [nativecode=1292 ** Incorrect datetime value: '0' for column 'created_date 'at row 1]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_display , help_pre , help_post , weight , is_active , table_name , is_multiple , collapse_adv_display , created_date , is_reserved ) VALUES ('Bank_Details' , 'Bank Details' , 'Individual' , 'Tab' ,  0 , '' , '' ,  12 ,  1 , 'civicrm_value_bank_details_9' ,  0 ,  0 ,  0 ,  1 )  [nativecode=1292 ** Incorrect datetime value: '0' for column 'created_date' at row 1]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_display , help_pre , help_post , weight , is_active , table_name , is_multiple , collapse_adv_display , created_date , is_reserved ) VALUES ('Bank_Details' , 'Bank Details' , 'Individual' , 'Tab' ,  0 , '' , '' ,  12 ,  1 , 'civicrm_value_bank_details_9' ,  0 ,  0 ,  0 ,  1 )  [nativecode=1292 ** Incorrect datetime value: '0' for column 'created_date' at row 1]"]
)

Oct 25 09:10:01  [info] $backTrace = #0 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(229): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB.php(984): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...")
#3 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...")
#4 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...", "DB_Error", TRUE)
#5 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#6 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...", "1292 ** Incorrect datetime value: '0' for column 'created_date' at row 1")
#7 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...")
#9 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2438): DB_common->query("INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...")
#10 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_d...")
#11 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(482): DB_DataObject->insert()
#12 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Migrate/Import.php(130): CRM_Core_DAO->save()
#13 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Migrate/Import.php(207): CRM_Utils_Migrate_Import->copyData(Object(CRM_Core_DAO_CustomGroup), Object(SimpleXMLElement), TRUE, "name")
#14 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Migrate/Import.php(78): CRM_Utils_Migrate_Import->customGroups(Object(SimpleXMLElement), (Array:2))
#15 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Migrate/Import.php(56): CRM_Utils_Migrate_Import->runXmlElement(Object(SimpleXMLElement))
#16 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/templates/CRM/Admin/Page/Extensions/civihr/civihr-1.3.0/hrbank/CRM/HRBank/Upgrader/Base.php(95): CRM_Utils_Migrate_Import->run("/var/www/wordpress/wp-content/plugins/civicrm/civicrm/templates/CRM/Admin/Pag...")
#17 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/templates/CRM/Admin/Page/Extensions/civihr/civihr-1.3.0/hrbank/CRM/HRBank/Upgrader/Base.php(250): CRM_HRBank_Upgrader_Base::executeCustomDataFileByAbsPath("/var/www/wordpress/wp-content/plugins/civicrm/civicrm/templates/CRM/Admin/Pag...")
#18 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/templates/CRM/Admin/Page/Extensions/civihr/civihr-1.3.0/hrbank/hrbank.civix.php(45): CRM_HRBank_Upgrader_Base->onInstall()
#19 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/templates/CRM/Admin/Page/Extensions/civihr/civihr-1.3.0/hrbank/hrbank.php(50): _hrbank_civix_civicrm_install()
#20 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager/Module.php(76): hrbank_civicrm_install()
#21 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager/Module.php(48): CRM_Extension_Manager_Module->callHook(Object(CRM_Extension_Info), "install")
#22 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php(229): CRM_Extension_Manager_Module->onPreInstall(Object(CRM_Extension_Info))
#23 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Extensions.php(181): CRM_Extension_Manager->install((Array:1))
#24 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(431): CRM_Admin_Form_Extensions->postProcess()
#25 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#26 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
#27 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), "next")
#28 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), "next")
#29 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#30 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(384): CRM_Core_Controller->run()
#31 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(168): CRM_Core_Page_Basic->edit(1, NULL)
#32 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Extensions.php(121): CRM_Core_Page_Basic->run()
#33 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Extensions->run((Array:3), NULL)
#34 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#35 /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#36 /var/www/wordpress/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:3))
#37 /var/www/wordpress/wp-includes/plugin.php(524): CiviCRM_For_WordPress->invoke("")
#38 /var/www/wordpress/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
#39 {main}

```

# Answer
> 3 votes
I think this is more of an issue with CiviCRM/HR than MySQL

Passing 000 like dates is deprecated in newer versions of MySQL so approaches that disable `NO_ZERO_DATE` are a little short sighted (though they might get you out of an immediate pickle).

Hence the answer is probably to fix the CiviHR and/or CiviCRM. In most cases, I imagine the fix is no harder than changing the MySQL setting.

e.g. a fix like https://github.com/veda-consulting/uk.co.vedaconsulting.mailchimp/pull/279/commits/5edb7bf772d5bb89302a8970bd7fae37672b5beb solve the problem for the mailchimp extension.

A fix to somewhere like CRM/Core/BAO/CustomGroup.php might be good to solve the problem more globally.

# Answer
> 1 votes
I encountered the same problem when installing CiviVolunteer recently. I was using a similar setup: Ubuntu 16.04, CiviCRM 4.7.16 and MySQL 5.7.17. This is likely a MySQL issue: recent versions of MySQL have changed the default behavior with respect to the `NO_ZERO_DATE` setting. I just posted an issue with CiviVolunteer here which might be helpful: https://issues.civicrm.org/jira/browse/VOL-299

Here's my workaround, I'm guessing this will work for you too:

* Login to the CiviCRM database and examine the current sql\_mode setting: `SELECT @@GLOBAL.sql_mode;`
* Note the current setting parameters, if `NO_ZERO_DATE` is set it should be disabled
* Edit: `/etc/mysql/mysql.conf.d/mysqld.cnf` and add the settings from the previous step with `NO_ZERO_DATE` omitted. For example, add the following to the end of the config file: `sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'` Note: this workaround fix is fairly broad and affects all database instances, this could probably be fine tuned somewhat.
* Restart MySQL and reinstall your CiviCRM extension
* After successful installation, revert the `sql_mode` settings by removing the above line from `mysqld.cnf`.

Related links:

---
Tags: civihr
---


# Question
Title: Displaying Custom Fields in Views Calendar
Is there a way to display custom fields in a Views Calendar (Drupal 7, CiviCRM 4.7.18)? I have custom fields in a table assigned to a certain contact (with the option to add more rows). One of these fields, is a date/time field. I'm trying to display this field in Views Calendar. I tried going to "add view from template" and then choosing the option: "A calendar view of the 'custom\_45' field in the 'civicrm\_contact' base table." However, I'm getting the error:

```
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_contact.custom_45' in 'field list'

```

Weird because I am able to list all these fields in a table fine.

# Answer
> 1 votes
That error appears when Drupal can't recognise your CiviCRM SQL Tables.

You can find guidance on how to update your settings.php file here: https://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration

---
Tags: custom-fields, drupal-views, calendar
---


title: CiviCRM MailChimp API Limitations

text:
# Question
Title: CiviCRM MailChimp API Limitations
I'm running into an issue that I'm unsure is code-related or workflow-related, so I'm cross-posting on the CiviCRM StackExchange as well. I'm able to configure everything to talk well with MailChimp, but when I do a dry run Pull sync from MailChimp to a fresh CiviCRM group, I'm only seeing 10 Contacts syncing over from lists I know have between 13 and 700 Contacts. I've combed through the issue discussions but don't see any tracking of this particular issue.

As far as I can tell, I'm not seeing any errors Is there an API issue I'm running into? I've tried a configuration both with a mature and a fresh MailChimp account. Thanks!

# Answer
First check would be to ensure the master group to list includes all the contacts that could be in the sub groups. This is where most people trip up.
> 1 votes

---
Tags: extension, mailchimp
---


# Question
Title: HELP CiviDiscount Auto-Apply feature not working!
I'm using cividiscount 3.3 on civicrm 4.7.16 on Joomla 3.6.5. I created a discount code for current members to be applied automatically only it does not apply automatically. I can enter it manually. I've attached the code configuration, can anybody tell me what might be wrong? By the way I reviewed similar posts and some of the older posts are describing a patch but I'm thinking it was resolved in the latest version, 3.3? If not can someone please help?

Thanks\]

# Answer
> 2 votes
I figured it out. Users need to log in to Joomla to get the discount.

# Answer
> 0 votes
I have a similar issue.

A discount code is created for each membership levels. It doesn't apply on the event types but applies if you select an event in the Events field so each time you create a new event, you have to remember to associate the automatic discount code to the new event.

It is a workaround but it would be great to have it working.

---
Tags: cividiscount
---


# Question
Title: Civimail wont send (but Civi email will)
bit weird but here's whats happening

I use the Mosaico extension (thank you very much) to do bulk emails. Ive been using it for some months with no issues. About a month ago I included a few Civi tokens including a checksum for contacts to update their details - all good.. or so I thought

I started to get complaints that long time recipients weren't getting the weekly newsletter. The non receipt started when I included the checksum.

After a few wrong turns the issue turned out to be that every time someone used the checksum to update their details Civimail wont recognise their record

There is nothing wrong with their email address - I know this because I can click on the contact, send an email and they receive it.

The only way to rectify this that I've found is to go through every field on their personal details and recreate it, save it and then Civimail will see the record. Presumably the details they have updated are causing the problem but I can't tell what they changed so have to do them all

any suggestions to what might be going on ( and how to fix it!)

thanks

Civi 4.7.14 Wordpress 4.7.5

# Answer
> 1 votes
well the answer turned out to be using a profile that included the "is deceased" field. Somehow that was setting that field to Null and Civimail didnt like that.

Setting the "is deceased" field to 0 fixed it up and all good now

---
Tags: wordpress, civimail, checksum, mosaico
---


# Question
Title: How can I align an image to the top of a cell in civimail?
Currently it is displaying in the middle...

```
        </td>
        <td style="width: 232px;">
        <div style="text-align:center">
        <figure class="image" style="display:inline-block"><img alt="" height="353" src="...jpg" width="250" />
        <figcaption>Name AM</figcaption>
        </figure>
        </div>
        </td>

```

# Answer
> 1 votes
In the `<`figure`>` tag, you could try changing it to `<`figure class="image" style="display:inline-block vertical-align: top;"`>` Does that work?

Incidentally, there should be a semi-colon after "inline-block" and in the `<`div`>` tag after "center".

If this doesn't work, could you say what CSS you have in the class="image"

**Edit1** On reflection, I dont think the above will work. You could try the following:

```
</td>
            <td style="width: 232px; text-align: center;"><img alt="" height="353" src="...jpg" style="vertical-align: top;" width="250" />
            <figure class="image" style="display:inline-block">
            <figcaption>Name AM</figcaption>
            </figure>
            </td>

```

Do you need all the CSS in the `<figure>` tag?

---
Tags: civimail, images
---


title: Full minute timeouts on first page load

text:
# Question
Title: Full minute timeouts on first page load
I'm finding that when I first go to a CiviCRM page in the morning there's a loading time of just over 1 minute(!)

There are no errors (on screen, nor in apache error log, nor in Drupal's watchdog) and after this delay everything works as normal.

Looking in firebug it's the actual page load that's stuck on client "waiting" for a full minute before it jumps to life and starts loading the zillion other requests typically needed on a CiviCRM page, which all go fast enough.

I've tried to trigger this. Clearing Drupal caches (`drush cc all`) does not trigger it; clearing CiviCRM caches (via `civicrm/admin/setting/updateConfigBackend`) do **not** trigger this delay.

However, adding a new user in Drupal **does** also trigger it. (Adding a new Contact in CiviCRM does *not* trigger it.)

Any ideas?

# Answer
**This problem is not to do with CiviCRM.**

~~My server defaults to using ipv6 but this is not configured. Therefore when CiviCRM tries a `file_get_contents('http...')` it is timing out. This vexed me for a while because on the command line `wget` works fine; I thought I had disabled ipv6 on the server, but turns out `file_get_contents` doesn't know about that.~~

Sorry for the non-question! I only saw this happening with CiviCRM. FYI it is triggered by the occasional CiviCRM security checks (which ironically, I recently asked another question about). I don't know when these are triggered; but they are triggered about once a day per user and again if a Drupal user is added.

## EDIT

This is not an IPv6 issue, as I originally thought. I now believe it's a problem/quirk of using `apache2-mpm-itk` as with this worker I get the problem but with the default worker I do not.

**I can confirm that this is/was a bug in the Apache MPM ITK module**.

For Debian Jessie users, you can get a fix by:

```
deb http://mirrors.linode.com/debian/ jessie-proposed-updates main

```

into `/etc/apt/sources.list`, and then running

```
apt update && apt install libapache2-mpm-itk
systemctl restart apache2.service

```

Apparently this fix will make it into Jessie 8.2, too.
> 4 votes

# Answer
I have exactly the same issue but I'm running Ubuntu. Can you be more specific about the patch to help me find it for Ubuntu? Thanks!
> 0 votes

---
Tags: performance, 4.6.10
---


title: No such field: card_type, but exists

text:
# Question
Title: No such field: card_type, but exists
I've upgraded CiviCRM multiple times since we last ran an event which requires payments, and are now at 4.7.17 on Joomla 3.6.5 with MySQL 5.7.18.

When many (not all) users try to register they encounter "DBError: no such field" and the debug info points to `Unknown column 'card_type' in 'field list', 1054` and the query

```
INSERT INTO civicrm_financial_trxn (to_financial_account_id , trxn_date , total_amount , fee_amount , net_amount , currency , status_id , payment_instrument_id ) VALUES ( 10 ,  20170607160037 ,  3200 ,  0 ,  3200 , 'SEK' ,  2 ,  4 )  [nativecode=1054 ** Unknown column 'card_type' in 'field list']

```

and the backtrace shows this

```
...
#14 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(487): DB_DataObject->insert()
#15 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/FinancialTrxn.php(66): CRM_Core_DAO->save()
#16 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(3364): CRM_Core_BAO_FinancialTrxn::create((Array:11))
#17 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(236): CRM_Contribute_BAO_Contribution::recordFinancialAccounts((Array:22))
#18 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php(1038): CRM_Contribute_BAO_Contribution::add((Array:22), (Array:0))
#19 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php(611): CRM_Event_Form_Registration_Confirm::processContribution(Object(CRM_Event_Form_Registration_Confirm), (Array:35), NULL, "6642", TRUE, FALSE, (Array:10))
#20 /var/www/events/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(453): CRM_Event_Form_Registration_Confirm->postProcess()
...

```

However, in my database the field *does* actually exist, as shown by this create statement generated from the table

```
CREATE TABLE `civicrm_financial_trxn` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Gift ID',
    ...
   `card_type` int(10) unsigned DEFAULT NULL COMMENT 'FK to accept_creditcard option group values',
    ...

```

How can this happen? What do I do next? Should I try re-running the database upgrade script?

# Answer
Are you sure you dont have logging turned on? It may be the trigger on the table failing to insert into the logging tables because they haven't been refreshed yet?

Solution is to disable logging whilst the upgrade is done then turn back on again.
> 0 votes

---
Tags: error, mysql, fields, datatables
---


title: Activity date for automated mailings

text:
# Question
Title: Activity date for automated mailings
For an automated emailing, eg for event registration, why is the Activity date shown as the date the email was set up ('Scheduled'), not the date the automated emailing took place. For example, we have event participants who registered for an event on 23 April receiving a set of post registration emails, with Activities all dated April 4th, long before they had even registered. Can this be changed as part of configuration. Thanks

# Answer
I think this is down to the fact that your using the mailing jobs as part of your scheduled reminders and this is the reason the wrong date shows up. The mailing job will have the date of the 4th of april and thefore the activities all show that date. p.s. This is Parvez @ Veda hence I know the setup!
> 1 votes

---
Tags: civimail
---


title: Table for Custom Fields

text:
# Question
Title: Table for Custom Fields
I'm using Joomla and CiviCRM 4.7 and I want to add custom fields to the Participant List that's available as menu item on Joomla. I've searched all of the tables but I don't know where to find the data in the civicrm database.

I have a custom group called Conference\_Selections and one of the options is for participants to choose a workshop and a study group. I want to add those fields to the participant list report so my committee can access it on the front end without having to access the report from the back end.

Is this possible? If so, where is this data stored?

Thanks for your help!

# Answer
If I understand correctly, you want to add some custom fields to the "Event Participant List" report, as displayed in this screenshot:

If so, you just need to mark those particular custom fields as "Searchable":

* Go to **Administer menu » Customize Data and Screens » Custom Fields**
* Click **View and Edit Custom Fields** in the row labeled *Conference\_Selections*.
* Next to each field that should display on the report, click **Edit Field**.
* Tick the checkbox labeled **Is this field searchable?**.
> 1 votes

---
Tags: custom-fields, mysql
---


# Question
Title: Rules for Inbound Mail Processing (multiple addresses? searches?)
We'd like to use inbound mail processing with a bit more granularity so we can do a post-processing search that will let us easily tag new or updated constituents as YOUTH or ADULT.

Currently, we bcc: inbound@ourdomain.org and the new or updated records are created. However, we need to inspect each inbound email to understand if the contact should be tagged youth or adult.

I don't think we can have two inbound email addresses...if we can, I'd love to know how.

I thought maybe I could do something like use inbound+1@ourdomain.org (for youth) and inbound+2@ourdomain.org (for adults). This does result in the email and the +1 or +2 flag coming in to Civi! However, I don't see a way to isolate what we need. For example:

An advanced search for CONTACTS with an INBOUND EMAIL ACTIVITY has a check box for with/added by/assigned, but does not have a place to provide the address of inbound+1@ourdomain.org. If it did, I think this would give me a list of contacts that I would tag as youth.

Another option is an advanced for CONTACTS with INBOUND EMAIL ACTIVITY that contains "inbound+1@ourdomain.org". But I don't think the address shows in the activity records.

Another work-around I thought of is to include a distinct "code" in the emails we write and bcc to inbound@ourwebsite.org. For example, I could put +*+y after my sig file when I know I'm writing to a youth and then do an advanced search for CONTACTS that have INBOUND EMAIL ACTIVITIES containing +*+y in the body of the inbound email. This would work but seems *way* too complicated.

I'd appreciate any thoughts on this process. Thanks!

We're Wordpress 4.7 and CiviCRM 4.7.17.

# Answer
> 1 votes
What you're requesting is possible by writing a custom extension, or possibly with CiviRules.

I managed the creation of such an extension, which is available on Github. This extension changes the activity type of any inbound email sent to `inbound+support@example.org` to a different activity type.

If you're a coder, you can adapt that extension to your purpose. If not, try using CiviRules with a trigger of "when an activity is created" and conditions that match your inbound email, and an action of "add a tag".

---
Tags: email, activities
---


# Question
Title: Dashlets not available to be added to Dashboard
2 roles in Drupal, 2 groups in CiviCRM, 2 roles in CiviCRM

* administrators
* members of the board

permissions in Drupal

* administrators: all permissions
* members of the board: all, except some (see list at the end)

Administrator created some contact reports - in fact status reports on new contacts and open activities (tasks to do) - and defined them as dashlets. They can be added on the dashboard of administrator, but do not appear to be added an the dashboard of the members of the board.

Also, the members do not see the entry "Contact Reports" in the drop down menu "CiviReport", although they can see them when selecting "show all reports".

Which ACL do I need to add in CiviCRM "Manage ACL's", so that the board members can see and add the dashlets?

=== === ===

Members of the board do not have a Drupal permission for:

* import contacts
* remove contacts
* import SQL datasource
* manage CiviCRM
* IDS control bypass
* translate CiviCRM
* manage dedupe rules
* join double contacts
* force joining doble contacts
* show debug output
* use Ajax-API
* create manual batch
* edit own manual batch
* show own manual batch
* show all manual batches
* manage payment methods
* edit own API-keys

CiviEvent

* remove event
* manage event profiles

CiviContribute

CiviMember

* remove in CiviMember

CiviMail

* remove mailing

CiviReport

* show report SQL

# Answer
If I recall correctly, this is down to some peculiarity of the dashlet permissions. If you go to the **Access** tab of the report in question, you'll see two ways to set the permissions (see screenshot below). However, I believe only the "permission" setting will control access to the dashlet. Try setting both the Role ("Board Member") and the permission (to any permission the board members have) and you should be good to go.
> 3 votes

---
Tags: permissions, acl, dashlet
---


# Question
Title: import contacts Sorry but we are not able to provide this at the moment
I am using Drupal 7.50 and Civicrm 4.7.11 and received Sorry but we are not able to provide this at the moment. I am trying to import from a csv, individual records, 200 at a time. I imported the 1st lot ok but when i tried the 2nd it failed so I tried the 3rd with backtrace error logging.

my backtrace shows: (I have replaced "mysite")

backTrace

```
#0 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(187): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#4 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#5 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...", "DB_Error", TRUE)
#6 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "1728 ** Cannot load from mysql.proc. The table is probably corrupted")
#7 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#9 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2438): DB_common->query("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#10 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1627): DB_DataObject->_query("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#11 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(344): DB_DataObject->query("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#12 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1265): CRM_Core_DAO->query("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...", TRUE)
#13 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1963): CRM_Core_DAO::executeQuery("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_nume...")
#14 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Phone.php(74): CRM_Core_DAO::checkSqlFunctionsExist()
#15 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Block.php(348): CRM_Core_BAO_Phone::add((Array:6))
#16 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Location.php(66): CRM_Core_BAO_Block::create("phone", (Array:20), NULL)
#17 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(348): CRM_Core_BAO_Location::create((Array:20), TRUE)
#18 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(1897): CRM_Contact_BAO_Contact::create((Array:20))
#19 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/Import/Parser/Contact.php(1696): CRM_Contact_BAO_Contact::createProfileContact((Array:7), (Array:35), NULL, NULL, NULL, "Individual")
#20 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/Import/Parser/Contact.php(675): CRM_Contact_Import_Parser_Contact->createContact((Array:7), (Array:35), "16", NULL, TRUE, "")
#21 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/Import/Parser.php(217): CRM_Contact_Import_Parser_Contact->import("16", (Array:23), NULL)
#22 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/Import/ImportJob.php(302): CRM_Contact_Import_Parser->run("civicrm_import_job_8a23b4cabd18fd2738229c5c5b770bf2", (Array:20), 8, 1, "_id", "_status", "16", "fdf1658839c381797efed4e50ff5faaf", 200, NULL, 30, NULL, "")
#23 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/Import/Form/Preview.php(305): CRM_Contact_Import_ImportJob->runImport(Object(CRM_Contact_Import_Form_Preview))
#24 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Form.php(423): CRM_Contact_Import_Form_Preview->postProcess()
#25 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#26 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contact_Import_Form_Preview), "next", "Next")
#27 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Import_Form_Preview), "next")
#28 /home/mysite/public_html/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Import_Form_Preview), "next")
#29 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#30 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#31 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#32 /home/mysite/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#33 /home/mysite/public_html/drupal/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3))
#34 [internal function](): civicrm_invoke("import", "contact")
#35 /home/mysite/public_html/drupal/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#36 /home/mysite/public_html/drupal/index.php(21): menu_execute_active_handler()
#37 {main}
 Sorry but we are not able to provide this at the moment.
DB Error: unknown error
Error Details
Return to home page.

```

---

# Answer
> 1 votes
Looks like a permissions issue, if you try to login to the database and run the command that its trying to run i.e. SHOW function status WHERE db = database() AND name = 'civicrm\_strip\_non\_numeric', see if that works for you as the same user that CiviCRM logs in as.

---
Tags: import, error
---


title: OCR for Photo IDs?

text:
# Question
Title: OCR for Photo IDs?
I would like to set up an instance of CiviCRM to help independent candidates register to run for office in Indonesia, and one requirement here (like many other countries) is that a candidate has to gather signatories to petition their way onto the ballot. As proof of an individual's signature here, the candidate also has to collect a copy of their valid, government-issued photo ID.

What I would like to do is to allow supporters to essentially attach a photo of their ID to their profile, and then use OCR to verify the data they have entered matches with what is on their actual ID.

Has anyone come across any good tools for doing so? Abbyy.com seems to have some good cloud-based OCR tools, but not sure how hard it might be to integrate these with CiviCRM.

Any thoughts would be greatly appreciated.

# Answer
> 0 votes
Cividesk has written a business card scanner extension: https://www.cividesk.com/blog/post/scan-business-cards-civicrm. They can speak to specifics.

To write an extension that uses the ABBYY OCR seems like it wouldn't be too difficult, based on this code sample.

---
Tags: contacts, extension, import, images
---


# Question
Title: CiviVolunteer front-end assignment listing
Does CiviVolunteer provide the capability for front-end users to see a volunteer listing of assigned volunteer slots for an event? Thanks!

# Answer
> 1 votes
I assume that by front-end user you mean that the user doesn't have the "Access CiviCRM" permission?

Options for viewing the roster are outlined in the still-nascent documentation. Summary:

* Using the admin menu, go to Volunteers \> Manage Volunteer Projects (on Drupal the URL looks something like https://example.org/civicrm/vol/#/volunteer/manage). Note: this screen does not require "Access CiviCRM."
* Find the Project of interest, and click "View Volunteer Roster."

---
Tags: civivolunteer
---


# Question
Title: How to access images on server for CiviMail
I added images to the server via CiviMail (KCFinder). But when trying to use the UI to insert an image and click "Browse Server" I receive an "Unknown Error". None of the images are displayed. I'm unable to locate the images and insert them into a new mailing. Already checked the Resource URL and Directories. See image attached.

CiviCRM 4.7.11 and WordPress 4.6.1

# Answer
You may want to check Firewall or the settings in **WPSecurity** (plugin) if you have that installed. I ran into this problem and it was an option in WPSecurity for "Bad Query Strings" which blocked access to thumbnails in KCFinder.

According to the plugin... **Deny Bad Query Strings**

> This feature will write rules in your .htaccess file to prevent malicious string attacks on your site using XSS. NOTE: Some of these strings might be used for plugins or themes and hence this might break some functionality. You are therefore strongly advised to take a backup of your active .htaccess file before applying this feature.
> 1 votes

# Answer
Check the ownership of the folders where these images are uploaded to.
> 1 votes

---
Tags: civimail, images, kcfinder
---


title: Membership due change over time

text:
# Question
Title: Membership due change over time
I have a lifetime membership running for my organization. The dues for the membership have changed over time and will change over time in future. I want to classify everyone as a life member but at the same time track the different amount paid by different members based on the time of their enrollment.

I can use the price set option to enter multiple price for same membership. How I go about it?

Edited for clarification : the membership amount was X in 2000 , then it increased to X+Y in 2010, then it increases some more in 2015 like that. But all are under the same scheme. Just that in due course of time, the membership dues was increased by the organization. It is not an annual payment model. Once the desired payment is completed, thats it. There is no renewal. They are members for lifetime

# Answer
> 1 votes
This sounds like you want a Lifetime membership type with its minimum fee to level up every "x" years. Similar to purchasing a Gold - you can have it for lifetime but its price just increases with time.

If this is what you want, simply create a membership type from `Administer -> CiviMember -> Membership Type` with duration set to lifetime and write a custom code in extension/module which increases the minimum fee value of this membership type id with time in year.

Refererence for creating an extension - https://docs.civicrm.org/dev/en/master/extensions/civix/

---
Tags: civimember
---


title: REST API - json and chaining issues

text:
# Question
Title: REST API - json and chaining issues
I am having two issues w/ the REST api via curl.

1) API is ignoring json attribute. If I do not urlencode, I get a "Unable to decode supplied JSON" return msg. When I do encode, as shown below, I get past issue, but it seems to ignore any of the conditions set in json attrib. It just return all contacts, w/out restricting by external\_identifier or applying return filters set in json object.

```
$curl_post_data = [
    'debug' => 1,
    'version' => 3,
    'entity' => 'Contact',
    'action' => 'get',
    'json' => urlencode (json_encode ( ["sequential"=>1,"return"=>"id,do_not_mail","external_identifier"=>777] )),
    'api_key' => '1234',
    'key' => '1234',
];

```

If I take out conditions & filters out of json attrib, it works fine :

```
$curl_post_data = [
    'debug' => 1,
    'version' => 3,
    'entity' => 'Contact',
    'action' => 'get',
    'json' => 1,
    'api_key' => '1234',
    'key' => '1234',
    'external_identifier' => 777,
    'return'=> 'id,do_not_mail'
];

```

However, everyone else seems to be using this json attrib. I would like to get that working.

2) Second issue is chaining.

```
$curl_post_data = [
    'debug' => 1,
    'version' => 3,
    'entity' => 'Contact',
    'action' => 'get',
    'json' => 1,
    'api_key' => '1234',
    'key' => '1234',
    'external_identifier' => 777,
    'return'=> 'id,do_not_mail',
    'api.Contact.create' => urlencode (json_encode(['do_not_mail'=>0]))
];

```

Using api.Contact.create / replace, etc will trigger an undefined field error : undefined\_fields":\["api\_Contact\_create"\].

I am json\_encoding the field value in this example, but get the same issue by just passing an array. It just doesn't seem to recognize the chaining directive at all.

Any help much appreciated.

# Answer
Not everyone else use only the json, I find it easier to read and fix to use separate params ;)

I think the error is on the json you provide is not correct. Instead of:

\["sequential"=\>1,"return"=\>"id,do\_not\_mail","external\_identifier"=\>777\]

it should be

{"sequential":1,"return":"id,do\_not\_mail","external\_identifier":777}
> 1 votes

---
Tags: api, rest
---


# Question
Title: Calendar of Activities for CiviCRM 4.7.3 on Wordpress 3.8.5?
Is there a way to get a calendar view of Activities for CiviCRM on Wordpress? I can easily get all of them in a sequential list using Find Activities or the dashboard widget, showing all the information I require (type, date and time, "with", and "assigned to"), but I want a week or month planner/calendar view to make it easier for users to see at-a-glance when meetings are.

The Contact Calendar extension does not work, giving an error message about being unable to connect to the site. In any case I don't think it's what I need, because I want more than just one person's calendar. There are extensions for CiviEvent and some discussion of calendars in Drupal here on StackExchange, but I've not found a way to get what I want in a CiviCRM/WP installation.

# Answer
> 1 votes
I use a Wordpress plugin called EveryCal+1 - it has a built in hook to civiEvents and works/looks really nice.

# Answer
> 0 votes
As the Event Calendar already exists, it may be worth contacting the developer responsible to identify what would be involved in expanding it to also use activities of certain types.

Alternatively, you could commission a CiviCRM freelancer to do this expansion for you, on condition that they then publish that work to the wider community :)

---
Tags: wordpress, activities, calendar
---


# Question
Title: civix generate:module org.civicrm.angularex error
lteI have installed a civicrm buildkit with vagrantbox and vagrant up correctly on windows, ubuntu server run and at d7-master.dev I am listening drupal civicrm all done ok.

as I try to generate module using civix extension builder such as:

in cmd:

```
civix generate:module org.civicrm.angularex

```

I got this error: \[RuntimeException\] Failed to determine INI file path.

I tried everything what I knew and what see by google nothing happens.such as :

```
php --ini

```

works but not resolve this error.

Please Help me.

# Answer
> 1 votes
You just need to **set** the appropriate environment variable:

1. close your current cmd shell/terminal;
2. press `Win` \+ `R`, type `setx CV_CONFIG "%userprofile%\.cv.json"` and press `Enter`;
3. reopen the shell, goto your project's directory and test with `civix civicrm:ping -vvv`.

I gave further explanations about the reason in this answer.

# Answer
> 0 votes
Had the same issue, realized the module was actually created but with incomplete information in the "info.xml" file in the module.
Updated the content of the file and activated the extension from `Administer --> system settings --> extension`

---
Tags: drupal, civicrm-buildkit, civix
---


title: Event Registration Bug

text:
# Question
Title: Event Registration Bug
On our registration page, we ask that to register, you enter the number of registrations being purchased. When you enter 1, 2, 3, etc., it multiplies that by the registration fee of $315. Which is GREAT!

The problem comes when someone enters 0.00- it allows that person to register for the event for FREE. Help!

Can you help?

Sherry Jennings

# Answer
> 2 votes
You could set up the price field to be a select drop down an make the options 1, 2, 3, 4, etc. With the corresponding price for each quantity. This is not open ended you would have to setup quantities based on how many options you want to provide people.

Another option is to use the register multiple participants option in the online registration setup.

Hope this helps.

---
Tags: civievent
---


# Question
Title: Setting up a view to list the current user's activity details
bit of help appreciated please!

I'd like to create a view that shows authenticated users the details of some specific activities that've been added to their record (added by a different user, the target is the 'with contact').

**Fields to be shown**

> Activity type
>
> Activity description

**Filter type**

> Activity type

Where I'm falling down is setting the relationship or context to limit the results only to the currently logged-in user. I've had a look through Stackexchange but couldn't find what I'm looking for - would anyone be able to assist?

# Answer
have a look at this one. Not sure it has the Source v Target how you want it but it should provide an example of how to ensure the logged in User sees 'their' Activities. Good luck

In summary.

* Create an Activities based View
* Set the Relationship up in Views to join the relevant type of Contact to the Activity
* Add another relationship to join that Contact to their drupal user.
* Add a filter that sets 'current user IS Active) (or similar drupal description of the filter) and that Filter will use the Relationship you created above and mean it checks 'who is logged in' and then server up the Activities they are the Target of (or whatever Activity Contact type you need)
> 3 votes

---
Tags: drupal-views
---


# Question
Title: Expected information for iATS recurring contributions?
CiviCRM 4.7.13, iATS extension 1.5.3. Is this the information I should expect to see in the contribution record, or should a payment be referenced?  In particular, I'm wondering about the "no payments found" line. I am aware of the issue affecting the creation of civicrm\_financial\_item records (Recurring iATS contributions not creating civicrm\_finanical\_item records ) and I would anticipate they will need to update the extension sooner rather than later, but I'm not clear on what I *should* be seeing here. Thanks in advance.

# Answer
Please note that 1.5.3 (see XML file) is not compatible with CiviCRM 4.7.x; you must upgrade to the 1.6.x series.

PS - the issue you're referencing is re: 4.6 (completetransaction API does not create Financial transactions); for the 4.7 version we are able to use repeattransaction API - which does create Financial transactions.

PS2 - after updating to the 1.6.x you will be seeing payment information there (CiviCRM core recently has also added last 4digits of cc - in addition to $amount, financial type(s) payment instrument id.
> 2 votes

---
Tags: civicontribute, iats
---


# Question
Title: What's the problem with this state province crash?
I migrated at the weekend from 4.6.22 to 4.7.19 and all went smoothly. But now users get the following problem when updating a contact's address. They get 'Unable to reach network' but looking in ConfigandLog I see this line prior to the fatal error: /home/rsvpadmi/public\_html/sites/all/modules/civicrm/CRM/Utils/Geocode/Google.php(87): CRM\_Core\_DAO::getFieldValue("CRM\_Core\_DAO\_StateProvince", "null")

I 'fixed' the problem by switching off Google maps in 'Mapping and Geocoding'. In fact, maps were being displayed OK but users just couldn't update an address. Anyone have any clues as to what the problem is?

# Answer
> 2 votes
This sounds consistent with hitting a rate limit in Google Maps API.

If so, the fix would be to disable geocoding (as you've done) or to configure a valid API key associated with payment details so Google can bill you for geocoding.

I recently observed similar behaviour when a client was viewing large numbers of contacts in a proximity smart group - possibly this triggered a mass lookup of contacts who lacked geographic co-ordinates.

Your CiviCRM debug log may have more information.

---
Tags: error, 4.7, geocoding, google
---


# Question
Title: Supplemental address should be searchable
I want the supplemental address fields to be searchable under at least "advanced search". Right now the text entered in "supplemental address" can never be used for searching and retrieving. how do i go about it?

# Answer
It does sound like a reasonable feature request, and the good news is that it's already been implemented.

The pull request was merged in March, so any version of CiviCRM from 4.7.18 upwards should include it in the advanced search criteria.

I checked locally and here's a screenshot of the changed address fields in advanced search:
> 3 votes

---
Tags: search, search-results, addresses, custom-search, search-builder
---


# Question
Title: Case dashlets - what do they show and how can I edit them?
The CiviCase component includes two default "dashlets" that the user can place on their CiviCRM dashboard: 'My cases' and 'All cases'. It looks like these dashlets are showing only cases with upcoming scheduled activities. The documentation indicates that an upcoming window of 14 days is used for the main Case Dashboard displays, so I'm guessing that the same parameter applies for these dashlets.

How can I edit the configuration of these dashlets? I can't find any UI for this task, and so far I've not been able to identify any of the pre-existing report templates that can generate anything that looks like these dashlets.

# Answer
> 3 votes
Graham, you can not really configure these dashlets, they are not based on existing CiviCRM reports but code specifically. We have just created a fair number of CiviCase reports (working on one as we speak :-), you would probably have to create/get someone to create a custom version of the dashlets or possibly even a custom report if it would make sense.

# Answer
> 0 votes
has anybody been able to edit the code for the 'My Cases' dashlet?

It is confusing for users who expect it to show their cases, but it is looking at the ones with scheduled activity only.

I have created a separate report for this, but the 'My cases' dashlet still shows up in the dashboard configuration.

---
Tags: civicase, dashboard, dashlet
---


# Question
Title: How to fix this JSON Error with Joomla 3.7, CiviCRM 4.7.19, PHP 7.1?
To evaluate CiviCRM, I've installed CiviCRM 4.6.26/Joomla 3.6.5, subsequently upgraded to CiviCRM 4.7.19/Joomla 3.7 site that is running PHP 7.1.

The backend 4.7.19/3.7 install appears to work fine, but when I define a CiviCRM Dashboard or anything else as a front-end menu option, I get

```
RuntimeException: Error decoding JSON data:
Syntax error in /home/hillcresttm/public_html/libraries/vendor/joomla/registry/src/Format/Json.php:72 Stack trace:
#0 /home/hillcresttm/public_html/libraries/vendor/joomla/registry/src/Registry.php(366):
  Joomla\Registry\Format\Json->stringToObject('{"menu_image":"...', Array)
#1 /home/hillcresttm/public_html/libraries/vendor/joomla/registry/src/Registry.php(72):
  Joomla\Registry\Registry->loadString('{"menu_image":"...')
#.............

```

Various Joomla support forums indicate that message is likely a problem with JSON data that is not valid. In Joomla versions prior to 3.6.3 (October, 2016) this failed silently, but since 3.6.3, it generates an error.

I've cleared/disabled my Joomla caching with no change in the error. I found a CiviCRM item on cache, but the directory structure did not match my installation.

Any suggestions for how to proceed?

Bruce

# Answer
As of May 2017, I'd say PHP 7.1 / CiviCRM combination is probably not ready for production use - I tried it the other day and ran into some errors. If you need to run CiviCRM in production, I'd switch down to PHP 7.0.x or 5.6.x.

You might be able to get it to behave with some other configuration changes or by being more actively engaged in CiviCRM development, but for a production site I'd recommend shifting down to 7.0.x.
> 1 votes

# Answer
Did you try emptying the Civi cache at ~/media/civicrm/templates\_c/en\_us? Then refresh the browser.

Also, what is your PHP memory limit set at? Try 128mb.

I've the same install without those issues. What OS?
> 0 votes

# Answer
You must disable JB Library plugin
> -1 votes

---
Tags: joomla
---


# Question
Title: Integrating QR codes for event attendance
Would like to check-in event participants using a QR code that will also update the attendance status of the participant. Is there an extension available for this feature? Any help is appreciated...thanks

# Answer
We have built such a solution, though no extension is available.

The key is that the QR Code simply needs to contain a URL request, with embedded querystring parameters such as event\_id and participant\_id. Pretty much any stock QR scanning app will recognize it as a URL, and will simply pass it on to the device's browser.

We wrote a simple PHP program that was called in the URL, that grabbed the querystring parameters (event\_id and contact\_id in our case), and called the CiviCRM API to change the participant status to 'Attended'.

Our app also returned a screen back to the device browser that reflected add-ons that the participant had purchased (lunches in our case).

This does have a bit of a security risk. We got around this risk, by having a separate URL the device browser would be directed to that the user could log into and have a cookie dropped onto their device (which was then subsequently interrogated by the main PHP script to validate).
> 4 votes

# Answer
We created an event app for one of our clients which enables the participant status to be updated via a QR code. More info here: https://vedaconsulting.co.uk/event-manager-app

Do send us an email if you have any further questions info@vedaconsulting.co.uk

Many thanks

Daniella
> 3 votes

# Answer
I don't think it exists already but I do know Circle Interactive have worked with barcodes and QR codes in a few previous projects: - https://civicrm.org/blog/andyw/bitcoin-payment-processing-with-bitpay
> 2 votes

---
Tags: civievent, extension
---


# Question
Title: Is there a way to make some events a sub-category for another event?
I'm trying to figure out how to categorize some events under a sort of "mother" event so that you can only register for the child events if you have registered for the mother event. Is this possible?

Thanks!

# Answer
Take a look at this extension: https://civicrm.org/extensions/event-additional-signup

This will register users for additional events automatically when they select specific price set options.
> 3 votes

# Answer
Check out this extension: https://civicrm.org/extensions/event-additional-signup

And then you can also find good answers here: CiviEvent with Sub-events and Conference Slots - how to....?
> 1 votes

---
Tags: civievent
---


# Question
Title: Best Practise for recording thank you letter.I don't have email addresses
On contribution page, what is the best practice for recording "thank you" letters that have been sent, if they are physical letters (snail mail), right now it only shows thank you letters if they are sent via email and if the person has an email address

# Answer
You can add a custom Activity Type and then record such an Activity when you send out a snail mail. You can also use the existing Print/Merge Document activity and generate the PDF via the Activity and hence record it at the same time.
> 1 votes

---
Tags: civicontribute, contributions, contribution-page
---


# Question
Title: Is there a way to create an an automatic email if someone is removed from a group?
I looked at scheduled activities hoping I could use that but alas it doesn't seem like it.

I could create a database trigger but that's a bit work.

# Answer
I think this should be possible with using the CiviRules extension.
> 6 votes

---
Tags: email, groups, activity
---


title: Contribution Summary throws 500 error

text:
# Question
Title: Contribution Summary throws 500 error
> Uncaught Error: \[\] operator not supported for strings in /wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Summary.php:580

Don't know whether this started with Civi 4.7.19, WP 4.8, or something else -- but now I get this 500 error whenever I try to run a Contribution Summary (Reports / Contribution Reports).

Other Civi summary reports (e.g. Constituent Summary, Event Participants List) run as expected. Other Civi Contribution reports also run as expected. It seems Contribution Summary is our only misbehaving report.

I've disabled all plugins other than CiviCRM and activated Twenty Seventeen theme, but that doesn't stop the 500 error.

> Stack trace: \[13-Jun-2017 08:57:17 America/New\_York\] PHP Fatal error: Uncaught Error: \[\] operator not supported for strings in /wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Summary.php:580 Jun 13, 12:53:49 PHP Warning: Failed to send an email, wp\_mail() returned FALSE in /wp-content/plugins/error-log-monitor/Elm/Plugin.php on line 200 5 \[REDACTED\] in /wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Summary.php on line 580 4 /wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Submit.php(74): CRM\_Core\_Form-\>mainProcess() 3 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(447): CRM\_Report\_Form\_Contribute\_Summary-\>postProcess() 2 /wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Summary.php(756): CRM\_Report\_Form-\>postProcess() 1 /wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3249): CRM\_Report\_Form-\>buildQuery() 0 /wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(2626): CRM\_Report\_Form\_Contribute\_Summary-\>groupBy()

It is possible we've had this problem since well before the current Civi and WordPress iterations were released/installed, but hadn't noticed it before because we're still somewhat new to Civi.

I activated debugging and backtracing, but no error info displayed when running Contribution Summary.

I assume Contribution Summary is working fine for everyone else. What should I try next?

# Answer
This appears to be identical to CRM-20558. Upgrading to 4.7.20 or applying the fix there should solve your problem. Note that CiviCRM is not tested against PHP 7.1, so you may want to consider using PHP 7.0 instead.
> 2 votes

---
Tags: civireport, reports, 500
---


# Question
Title: DataTables warning with dedupe on find & merge (after upgrade to 4.7.18)
Is anyone else seeing a new DataTables warning in 4.7.18? We get the following warning on the dedupe page when finding duplicate contacts:

**\[Server Name\] says:**

> DataTables warning: table id=dupePairs - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3\**

(Joomla version 3.6.5, php 5.6.30, mysql 5.6.36) Thanks.

# Answer
There's a fix for this issue in https://github.com/civicrm/civicrm-core/pull/10503. Hope this will be included in 4.7.21.
> 1 votes

---
Tags: javascript, duplicate-contacts, datatables
---


# Question
Title: Remove display of location field in Current and Upcoming Events view - Joomla
We are using CiviCRM 4.6.28 on current Joomla version. As we are using the training location in the title already we would like to remove the display of the location column as it is irritating if it shows (not available).

Is there any way of removing this without hindering further updates?

# Answer
You haven't said which page you are referring to but I'm guessing that this is the public HTML listing of events. If so, the output is controlled by this template: `<civicrm root>/templates/CRM/Event/Page/ICalendar.tpl`

You can copy this to create a custom template and edit it to remove the location column.

Read more about customising templates here: Page Templates
> 1 votes

---
Tags: civievent, joomla
---


# Question
Title: 4.7.20 upgrade -- missing indices warning, but index already exists?
Upgraded to 4.7.20 today. As others on this thread have experienced in earlier release(s), I promptly got the "missing indices on some tables" warning. Of course, I tried the "Update Indices" button, and of course, all it gave me was a spinning logo for about two seconds followed by no change in status.

Looking at my error log, this jumped out at me:

> wp-content/plugins/civicrm/civicrm/packages/DB.php(984): PEAR\_Error-\>\__construct("DB Error: already exists", -5, 16, (Array:2), "CREATE UNIQUE INDEX UI\_case\_contact\_id ON civicrm\_case\_contact (case\_id, cont...")

So I opened phpMyAdmin, and sure enough, the UI\_case\_contact\_id index does in fact exist on the civicrm\_case\_contact table. Which makes me wonder if I'm getting a missing indices warning because the system "perceives" incorrectly that there's no UI\_case\_contact\_id index when in fact there already is.

Since I know just enough about Civi's database structure to be dangerous (but not nearly enough to competently fix anything that can go wrong with it), might anyone please enlighten me?

# Answer
> 5 votes
This thread helped me:

How to find and/or fix missing indices?

I've aggregated the SQL listed there below, copy it and run it via phpMyAdmin:

```
ALTER TABLE civicrm_prevnext_cache DROP INDEX index_all;

ALTER TABLE civicrm_option_value DROP FOREIGN KEY FK_civicrm_option_value_option_group_id;

ALTER TABLE civicrm_option_value DROP INDEX index_option_group_id_name;

ALTER TABLE civicrm_entity_tag DROP INDEX UI_entity_id_entity_table_tag_id;

ALTER TABLE civicrm_case_contact DROP FOREIGN KEY FK_civicrm_case_contact_contact_id;

ALTER TABLE civicrm_case_contact DROP FOREIGN KEY FK_civicrm_case_contact_case_id;

ALTER TABLE civicrm_case_contact DROP INDEX UI_case_contact_id;

```

then click on the **Update Indices** button. Then go back to phpMyAdmin and run these SQL commands:

```
ALTER TABLE civicrm_option_value ADD CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`) ON DELETE CASCADE;

ALTER TABLE civicrm_case_contact ADD CONSTRAINT FK_civicrm_case_contact_contact_id FOREIGN KEY (contact_id) REFERENCES civicrm_contact (id) ON DELETE CASCADE;

ALTER TABLE civicrm_case_contact ADD CONSTRAINT FK_civicrm_case_contact_case_id FOREIGN KEY (case_id) REFERENCES civicrm_case (id) ON DELETE CASCADE;

```

I had this issue moving from 4.7.18 to 4.7.20. Not sure why this wasn't an issue before, I'm guessing its because I don't use the CASE module on my site.

---
Tags: database, upgrade, missing
---


# Question
Title: How can i show a Drupal block on a specific civi path that contains a question mark
Title says it all really. Drupal Blocks don't work with paths that contain question marks

# Answer
The Drupal module Block Query pretty well nails it, and there is an explanation about using it with civicrm here
> 2 votes

---
Tags: drupal
---


# Question
Title: Using custom fields to store secondary addresses
As of now only primary address of a contact is searchable in advanced search. Search is not possible for other addresses of the same contact. So I want the other addresses of contact also searchable. Can I use custom fields for other addresses apart from primary?

What are the problems that can come up because of this approach ?

# Answer
In the advanced search under the "Address Fields" you can choose "Address Location" which defaults to primary only. By selecting all of them you can search by any address type.

I tested searching for a non-primary "personal" address and the results showed the contact.

It might be something that could be made clearer, because I found a similar thread on it here.
> 1 votes

---
Tags: custom-fields, search, search-results, addresses, search-builder
---


# Question
Title: new feature? - all addresses needs to be searchable
In the latest releases of civicrm 4.7.18 onwards ,we can see the supplemental fields are searchable which is a very good feature.

However, one can have multiple addresses and civicrm allows to add multiple addresses to an individual. But, the searching and retrieving is possible only with the primary location for the contact. Searching is not possible for the other addresses. I would like it to happen in future releases.

# Answer
In the advanced search under the "Address Fields" you can choose "Address Location" which defaults to primary only. By selecting all of them you can search by any address type. answer taken from this thread Using custom fields to store secondary addresses
> 3 votes

---
Tags: search, search-results, addresses, custom-search, search-builder
---


# Question
Title: Disable check that a web browser has already signed a petition?
Many of our subscribers have informed us of the problem that they sign our petition, and then when other household members go to sign the same petition (e.g. particularly grandparents who don't have their own computer) they are unable to. I understand that clearing the cookie cache of the browser and thereby killing the sessionid or else opening a private window would be a work-a-round, but I'd like to just not have the problem. Can anyone point me to which file in the source code performs this check? And, as an aside, what do DAO and BAO mean? How civicrm works is really a mystery to me...

# Answer
The code in question is in `<civiroot>/CRM/Campaign/Form/Petition/Signature.php`. You're looking for the redirectIfSigned method, most likely.
> 4 votes

# Answer
What CMS are you using? If Drupal you could do a webform for your petition which would have all of the basic functionality of Civi petitions plus a lot more configurability. It would definitely let you change this setting.
> 4 votes

---
Tags: civipetiton
---


# Question
Title: "Could not copy Mosaico Template' in 4.7.20
I upgraded to 4.7.20 and am now unable to copy Mosaico templates. I also get strange behaviour when I try to edit a template. On clicking 'edit' CiviCRM displays 'Configure your Dashboard' and displays a Chrome print dialog box. Is anyone else seeing the same behaviour?

# Answer
> 1 votes
This issue is resolved by upgrading to Mosaico Version 2.0 beta2.

---
Tags: civimail, mosaico
---


# Question
Title: noob query : Importing contacts and membership
I am going to freshly import data from excel into civiCRM. I have some contact related information like addresses, educational info, etc and also membership data like membership date, enrolled by whom, member center etc.

what are all my possibilities and their pros/cons?

1. Upload contact info in a separate excel and then should I upload membership info in a separate excel with the unique ID mentioned in membership excel?
2. upload both contact and membership together (if possible)?
3. Any other methods?

# Answer
Contact records must exist before you import membership data. If you want to import membership data for contacts that do not yet exist in CiviCRM, you will first need to import the Contact data. Make sure the contact data has an External ID so you can include this External ID with your membership data to associate these records with the related contacts. If you are importing membership data for contacts that already exist, then you will need the Internal Contact ID or the fields from your Unsupervised Duplicate Matching Rule to associate the related membership data with the correct contact.

Your import membership data file MUST contain both Membership Type and Start Date. The membership types listed must exactly match the membership types set up by your CiviCRM Administrator. The start date should use the date format specified for your CiviCRM installation. If your import file does not contain these fields then you will not be able to import it.

You must import membership data for different contact types separately. Importing files with more than one contact type will not work. (You must import new memberships and renewals separately also.)

https://docs.civicrm.org/user/en/4.7/membership/manual-entry-of-memberships/
> 3 votes

---
Tags: civimember, contacts, import, duplicate-contacts
---


# Question
Title: How is a draft removed since looks like only option is continued
How to remove more than 1 draft since only option appears to be "continued"?

# Answer
You haven't given much information but I assume you are refering to bulk emails under civimail. After creating a draft bulk email, there is the option to continue with it or delete it. Look under Mailings\>Draft and unscheduled mailings\>Action column, where you will see a 'Delete' option.

Hope this helps.
> 1 votes

---
Tags: email
---


# Question
Title: Where is the CiviCRM UI styleguide / reference?
I am writing an extension and I would like to know the best way to implement form elements, etc. in the most concise and future proof way.

My approach until now has been just to copy from another screen that I consider to look fairly nice, but now that we have projects like https://civicrm.org/extensions/shoreditch in the works, I'd like to future proof my work and would love it if we could start to coalesce around a set of fairly high level rules.

I confess that I haven't yet installed https://github.com/civicrm/org.civicrm.shoreditch or https://github.com/civicrm/org.civicrm.styleguide/ which I suspect may well answer this question. If it does, I have another question: is it possible to write an extension that will look good using our pre-shoreditch theme and the shoreditch theme? Or is the pragmatic approach to just try and make things look nice with Shoreditch?

# Answer
> 3 votes
This was covered during CiviCon St. Louis. I'll try to sum up.

* There's no way to write an extension that works with both pre-Shoreditch and post-Shoreditch conventions.
* However, it will be a fairly common site in Civi for some time to come to have extensions that implement Shoreditch operating inside of pages that don't. Mosaico is a good example of this.
* Shoreditch is just one implementation of a Civi theme - the future may hold others. However, for practical purposes I think we can assume there aren't any others coming for a while.

So your options are to either a) ignore all this and do things the old way, or b) implement the Shoreditch theme and make it clear that it's a "dependency" in the docs (until we get for-real dependency management for extensions).

# Answer
> 3 votes
So, Shoreditch is a Bootstrap based theme, and as such if you want to use it in your extension, you need to have your extension's markup comply to the Bootstrap markup convention (documented in the Bootstrap site).

Given that that convention is different than the one used by "vanilla" CiviCRM, you can't really have your extension look the same with and without Shoreditch, unless maybe if you plan to use the `custom-civicrm.css` file.

`custom-civicrm.css` is a file that Shoreditch provides that, when used as the value for the "Custom CSS url" field in *civicrm/admin/setting/url*, will attempt to make all the screens using the old convention (including core ones) look as if they were Bootstrap based. In theory then if you used it you could write your extension using the old convention and having it look good both in a non-shoreditch and in the shoreditch theme.

I'd suggest against it though for a couple of reasons:

1. The file is far from being finalized and the end result might not look as good as one would hope in certain areas
2. One of the reasons for developing Shoreditch is to push CiviCRM to migrate gradually to Bootstrap, so writing your extension with the old markup convention while still planning to have it work alongside Shoreditch would not align with that goal.

So I'd agree with Jon G that if you want to use Shoreditch, you should then go all the way and write your extension with the Bootstrap markup

There's a big caveat though and a disclaimer I need to give: Shoreditch is still in an alpha stage of (internal) development and as such I would not recommend using it for production, as many things could still be changed in the meantime (style and implementation wise) and break things downstream

Hope this was helpful! Alessandro

---
Tags: ui
---


# Question
Title: 4.7 Utils/Mail.php doesn't check if CC/BCC are null but should
Acc'ding to Civi documentation, PEAR packages needed by Civi are included w/the install, so the mailer functionality is determined by Civi. I am running Civi for WP v 4.7.20 with PHP 5.6.16 and Apache 2.4 System mail setting is mail() - the mail 'test' works because only 'from','to','subject' and 'message' are set. But system mail (e.g. registration mail or ad hoc mail sent to event participant) fails.

# Answer
> 1 votes
Solution: replace current lines in Utils/Mail.php where no check for null CC, BCC is made, with the following (line 194 +) from older version of Mail.php:

```
if (CRM_Utils_Array::value('cc', $params) != NULL){
  $headers['Cc'] = CRM_Utils_Array::value('cc', $params);
}
if (CRM_Utils_Array::value('bcc', $params) != NULL){
  $headers['Bcc'] = CRM_Utils_Array::value('bcc', $params);
}

```

I don't know why the code was changed to not check for null. It seems it doesn't hurt to check, and if null CC/BCC are put into headers, mail() fails.

---
Tags: email
---


title: Google Map not displaying on new events

text:
# Question
Title: Google Map not displaying on new events
I have just upgraded our CiviCRM install to 4.7.13. When creating a new event and selecting all relevant options, the Google Map is not displayed. This IS displayed when viewing other active and older events.

We have been using a custom .tpl file, but even after disabling the tpl and clearing the cache(s) we are still facing the same issue.

Any ideas what might be going on here?

For testing we are using the same stored address. The existing, pre-upgrade event has the following values:

```
{$event.is_map} = 1
{$config->mapProvider} = Google
{$location.address.1.geo_code_1} = 56.0797664
{$location.address.1.city} = Dunfermline
{$location.address.1.state_province} = NULL

```

The map is displayed.

A new event, post-upgrade, with exactly the same settings has the following:

```
{$event.is_map} = 1
{$config->mapProvider} = Google
{$location.address.1.geo_code_1} = NULL
{$location.address.1.city} = Dunfermline
{$location.address.1.state_province} = NULL

```

The map is missing.

When we open the location information on the old event and save, the map fails to work ?!

# Answer
> 2 votes
I have also seen this problem, and fixed it. It's nothing to do with CiviCRM at all - it's a recent change made by Google regarding their API and your authorisation to use it. Existing users seem to be OK, but new users (ie. one of my clients) or maybe even new maps seem to be affected. You should review your authorisation to use the Google API for your domain. It's a slightly confusing situation because it appears that you don't need to enter your API key on Civi anymore, but you do need to be authorised by Google.

# Answer
> 0 votes
Same problem here with a 4.7.12. I workarounded marking `Override automatic geocoding` and setting `latitud` and `longitud` coordinates manually.

---
Tags: civievent, location, map
---


# Question
Title: External Email from Newsletter Mailing Fails
I have set the Outbound mailer to mail(), SMTP seems to really be problematic.

I am successful in the following: Contacts | New eMail Administer | Settings - Outbound Mail | Save & Send Test email

All go into the inbox of the intended external email address.

From Joomla, all the email functionality is working as well.

I am unsuccessful in being able to send a newsletter from the Mailings | Draft Unscheduled Mailings area,

I get a generic message, Error in call to Mailing\_send\_test : sendmail returned error code 1

This only happens if I send it to an outbound email (email addresses within the hosting provider work)

Any ideas would be greatly appreciated.

# Answer
If you're still interested - what version of Civi are you running? And you have selected PHP mail() as your mailer so it is odd that sendmail is referenced in the error msg. I can just say that I have Civi 4.7.20 (for WP though I think that isn't relevant). System outbound mail is set to mail(). I only got email to work by adding back check for blank CC/BCC that was in older versions of CRM/Utils/Mail.php 'Save and send test email' works b/c it doesn't go to Utils/Mail it just instantiates its own PEAR Mailer and sends a header with just 'to','from''subject' and 'message'
> 1 votes

---
Tags: civimail
---


title: questions on External ID

text:
# Question
Title: questions on External ID
1. Is External ID Unique? will it automatically check for a duplicate External ID when the attempt is made to enter into database?
2. Can External ID be auto incremented whenever an individual gets added?

# Answer
The External ID (`external_identifier`) is maintained in the database with a unique index, so any attempt to enter a duplicate value will take an error.

The `external_identifier` itself is simply a variable character string of 64 char in length (`varchar(64)`). As such it cannot auto-increment.

Remember, the `external_identifier` is designed to contain an identifier of the contact that might originate in a separate system. In practice, it is most common to use it when migrating from some other CRM system into CiviCRM, wherein the other systems identifier is stored in the External ID. This can be invaluable for audit purposes.

If you are looking for an auto-incremented identifier, you should consider using the `contact_id`.
> 4 votes

---
Tags: contacts, database, external-id
---


# Question
Title: Why CiviCRM is not in wordpress.org/plugins/?
Why CiviCRM is not in Plugins.wordpress.org? See https://wordpress.org/plugins/search.php?q=civicrm . There are 9 plugins, but not civicrm.

# Answer
> 1 votes
CiviCRM is not a conventional plugin like installing other wordpress plugins and requires a lot more work. You can view installation instructions for wordpress platforms at https://wiki.civicrm.org/confluence/display/CRMDOC/Installing+CiviCRM+for+WordPress

---
Tags: wordpress
---


title: Problem with links & base page

text:
# Question
Title: Problem with links & base page
I have Civicrm 4.7.20 installed on Wordpress 4.8.

When I create a new event or contribution the link that Civicrm creates does not work. What Civicrm creates as a link: http://\[mysite\]/?page=CiviCRM&q=civicrm/event/register&reset=1&id=7 This link loads my Civicrm base page, in this case my home page. If I change the base page to a different page then that page is loaded.

This link works: http://\[mysite\]/?page=CiviCRM&q=civicrm/event/info1&reset=1&id=7&page\_id=1811

Note the &page\_id=1811 parameter

As long as I specify the parameter &page\_id=\[any valid page\] the link works, if I don't specify then the link loads the base page.

I tried disabling all other plugins and nothing changed so I think it has to be a Wordpress or Civicrm setting problem.

# Answer
do you have Permalinks 'plain' enabled (in WP Dashboard/Settings)? Or do you have custom? I don't know if that makes a difference but it relates to how URLs are constructed. I switched between plain and custom Permalinks. And in civicrm Wordpress Integration how did you configure your 'base' page? I used the postname of my WP base page (ie, just 'civicrm') and it seems to work, civicrm event pages show. Does your .htaccess file have URL rewriting enabled (begins like "# BEGIN WordPress RewriteEngine On.."
In the URL for, say, an event I get "page=CiviCRM&q=civicrm%2Fevent%2Finfo&id=1870&reset=1" where &id=1870 is the registration form for an event I created. I am using 4.7.20 and WP 4.8 also
> 0 votes

---
Tags: links, base-page
---


title: Files directory empty

text:
# Question
Title: Files directory empty
I recently installed Civi on WordPress 4.8. Upon wanting to manually upload an extension to the extension directory, I saw that the "files" directory is empty.

In the installation guide it said to create a files folder within /plugins/files.

I see the resource URL for extensions is where this should be. I've not seen this happen on other installs of mine, so wondering if others have seen this.

Also, I have downloaded the native extensions and they are working; where are those located?

# Answer
You can find where extensions are located by looking under

Administer\>System Settings\>Directories

The entry most likely has path variable such as \[civicrm.files\]. To find this location click on the "?" next to the following line in the info box on the top of the screen.

"You may configure these upload directories using absolute paths or path variables."

If you have installed Version 4.7 of CiviCRM the path to the extension folder is most likely: \[wordpress folder\]/wp-content/uploads/civicrm/ext
> 1 votes

---
Tags: wordpress, extension, filesystem
---


# Question
Title: Hide Cividiscount box from specific contribution page
When you apply a discount to a membership type any contribution page with this membership type shows the discount box. Is there a way to hide the box on particular contribution pages or make discounts admin only I.e only admins can apply a discount? This ways not all members are shown this option and only specific ones can tagged with a discount.

# Answer
> 1 votes
There are a few options to make it so only Admins can apply discounts.

1. Create a price set for memberships and add a text/numeric quantity field called 'Discount', set the value to $-1.00 and set the visibility to 'Admin'. With this option you can apply custom discounts when entering memberships via the admin panel without using a CiviDiscount Code. The special field for discounts will only be visible to logged in admins.
2. If you are comfortable with some coding you can use jQuery to hide the CiviDiscount form section from the contribution page template via a custom template. Keep in mind this will hide the CiviDiscount form from all contribution pages.

Hope this helps

---
Tags: civicontribute, cividiscount
---


title: Approve member before payment

text:
# Question
Title: Approve member before payment
I need members to be approved by admin before they pay their membership. How do i do this?

I have setup membership levels and created the contribution page but I can not find any option for approve member before payment process. Do I need to create a free member and approve them? but then how do the system sends payment after I approve them? Do you know if there is anything that I can setup to do that?

# Answer
You can proceed with the below steps -

1. Create a pay later contribution page for membership.
2. Let user register for membership using pay later. So Each Membership here would have a pending status.
3. Create a searchable custom field for Contribution Eg `Approved?` with `Yes No` Field values.
4. Set this to `yes` on editing contribution record for those you want to approve.

Completing the Pending Payment (If you're using above 4.7 version)-

1. Navigate to Administer -\> CiviContribute -\> CiviContribute Component Settings (civicrm/admin/setting/preferences/contribute?reset=1).
2. Check `Enable Deferred Revenue` option and set the `Default invoice payment page`. Record its page id(you can find it in `Manage Contribution Pages` where ids are shown for all of them).
3. From `Find Contribution` search for all whose Approved field is set to `yes`.
4. Select an action to send them an email mentioning the following URL.

```
http://<site_name>/civicrm/contribute/transact?reset=1&id={page_id_from_step_2}&ccid={contribution_id_token}

```
5. Using this url, users will be able to complete their payment and `Pending` Membership would be updated to `New`.
> 1 votes

---
Tags: civicontribute, civimember, webform-civicrm, payment-processor
---


# Question
Title: Howto import CAMT053 XML with CiviBanking
Is somebody importing CAMT053 XML from ING or another bank?

We want to import bank statements from ING, a Dutch bank. ING can export to CSV, but that export does not contain postal adresses. The CAMT053 XML does.

# Answer
Maybe you can try the Belgian format. See https://github.com/Project60/org.project60.banking/blob/6dd79b42941eea6e89ba8e8b6475af418fddb2ad/configuration\_database/importer/xml/BE\_CAMT53\_v2.json . Some discussion about this file can be found at https://github.com/Project60/org.project60.banking/issues/132 .
> 0 votes

---
Tags: import
---


# Question
Title: want to change search algorithm in custom fields
Suppose I have phone number having format as (xxx)xxx-xxxx.Is their anything in search so that I can simply search with this format which excludes brackets and characters like xxxxxxxxxx.

# Answer
> 0 votes
For standard phone number fields, that is taken care of:

* In Advanced Search, the help text shows "Punctuation and spaces are ignored." Formatting entered in the search is ignored and the search is done on just the digits.
* In Quick Search, enter just the digits of the phone number.

But your title mentions custom fields... Does that mean you have an alphanumeric custom field to store a phone number? Instead of that, can you use the standard phone numbers with a different 'location'? You can customise the list of locations at `Administer > Customize Data and Screens > Dropdown Options > Location Types`

---
Tags: search, search-results, quicksearch
---


# Question
Title: Custom Fields are not showing when trying to import a CSV
I have created some custom fields. I am trying to import contacts with values for those fields. But the fields are not showing up during the step 2 "matching civicrm field" though other custom fields that I have created shows up, this one particular doesn't show up. I have allowed multiple records for this one custom field set alone. Is that because of this?

On further testing, when I disallowed multiple records for this set, it shows up in the matching options. Is this a bug?

# Answer
Multi-value custom fields need to be imported separately using https://yoursite/civicrm/import/custom?reset=1

To find that link, go to the normal contact import screen `Contacts > Import Contacts`, click the help icon at the end of the helptext, then follow the link at the end of the pop-up help.
> 3 votes

---
Tags: custom-fields, import, data-import
---


# Question
Title: How to fix receipt/confirmation attached PDF alignment in email?
Civicrm email receipt/confirmation attach PDF files alignment issue.

We facing alignment issue in attached PDF file, Left side margin high and it is creating empty pages.

Which file needs to edit for this issue?

# Answer
> 1 votes
Maybe set up the default PDF form (Administer Communications PDF Format, ?page=CiviCRM&q=civicrm%2Fadmin%2FpdfFormats&reset=1) which allows you to define margins

---
Tags: civimail, pdf
---


title: Transitive relationships

text:
# Question
Title: Transitive relationships
Does anyone know a way to find transitive relationships in civicrm?

Something like: ContactA is related to ContactB ContactB is related to ContactC

So ContactA is related to ContactC

# Answer
Best approach for a Drupal based CiviCRM would be using Views which is a Drupal module, then you can build up search/displays that will daisy-chain the relationships the way you describe.
> 1 votes

---
Tags: relationships
---


title: Can I see (smart) group relations?

text:
# Question
Title: Can I see (smart) group relations?
Is there a way in which I can easily see how the smart groups are related (as in **include / exclude** search)?

When I try to build a group which selects the contacts I need, I often combine multiple smart groups to arrive to necessary results. It would be very convenient to see how they are related. Is there an easy way to tell, if a particular group is used in some other group (so that it could be modified or deleted without worry)? Or should I check all other groups to make sure that none of them actually uses the group I am about to delete/modify?

# Answer
Smartgroup criteria are stored using the SavedSearch api. Use the API explorer (`/civicrm/api#explorer`) and select entity: `SavedSearch` action: `get`

In each of the `values` returned, there is a `form_values` key with a list of components that define the search. The list varies depending on how the search was created.

If you look at one created from an include/exclude search, then it contains components like:

```
        [
            "excludeGroups",
            "IN",
            [
                "4"
            ],
            "0",
            "0"
        ],

```

Without checking the details of each of those parameters, it's very likely that group\_id 4 is involved in this query.

Likewise for an example created from Advanced Search:

```
           [
            "group",
            "=",
            {
                "IN": [
                    "5"
                ]
            },
            "0",
            "0"
        ],

```

So group\_id 5 is involved in this.

A smart group is linked to a SavedSearch by the `saved_search_id` attribute - in API Explorer, set entity to `Group`, action to `get` and look for `saved_search_id`

If you just want to understand which groups depend on others, then visual inspection of the `SavedSearch.get` output might be enough.

Expanding this into an extension to show those dependencies would be nice, but tricky since the components of the `form_values` list depends on how the search was created. You would need to experiment with the various ways of creating smart groups to identify all the syntaxes that relate to groups but even then, custom searches define their own definitions (as include/exclude does), so it would be easy to miss some giving incomplete results. In other words, it would be easier to say "This group does depend on this other group" rather then "This group does not depend on this other group".
> 1 votes

---
Tags: groups, smartgroups
---


# Question
Title: help needed in importing multi value custom fields
For the below custom fields, suppose a contact has two UG degrees B.Tech, BBA and two PG degrees M.Tech and MBA, I want to add additional set of custom field set, and then add the second degree. Like this I have 100 contacts, How to do through importing .csv file? ...

When I import I am able to only import the first set of degree, not the second one. I am configuring like the image in the second. However there should be some error in that. Not sure how to do it?

# Answer
> 3 votes
Not sure but I don't think you can import both the records in a single go. You might need to create two csv file with each value(B.Tech and BBA) of the custom field and import it one by one.

---
Tags: custom-fields, import, multi-record, data-import
---