title: Mailchimp & Groups

text:
# Question
Title: Mailchimp & Groups
I am testing out Mailchimp but want to keep the groups hidden from civicrm users. I tried smart groups but it will never remove the person from the group because that person still meets the search criteria of the smart group.

Are there any other options to have a "hidden" group to use for mailchimp?

# Answer
What we normally advise users to do is create a smart group on top of the base groups for Mailchimp Sync. This is mainly to protect the base smart group, for instance if you have a smart group of active members and you linked that to Mailchimp directly then when someone unsubscribes from the group they would be unsubscribing from the active members group, which isn't correct. So we would normally recommend creating a Newsletter - Active Members or something along those lines and sync that group to Mailchimp. This then has very little effect for both sides if someone does decide the unsubscribe etc and the need to hide the group should reduced.
> 1 votes

---
Tags: email, groups, smartgroups
---


# Question
Title: How do I hook into a contribution thank you page?
Big picture: I want to display some custom data on a thank you page for a specific contribution page. In my module I'm using hook\_civicrm\_preProcess. Like so:

```
   function custom_thankyou_civicrm_preProcess($formName, &$form) {

if ($formName == "CRM_Contribute_Form_ContributionPage_ThankYou" && ($form->getVar('_id') == 5)) {

// do stuff, like send my custom data to a smarty template.

} }

```

But here's the problem, my customized message doesn't show up on the thank you page for that contribution. It does however show up on the configuration screen for "Thank-you and Receipting" in the civi interface.

I guess it's not too surprising since the url for the config page is:

mycivicrmhost/index.php?q=civicrm/admin/contribute/thankyou&reset=1&action=update&id=5

and the url for the thank you page ends up being one like this:

mycivicrmhost/index.php?q=civicrm/contribute/transact&\_qf\_ThankYou\_display=1&qfKey=3ee9c31da51b3af9dbe8c8efa5765520\_1396

Is it possible to do this or should I set up an "external" thank you page instead?

Thank you

# Answer
> 1 votes
I would think that using a custom template would work, there is a thank you page template. If it is only one contribution page you're looking to add, some quick logic based on contribution page id would work. You can also try some custom behaviors with jQuery: https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates

# Answer
> 0 votes
I would expect that the Contribution Page does not trigger the postProcess hook as this operates on forms, not on pages. I would imagine you could use the pageRun hook though? I have not tried it....

# Answer
> 0 votes
The best way (I would recommend) to do is to create an own page of your own - and displaying the thank you page

Or overriding the thank you page from core into civicrm custom folder - that will solve the problem

# Answer
> 0 votes
You can customize the thank you page using custom template.

http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551

# Answer
> 0 votes
You can also customize the thank you page using custom template.

http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551

---
Tags: contribution-page, hooks
---


title: Content for Custom Tab

text:
# Question
Title: Content for Custom Tab
I'm working on a hook to display a users PCPs on a custom contact tab. We use PCPs extensively and it would be great to see any pages the contact owns inside their contact card. (Rather than having to pull up the full list of PCPs in a separate window. I also know that there's a link to PCPs in the soft credit section of the contribution tab - but that's only if there is a contribution to the page.)

I'm able to make a custom tab (using the tabset hook) but am struggling how to actually get content on to the tab.

```
// let's add a new "contribution" tab with a different name and put it last
// this is just a demo, in the real world, you would create a url which would
// return an html snippet etc.
$url = CRM_Utils_System::url( 'civicrm/contact/view/contribution',
                              "reset=1&snippet=1&force=1&cid=$contactID" );
// $url should return in 4.4 and prior an HTML snippet e.g. '<div><p>....';
// in 4.5 and higher this needs to be encoded in json. E.g. json_encode(array('content' => <html form snippet as previously provided>));
// or CRM_Core_Page_AJAX::returnJsonResponse($content) where $content is the html code
// in the first cases you need to echo the return and then exit, if you use CRM_Core_Page method you do not need to worry about this.
$tabs[] = array( 'id'    => 'mySupercoolTab',
                 'url'   => $url,
                 'title' => 'Contribution Tab Renamed',
                 'weight' => 300 );

```

But I don't know what to set my own url to AND get content on it. I'm in Wordpress 4.3.1 and Civi 4.6.4. Suggestions?

# Answer
> 1 votes
The custom tab contains whatever's at the URL in the `url` parameter. You can test it out by simply linking to another page on your site.

Once you've confirmed that's working, you should generate a page with `civix generate:page`, and you can replace the `url` in your tab with that new page's URL.

---
Tags: hooks, pcp, contact-view
---


# Question
Title: Why am I getting this error when using CiviRules
I'm on D7, Civi 4.6.10, most recent version of civiRules, twilio sms extension.

I get the below errors when I add a rule as follows: 1. create new rule. 2. name: SMS Birthday, trigger: Individual has Birthday 3. add action: Send SMS, Delay action: by number of minutes 540 (my thinking is this will delay the text message till at least 8am) 4. Click Save and get the errors below:

```
Notice: Undefined index: ignore_condition_with_delay in CRM_Civirules_Form_RuleAction->postProcess() (line 88 of /home/web_location/civicrm_extensions/org.civicoop.civirules/CRM/Civirules/Form/RuleAction.php).
Strict warning: Declaration of CRM_Smsapi_CivirulesAction::alterApiParameters() should be compatible with CRM_CivirulesActions_Generic_Api::alterApiParameters($parameters, CRM_Civirules_TriggerData_TriggerData $triggerData) in require_once() (line 9 of /home/web_location/civicrm_extensions/org.civicoop.smsapi/CRM/Smsapi/CivirulesAction.php).

```

# Answer
This very likely has the same root cause as civirules issue #45. You may want to install CiviRules from master, or apply the change linked to above, or wait for version 1.2.
> 2 votes

---
Tags: error, civirules
---


# Question
Title: Initialization Error After Backing Up Wordpress
Earlier today I did a backup and restore on a Wordpress website. After the restore was successful, I noticed I could no longer access or edit my posts/pages in the Wordpress Dashboard. And I noticed CiviCRM throwing this error:

```
Initialization Error

Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => simpleHandler
)

[code] => -24
[message] => DB Error: connect failed
[mode] => 16
[debug_info] => [nativecode=Access denied for user 'user'@'localhost' (using password: YES)]
[type] => DB_Error
[user_info] => [nativecode=Access denied for user 'user'@'localhost' (using password: YES)]
[to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=Access denied for user 'user'@'localhost' (using password: YES)]"]
)

```

I've since tried reverting to the website instance that existed prior to the restore, when Civi was still working perfectly, and the same error still exists. I've disabled Civi and have regained the ability to edit posts/pages, but Civi remains broken.

# Answer
The failure you're seeing is because the MySQL credentials are no good. These are set in the civicrm.settings.php file. Did you possibly restore a backup that didn't include the civicrm.settings.php file that was in place when it was working?
> 3 votes

---
Tags: wordpress, error
---


# Question
Title: How do we move our civicrm SQL database from the cloud to our network?
We are running our CiviCSM system on a vendor's host with our database in the cloud. We have a CiviCSM system built for our network that is not currently in use, but we want to move the database from the cloud to our network. Can we Export/Import, Backup/Restore or Detach/Attach and which would work best?

# Answer
> 2 votes
If you have access to your server and database, and you want to move the whole installation this wiki page should provide all the information you need. If you only want to move the database, have a look at this page.

I am assuming you are talking about CiviCRM, not CiviCSM ;)

# Answer
> 1 votes
Ironically, this isn't a CiviCRM question but a MySQL question. MySQL is the database software that underpins CiviCRM. Moving a MySQL database can be done either using the command line (`mysqldump`) or via web interface (`phpMyAdmin`).

However, this is a fairly technical process, and I wouldn't recommend trying this without someone experienced! Fortunately, anyone with MySQL experience can help you, even if they've never seen CiviCRM before. Just have them read the links in Fabian's answer.

---
Tags: database
---


# Question
Title: Error "Could not find a valid session key." on contribution payment page in Wordpress CiviCRM
Got reports from some of the users about this error, which happens when submitting the contribution payment form. Because of this error many users are having issues with registration/payment. Haven't been able to reproduce it.

```
Sorry but we are not able to provide this at the moment.
We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site adminstrator for assistance.

Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.

Error type: Could not find a valid session key.

```

Here is the backtrace from the log files:

```
Oct 01 12:19:07  [info] $backTrace = #0 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(387): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(877): CRM_Core_Error::fatal("We can't load the requested web page. This page requires cookies to be enable...")
#2 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(891): CRM_Core_Controller->invalidKeyCommon()
#3 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/ContributionBase.php(229): CRM_Core_Controller->invalidKeyRedirect()
#4 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php(69): CRM_Contribute_Form_ContributionBase->preProcess()
#5 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(436): CRM_Contribute_Form_Contribution_Main->preProcess()
#6 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(93): CRM_Core_Form->buildForm()
#7 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_Contribution_Main), "display")
#8 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Main), "display")
#9 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("display")
#10 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(331): CRM_Core_Controller->run((Array:3), NULL)
#11 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:15))
#12 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#13 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm.php(506): CRM_Core_Invoke::invoke((Array:3))
#14 [internal function](): CiviCRM_For_WordPress->invoke("[civicrm component=\"contribution\" id=\"1\" mode=\"live\"]\n")
#15 /var/www/{domain_name}/wp-includes/plugin.php(213): call_user_func_array((Array:2), (Array:1))
#16 /var/www/{domain_name}/wp-includes/post-template.php(221): apply_filters("the_content", "[civicrm component=\"contribution\" id=\"1\" mode=\"live\"]")
#17 /var/www/{domain_name}/wp-content/themes/{theme_folder}/template-membership-signup.php(182): the_content()
#18 /var/www/{domain_name}/wp-includes/template-loader.php(74): include("/var/www/{domain_name}/wp-content/themes/{theme_folder}/template-membership-signup.php")
#19 /var/www/{domain_name}/wp-blog-header.php(16): require_once("/var/www/{domain_name}/wp-includes/template-loader.php")
#20 /var/www/{domain_name}/index.php(17): require("/var/www/{domain_name}/wp-blog-header.php")
#21 {main}

```

also

```
Oct 05 16:46:33  [info] $backTrace = #0 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(387): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(877): CRM_Core_Error::fatal("We can't load the requested web page. This page requires cookies to be enable...")
#2 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(891): CRM_Core_Controller->invalidKeyCommon()
#3 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Controller/Contribution.php(72): CRM_Core_Controller->invalidKeyRedirect()
#4 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(318): CRM_Contribute_Controller_Contribution->invalidKey()
#5 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(209): CRM_Core_Controller->key("CRM_Contribute_Controller_Contribution", TRUE, FALSE)
#6 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Controller/Contribution.php(53): CRM_Core_Controller->__construct("CiviContribute", "null")
#7 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(326): CRM_Contribute_Controller_Contribution->__construct("CiviContribute", TRUE, "null", NULL, "false")
#8 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:15))
#9 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#10 /var/www/{domain_name}/wp-content/plugins/civicrm/civicrm.php(506): CRM_Core_Invoke::invoke((Array:3))
#11 [internal function](): CiviCRM_For_WordPress->invoke("")
#12 /var/www/{domain_name}/wp-includes/plugin.php(496): call_user_func_array((Array:2), (Array:1))
#13 /var/www/{domain_name}/wp-settings.php(353): do_action("init")
#14 /var/www/{domain_name}/wp-config.php(97): require_once("/var/www/{domain_name}/wp-settings.php")
#15 /var/www/{domain_name}/wp-load.php(29): require_once("/var/www/{domain_name}/wp-config.php")
#16 /var/www/{domain_name}/wp-blog-header.php(12): require_once("/var/www/{domain_name}/wp-load.php")
#17 /var/www/{domain_name}/index.php(17): require("/var/www/{domain_name}/wp-blog-header.php")
#18 {main}

```

After some digging into this issue, found this https://issues.civicrm.org/jira/browse/CRM-9483 , which indicates that this has been fixed in version 4.3, but we are using version 4.6.8.

This is happening way to often to be a disabled cookies issue. Also made sure that its not the URL issue ( two possible reasons written in the error message above ).

# Answer
check your base url in `civicrm.setting.php` file. May be you have added www in your URL and in your actual URL there is no www.

Example: If you site URL is *http://example.com* then your base URL in `civicrm.settings.php` must be

`define( 'CIVICRM_UF_BASEURL' , 'http://exapmle.com/');`

**Not**

`define( 'CIVICRM_UF_BASEURL' , 'http://www.exapmle.com/');`
> 2 votes

---
Tags: wordpress, session, cookies
---


title: image link in message template fails

text:
# Question
Title: image link in message template fails
Editing a custom message template and am trying to insert an image from the wysiwig editor. Link shows up as:

```
<img alt="logotest" src="http://jgsny.sheridanstreet.net/media/civicrm/persist/contribute/images/black_logo_250_150dpi.png" />

```

I tried editing to

```
<img alt="logotest" src="http://jgsny.sheridanstreet.net/media/civicrm/images/black_logo_250_150dpi.png" /> Still doesn't work.

```

What am I missing?

Thanks, Kate

# Answer
I guess path (media/civicrm/persist/contribute/images/ ) works fine and you are getting issue with the image in path (media/civicrm/images/black\_logo\_250\_150dpi.png") if this is the case please

check your file permission -
> 1 votes

# Answer
Check your civicrm image url settings

sitename/civicrm/admin/setting/path?reset=1

sitename/civicrm/admin/setting/url?reset=1

Also check the file folder permission. change ownership of file folder to www-data:www-data and permission should be 755.
> 0 votes

---
Tags: message-templates, links, images
---


# Question
Title: How to disable "From email address" for unauthorized users?
If we define "From email address" then any user can use any of these addresses to send an email through the CiviCRM. Is there any way to disable the selection of these addresses for specific roles?

# Answer
> 4 votes
You can try following:

* Go to Administer-\> Customize data and Screens-\> Navigation Menu and select Mailing.
* From mailing option, do right click and edit on 'From Email Address'.
* In the next window, you can choose permission to that particular menu under 'Mailing'.
* After choosing permission for menu, assign that permission to the role you want.

With this you can give permission to single submenu.

If you want restrict unauthorized user, simply do not assign the permission to anonymous user

# Answer
> 3 votes
I write a first approach extension to achieve this question. Needs more test and go further but I think it's a good start. We already have the extension running in our production environment.

Feel free to try it.

https://civicrm.org/extensions/from-email-address-permission

https://github.com/babu-cat/cat.babu.fromemailaddresspermission

# Answer
> 2 votes
This is a good idea - but one that's not currently implemented in CiviCRM. If you have access to a developer you could write an extension to achieve this. You might also submit it to the CiviCRM paid issue queue.

---
Tags: civimail, extension, email, permissions, roles
---


# Question
Title: Views3 Integration instructions not working
I followed these instructions to integrate Views3 with a custom CiviCRM extension.

I have Drupal 7 and I copied and pasted the array just under the $databases one in "settings.php" . I clear the Views's cache and then go to the "Add new view" panel.

The Show select lists only few CiviCRM tables (I saw them also before the integration procedure) but not all and not the ones of the custom CiviCRM extension.

I have two separate databases for Drupal and CiviCRM but the drupal user has access rights to the CiviCRM tables.

Does someone can help with this issue?

# Answer
> 1 votes
I found this guide on how to expose Tables to Views in Drupal 7.

Now I'm writing a module that expose the tables of the CiviCRM extension that I have to use and it seems to work as far as I tried.

# Answer
> 0 votes
As an indirect solution to your problem: Instead of using the instructions you saw for Views integration, you might also consider using the Drupal modules "CiviCRM Entity" or "Views CiviCRM Expose Tables". This way is not only D8-compatible, but should save you the headache of editing settings.php.

---
Tags: extension, drupal-views
---


# Question
Title: Error installing CiviCRM on GoDaddy-Hosted Wordpress Website
I am getting a database error when installing CiviCRM on a WordPress website hosted by Go Daddy. The error is: 'Could Not Create a Database Trigger.' I've seen several online posts about Go Daddy not permitting the use of triggers on MySQL 5.0. Is this still in effect? Is there a work-around?

# Answer
> 4 votes
The answer is "yes", and "no".

I would strongly discourage using GoDaddy shared hosting (or almost any shared hosting) when running CiviCRM for any non-trivial use. It's going to be slooow and possibly non-functional (as in your case).

---
Tags: wordpress
---


# Question
Title: test send mail, wrong test email account
I want to test the outgoing mail settings, but CiviCRM sends the test mail to one of the contacts in the database (last name Adams). Why does it associate this person with my account? How can I change that?

ps: I do have a contact in CiviCRM with the same email as my WordPress account. I also tried creating a test contact that was called AAAtest.

Temporary Solution: This isn't really a solution, but I created a new WordPress account using my personal email address. I had a test contact in CiviCRM that used this email address, and they are now associated with each other.

Thanks

# Answer
Seamus' comment has the correct answer.

CiviCRM links each WordPress login with a corresponding contact. Your WordPress login is tied to the wrong contact - maybe a messed-up import, an incorrect merge, it's hard to say!

This is going to lead to multiple problems, including the one you're seeing, and you need to fix this ASAP. If you or someone you know is comfortable with SQL, then changing `civicrm_uf_match` to match your WordPress ID with the correct CiviCRM contact is the best solution.

If not, you can use the API Explorer to change it - but make sure you have a backup of your database before trying, the API Explorer is powerful enough to wreck things!

* Go to **Support menu \> Developer \> API Explorer**. "Support" menu might be called "Help" menu, it switched somewhere in 4.6.
* Set "Entity" to "UFMatch", "Action" to "Get". In "Parameters", Set "CiviCRM Contact ID" to Adams.
* Press "Execute".
* In the "Results" area below the "Execute" button, note the value of "id". There are two "id" values - you want the one INSIDE the "values" stanza.
* Keep "Entity" as "UFMatch", change "Action" to "Delete". For "UFMatch ID", put in the ID you just found. Press execute.

At this point, Adams should no longer be tied to your account! Assuming your WordPress email address and CiviCRM email address match, CiviCRM should link the two on your next login.
> 1 votes

---
Tags: email
---


# Question
Title: Customize Bookkeeping Transactions Report: Print custom field option value instead of name/label
I am using custom fields to store additional (cost accounting) data for contributions. Using the bookkeeping transactions report, I am able to export the data.

However, when we are trying to import the data into the legacy accounting system, it does not accept the option's long name for import, but only the key value, which is stored in the custom field option value.

How can I customize the bookkeeping transactions report, in order to make it print the custom field option value instead of name/label?

Any hint is highly appreciated!

Cheers, Detlev

# Answer
> 1 votes
I assume you're not asking how to customize reports in general, but what customization you can make to get your desired results.

You can use the `alterDisplay()` function to modify the output of your report. Check out `CRM_Core_PseudoConstact` and its methods (`getKey`, `getLabel`, `getName`) one of those is likely to do it for you.

---
Tags: custom-fields, civireport, custom-reports
---


# Question
Title: Adding a Financial Account to a Contribution
I've imported a bunch of Financial Accounts using the CSV importer. There are no associated Financial Types created (should there be?) so I am not sure how to link a new Contribution to the relevant Financial Account. Can anyone give me a pointer?

# Answer
Yes, you should create Financial Types, and link them to the relevant Financial Accounts. Once you've created your new Financial Type, find it in the list and click on Accounts. This is where you will 'Assign Accounts' to your Financial Type, creating the link between the two. You can read more about how to do that here.

To link a new contribution to the relevant Financial Account, simply record a 'New Contribution' and select the appropriate Financial Type from the drop-down menu. When you export a list of contributions, you then have the option to include the 'Accounting Code' in your export.

**A note for people using the CSV API Importer:** if you import Financial Accounts, it doesn't create a linked Financial Type. However, if you import Financial Types, it creates and links an associated Financial Account. It may be easier to go through and enter an accounting code for the automatically created Financial Account rather than creating and linking new Financial Types for each Financial Account.
> 1 votes

# Answer
As far as I know: You do need to link the Financial Accounts to the Financial Type, and create more financial types if you need them. When you enter a contribution you can select the financial type, which will then provide the link to the Financial Account.
> 1 votes

---
Tags: civicontribute, financial-types, financial-accounts
---


# Question
Title: Is 'insert tokens' broken for TinyMCE when creating templates
Have shown this to be the case on 2 sites. First site reported the problem and were using TinyMCE. Second site was using CKEditor had no such problem. I then set their wysiwyg to TinyMCE and bingo replicated problem. Can't replicate on Demo as demo user is missing permissions to edit Message Templates.

My search on JIRA found this which may be an earlier example of the problem, but perhaps it has come back to life

# Answer
> 1 votes
You're right, it was a bug. Here's a fix for 4.7.

https://github.com/civicrm/civicrm-core/pull/7438

The code in 4.7 is a lot cleaner than 4.6; I don't think fixing it in 4.6 will be a priority for the core team.

---
Tags: tokens, message-templates, wysiwyg, tinymce
---


# Question
Title: Array String Error Code in Webform Integration
Help, please! I'm getting the following error code:

Notice: Array to string conversion in wf\_crm\_admin\_component::preprocessComponentsForm() (line 555 of /home/makom/www/www/sites/all/modules/webform\_civicrm/includes/wf\_crm\_admin\_component.inc).

Here is the code in question, line 555 is the last line of text, which starts "$type = array." I'm not by any means a PHP expert, can anyone help me parse this issue, and if not fix it, at least understand what it means?

```
  // Component row
  elseif (!empty($row['data-cid']) && isset($node->webform['components'][$row['data-cid']])) {
    $cid = $row['data-cid'];
    $component = $node->webform['components'][$cid];
    $type = &$row['data'][1];
    if ($component['type'] == 'civicrm_contact') {
      $types = array(
        'autocomplete' => t('Contact - Autocomplete'),
        'select' => t('Contact - Select List'),
        'hidden' => $component['extra']['show_hidden_contact'] ? t('Contact - Static') : t('Contact - Hidden'),
      );
      $type = $types[$component['extra']['widget']];
    }
    elseif ($component['type'] == 'select') {
      if ($component['extra']['aslist']) {
        $type = $component['extra']['multiple'] ? t('Multi-select') : t('Select');
      }
      else {
        $type = $component['extra']['multiple'] ? t('Checkboxes') : t('Radio buttons');
      }
    }
    if (in_array($cid, $enabled)) {
      $fields = wf_crm_get_fields();
      $sets = wf_crm_get_fields('sets');
      $class = 'civi-icon';
      list( , $c, $ent, $n, $table, $name) = explode('_', $component['form_key'], 6);
      $field = wf_crm_aval($fields, $table . '_' . $name, array('type' => 'fieldset'));
      // Don't allow CiviCRM fields to be cloned
      $row['data'][6] = '';
      if ($component['type'] == 'fieldset') {
        $title = t('Contact !num', array('!num' => $c));
        $type = t('Fieldset for !contact', array('!contact' => wf_crm_contact_label($c, $data)));
        $row['data'][6] = l(t('Clone Contact'), "node/{$node->nid}/webform/components/$cid/clone", array(
          'attributes' => array('title' => t('Add a new contact to the form with the same fields and settings')
          )));
        $class .= ' fieldset';
      }
      elseif ($ent == 'contact') {
        $field_type = ($table == 'contact' || $table == 'other') ? $field['name'] : $sets[$table]['label'];
        $title = t('!type Field for !contact', array('!contact' => wf_crm_contact_label($c, $data), '!type' => $field_type));
      }
      else {
        $title = t('Field for !type', array('!type' => $sets[$table]['label']));
      }
      if ($table === 'address' && $component['type'] === 'textfield') {
        if ($name === 'state_province_id' || $name === 'county_id') {
          $type = t('AJAX Select');
        }
      }
      if ($component['type'] == 'civicrm_contact' || $component['type'] == 'fieldset') {
        $class .= ' ' . $node->webform_civicrm['data']['contact'][$c]['contact'][1]['contact_type'];
      }
      if ($component['type'] == 'select') {
        $type .= ' (' . (empty($component['extra']['civicrm_live_options']) ? t('static') : t('live')) . ')';
      }
      // Show defaults with labels instead of keys
      if ($component['type'] == 'civicrm_contact') {
        if ($component['extra']['default'] == 'contact_id') {
          $row['data'][2] = check_plain(wf_crm_display_name($component['extra']['default_contact_id']));
        }
        elseif ($component['extra']['default'] == 'user') {
          $row['data'][2] = t('Current User');
        }
        elseif ($component['extra']['default'] == 'auto') {
          $row['data'][2] = t('Auto - From Filters');
        }
        elseif ($component['extra']['default'] == 'relationship' && $component['extra']['default_relationship']) {
          $row['data'][2] = t('Relationship to !contact', array('!contact' => wf_crm_contact_label(1, $data)));
        }
      }
      elseif (isset($component['value']) && strlen($component['value']) && ($field['type'] == 'select' || !empty($field['expose_list']))) {
        if ($component['type'] == 'select') {
          $items = wf_crm_str2array($component['extra']['items']);
        }
        else {
          $items = wf_crm_field_options($component, 'components_form', $node->webform_civicrm['data']);
        }
        $val = '';
        foreach (explode(',', $component['value']) as $v) {
          if (isset($items[trim($v)])) {
            $val .= ($val ? ', ' : '') . $items[trim($v)];
          }
        }
        $row['data'][2] = $val;
      }
      // Contribution page - link to civicrm config form instead of component edit form
      if ($name == 'contribution_page_id') {
        $type = t('CiviCRM Billing Fields');
        $class .= ' contribution';
        $row['data'][5] = l(t('Configure'), 'civicrm/admin/contribute/settings', array(
          'query' => array(
            'reset' => 1,
            'action' => 'update',
            'id' => $component['value'],
          ),
          'attributes' => array(
            'title' => t('Edit Contribution Page in CiviCRM'),
          )
        ));
      }
      $type = array('data' => '<span class="' . $class . '"> </span>' . $type, 'title' => $title);
    }
  }
}

```

}

# Answer
It's important to understand the difference between errors and notices. The message you're seeing says "*Notice* Array to string conversion" so it is not an error. Notices are just info to programmers pointing out something they could do better and are generally harmless. Your Drupal site should be configured to *not* display notices to your users (you can just hide them in the admin settings).

As for what exactly is causing it... I squinted at the line of code you pasted in but don't see anything wrong with it.
> 0 votes

---
Tags: webform-civicrm, php
---


# Question
Title: Webform integration for event registration
I use webform integration for event registration, and this has worked smoothly in the past. Users can select which of several events they would like. I don't believe I've changed anything about the setup to break it, but I guess I must have updated something without noticing. Now, however, anyone who uses this form becomes registered for all events listed. The webform results page shows which event an individual chose, but the contacts are registered for all the events in civicrm. This is wreaking havoc, as you can imagine. Has anyone else run into this issue? How did you fix it?

# Answer
> 0 votes
I just set up a test webform with a "user select" list of events, and diligently tried to get it to misbehave, but it wouldn't. It seems to be correctly registering and unregistering me for the events I select on the form, whether I'm logged in or anonymous.

I would suggest you:

1. Ensure you are using the latest version of everything
2. Try creating a new webform as a test to make sure the problem isn't limited to just your one form.
3. Create an issue in the webform\_civicrm queue with *lots* of details about how to reproduce the bug, including screenshots of your form configuration.

# Answer
> 2 votes
Can you check if "User Select" is still part of the Events list on the CiviCRM tab?

It MIGHT be somehow possible that the Webform field still exists but lost connection to the CiviCRM functionality. In that case the visitor still choses the event in the webform, but CiviCRM registers to all events.

---
Tags: civievent, webform-civicrm, registration
---


title: Effective snail mail return handling

text:
# Question
Title: Effective snail mail return handling
Is there a solution for scanning snail mail coming in return, automatically matching to contact, and marking them for further processing in CiviCRM?

Workarounds and external modules or programs could also be interesting.

I am on Drupal 7

# Answer
Look for barcodes (and QR codes, though I'm not sure that's avaiable). I believe the best supported area in Civi for this is Events, where it is integrated into ticket printing and event check-in. The code is there for printing barcodes on name tags as well. So then I would check what the token for this is, and check if it is exposed when generating a pdf letter.

In terms of workflow I believe you either want the code on a mailback envelope or card, and/or on a response part of you package.

Generally the barcode is used to send a system to a url when scanned. The url can be set up so that it populates the fields in a profile with the values for a particular contact, similar to the email token that generates a url for this purpose. The lifetime that the token is valid from when it is generated can be configured for a period, say 1 week or 3 weeks.

Brainstorming a bit, this could be used to submit a custom activity for the contact. If the barcode is on a returned piece of mail the actvity type could indicate the address is bad (undeliverable, moved, etc.). If the barcode is on the response mechanism then the actvity could indicate the contact sent the mailback indicating, oh, they agree that Trump shouldn't be allowed to become President.

Without custom code, you may need to use a batch update with profile workflow to convert the activity into an update of the address status. Put the field you want to update, eg Do not mail, on a custom profile. Then find contacts with the Mail returns custom activity with Do not mail false, select 50 or 100 of the contacts, choose Batch update with profile as the search action, set the Do not mail field to true on the top line, and click the icon that means copy the value in this field in the first row to all the other rows then save. Unfortunately you have to repeat this process until all aee updated.

HTH
> 1 votes

---
Tags: extension
---


# Question
Title: Error for token.php related to greeting tokens
I keep getting a error daily for one of my cron jobs:

```
Cron <site@prefix> /usr/local/bin/php /home/site/public_html/administrator/components/com_civicrm/civicrm/bin/cli.php -s www.site.org -u adminusername -p adminpassword -e job -a execute

```

The error comes in an email and looks like this:

```
Warning: array_flip() expects parameter 1 to be array, string given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1470

Warning: array_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471

Warning: array_fill_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471

Fatal error: Unsupported operand types in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472

```

It appears to be triggering off greetings. I have run the job to update greetings but it appears that this is based on what it expects in the code. Is there something that I need to change in order for the array to get what it expects?

# Answer
I'm surprised you were able to get the "Update Greetings" scheduled job to run in cron; the UI specifically disallows enabling that job. Did you turn it directly using SQL? You may want to consider whether you really want that job enabled.

That aside - I'd put this line just above line 1470:

```
print_r(CRM_Utils_Array::value($key, $greetingToken), TRUE)

```

And see what you get when you run the cli command manually.
> 1 votes

# Answer
this bug seems to be related to a bug regarding tokens array structure some lines above. The array is being reduced to only one of it's values. Maybe this will work:

See: https://issues.civicrm.org/jira/browse/CRM-17038
> 0 votes

# Answer
I'm also receiving the error: - Fatal error: Unsupported operand types in /home/accountname/public\_html/sites/all/modules/civicrm/CRM/Utils/Token.php on line 1472

However, the site is running 4.6.10 so shouldn't it be resolved?
> 0 votes

---
Tags: tokens
---


# Question
Title: building a group from a list of email addresses of contacts
I have a list of email addresses of contacts. I want to create a group out of those contacts. What would be the easiest way to do that on 4.5.3 ?

Note, the `IN` operator of the search builder doesn't seem to work on 4.5.3. it basicly always returns 'sorry'.

# Answer
> 3 votes
If you are not able find a search method that results in the people you want to add to a group. And you have a list of email addresses of the people in the group. You can use the import feature.

The import allows you to add contacts (newly imported or existing matched contacts) in to a group.

Contacts \> Import Contacts ("For Duplicate Contacts" use Update)

---
Tags: groups, search-builder, custom-search
---


# Question
Title: Outgoing links in civimail getting changed to civi site address
I setup a mailing in civi and in the email there are links to web pages not on the civi site. When I send the test message the link is changed to the civi site and not the actual link.

example good link

http://www.google.com

link that shows up

http://civi.mysite.com/

# Answer
> 2 votes
If you set your mailing to track clicks on links, it automatically replaces every link with an auto-generated CiviCRM url - this will redirect to the original link, but has to go through CiviCRM to be tracked.

If you haven't chosen to track clicks, or if the CiviCRM url just goes to your site without redirecting, then there's a problem, but otherwise it's intentional.

---
Tags: civimail
---


title: Scheduled reminders not being sent

text:
# Question
Title: Scheduled reminders not being sent
All,

Scheduled reminders worked last year, but are not working this year.

I had made some changes to the Outbound Mail settings, but a) I set these back as they were and b) test emails come through just fine.

To sidestep the issue of 'day before membership end date', I entered today's date. When I manually executed 'Send Scheduled Reminders', the system reported that the job had completed, but no emails were sent and no errors were logged.

I just learned that things are not quite as 'simple' as I had hoped: At least one person received the reminder that I manually sent, but at least one person did not. I am among the 'at least one who did not' and I know that there are absolutely no email filters on the recipient side - so what happened?

# Answer
> 2 votes
In v4.4 and v4.5 there is a known problem with membership reminders. Only one reminder email of each type will ever be sent to each member, not one each year, just one for that member forever. (Unless you have repeat turned on, but I think that is unlikely for membership renewal reminders as that creates another set of problems.)

It means you need to create copies of your existing reminders every 12 months (assuming you have one year memberships).

Things are different in v4.6, so if you are on v4.6 this answer will be irrelevant for you.

# Answer
> 1 votes
The problem can be at two places, either some reminders aren't sent, or they are sent but get lost before reaching your inbox

It would be super useful to see the log of your mail server (the one that sends the emails for your civicrm), to be sure if civicrm has tried to send it or not.

If you have changed your mail settings, it's possible that your new configuration isn't properly tuned and that some of civi mails got caught by some spam filter along the way.

---
Tags: civimember, scheduled-reminders
---


# Question
Title: Contribution page "other amount" option causes weird behavior - possible bug?
Using version 4.6.10. **I can reproduce this problem on the Demo site.**
**This is the problem:**

* Create a donation page with an "other amount" option in addition to fixed price options.
* Open the live-page or test-drive page link
* Under Donation Amount, choose "Other Amount" radio button
* Most of the fields on the page disappear: the name and address fields, the credit card fields, etc.
* Input an amount into the "Other Amount" box, and press enter, sometimes the fields briefly reappear.
* But as soon as you scroll with your mouse, the fields disappear again, and you find that there are pink error messages at the top of the page asking you to fill in the missing form fields.
* However, you can't fill in the missing fields because they have disappeared from the form.

Since I can reproduce this on the demo site, I suspect it may be a bug. But I'm reluctant to report a bug until I've had some independent confirmation.

Any help would be most appreciated!

Leslie

# Answer
**Update: This is a bug** \- Reported at https://issues.civicrm.org/jira/browse/CRM-17735

---original answer---

I am not seeing this on the demo. On clicking the **Other Amount** radio button, the credit card information section disappears. This is the correct/expected behaviour as the amount is Zero. Adding an amount makes that section reappear.

This could be a browser issue - please test with other OS/Browser combinations. I used Ubuntu Mate with FireFox 42.0
> 2 votes

---
Tags: civicontribute, contribution-page, issues
---


title: Membership Directory Search

text:
# Question
Title: Membership Directory Search
Following the instructions for the creation of a membership directory using profiles we have been successful at creating a searchable directory. However, I wish to use the directory almost like a store location finder to find members near me. Ideally this would use a single search box where the visitor could enter a location then return results of any nearby members and by default use location services to display the visitors location as a default.

How can I employ such a search?

# Answer
You could search on a city to show people in that location. And have the option to show a map.

See my post on How to create member listings/directories/maps

Unfortunately this only shows contacts in the city, any one just outside will not show. You could have something custom developed where clicking on a contact shows the contact centered on the map, but lists all the other contacts so they can be found by moving around on the map.
> 2 votes

# Answer
There is a Proximity Search under Search \> Custom Search or at eg http://d46.demo.civicrm.org/civicrm/contact/search/custom?csid=6&reset=1

I can't outline what would be required to make this Search (and not others) available for the public, but would be one route to investigate.

With Drupal it is possible to do proximity searches using Views along with mapping modules such as OpenLayer so that might be another avenue to research.
> 2 votes

---
Tags: civimember, profile
---


title: How to import custom fields

text:
# Question
Title: How to import custom fields
i want to import my own table that contains custom fields and custom fields data.

is there a wizard that will understand that the first line title is the custom-fields and that that the data that follow the same row is the data , so i dot have to manually create custom fields?

can i create a csv file with custom fields ( no data just the custom fields) and import it to civi , instead of manualy create each and every one of those ?

# Answer
Custom Fields are complex and can be used for a variety of things. Having a wizard that will automatically create custom fields from the first line of the import file is not a good idea, at least for most non-expert users.

In your original/unedited question you asked if someone could create the wizard. You are welcome to do that, or commission an extension (by Core-Team or a Partner/Contributor) if you think it will be used.
> 2 votes

# Answer
You can import custom data, but only after the custom fields have been created.
> 0 votes

# Answer
To answer the second part of your question - you CAN create the custom fields by a CSV file by using either the command-line API CSV import tools or the API CSV GUI Import extension. However, custom fields are very complicated, and this isn't going to save you time unless you have a couple hundred custom fields.
> 0 votes

---
Tags: custom-fields
---


# Question
Title: How do I edit email template for Events confirmations
I am trying to override the default email template for civicrm Events, which will be sent when registration is complete. I made changes on this file `CRM/Event/Form/EventFees.tpl` but the changes are being shown on email. I tried clearing cache but this doesn't help. Am I doing something wrong here?

# Answer
You can customize the style and wording of events email messages in workflow messages here civicrm/admin/messageTemplates?reset=1
> 2 votes

---
Tags: civievent, email, message-templates
---


# Question
Title: Limit is ignored in civicrm_api3('Membership', 'get')
Can anyone explain why limit here has no effect? Still get 25 results every time. Also tried `'api.Contact.get' => array(array('limit' => 1000))`

Using offset to recurse through the set works but is a nuisance.

```
 require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm.settings.php';
 require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
 $config = CRM_Core_Config::singleton( );
 require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/api/api.php';
 $result = civicrm_api3('Membership', 'get', array(
    'membership_type_id' => "$level",
    'limit' => 1000,
    'api.Contact.get' => array(),
 ));

```

# Answer
You need to use `options.limit` to make this work.

> options.limit : The maximum number of records to return. You can make this unlimited by setting the value to 0.

**Usage**

```
$result = civicrm_api3('Membership', 'get', array(
  'membership_type_id' => "$level",
  'options' => array('limit' => 1000),
));

```

Get more details on the different parameters you can use under `options`.

Also check : How do I get more than 25 records from the API?
> 6 votes

---
Tags: civimember, api
---


# Question
Title: Access denied errors by server itself on uploaded files?
I'm noticing a lot in the logs whereby the server itself is trying to request a resource that CiviCRM denies access to by `.htaccess`.

Specifically it seems the CiviCRM server is trying to fetch files of this pattern:

```
/sites/default/files/civicrm/upload/delete-this-d3542fs2sP
/sites/default/files/civicrm/custom/delete-this-D44i89qZNP

```

Yet both of those directories contain `.htaccess` files with `Deny all` statements.

Anyone shed any light on this? \[4.4.20 LTS, Drupal 7\]

# Answer
> 4 votes
I have discovered that the `delete-this` files are temporary files created by CiviCRM for the sole purpose of generating this error! This error is **good**, it means that these directories are not browseable, and they shouldn't be browseable.

CiviCRM's `CRM_Utils_Check_Security` class does these checks in order to report what would-be security errors.

It creates a file, then tries to access that file via http. This should fail.

---
Tags: drupal, logs, lts
---


title: Dashboard Dashlets Unauthorized

text:
# Question
Title: Dashboard Dashlets Unauthorized
Wordpress 4.4 CiviCRM 4.6.10

I installed recently and was in initial setup stages. I had dashlets working fine and created new dashlets. Now all dashlets are giving error

401 - Unauthorized Your authorization failed. Please try refreshing the page and fill in the correct login details.

I was working with extensions and configuring the URLs for extension folders. I installed CiviRules and logger successfully. I've dsiabled these and removed extension URLS now.

I've searched and cannot find similar errors.No Wordpress errors showing.

Any ideas?

Thanks

Alan

# Answer
> 2 votes
Resolved....Htaccess password protection on site prevented dashlets showing

---
Tags: wordpress
---


# Question
Title: In what circumstances is it safe to automatically de-duplicate contacts?
When is it safe (and when might it not be safe) to automatically de-duplicate contacts submitted from a public facing form?

How might a malicious user leverage automatic contact merges to their advantage?

# Answer
> 2 votes
As soon as you automatically "merge", it will never be 100% safe. If you want to be sure, never dedupe (ie put dedupe rules that are not possible to match) and ask your users to login.

Obviously, it means that you will end up with tons of duplicates, so in practice, you will need to relax the rules and accept that you might have two different persons that end up merged in the same contact. This isn't as bad as it sounds, and it happens with every shared list of items that several people can update, and it doesn't create too much problems.

So your choice is what type of error you want to avoid more: having more duplicates or having more incorrect merges. For what I've experienced, the most relaxed rule is to consider that everyone sharing an address is the same person, and the strictest want the first and last name and email and country.

you might want to add an extra layer of protection if you send emails with the hash token (so your contacts don't have to login and are automatically identified) so they can't change their name by accident with this extension https://civicrm.org/extensions/no-overwrite

And you could enable the detailed logging http://book.civicrm.org/user/advanced-configuration/logging/ so you keep the history of all the changes if you haven't done it already

# Answer
> 1 votes
fill email address of someone else (so it will match with that person), then use different name/phone number/employer/membership/event sign up etc...

It would mess up your system, and your communication to original contact. That could be advantage enough for them.

Above is a theoretical possibility. In real life I have never seen it happen. So in my opinion it is safe to use it and do an automated merge only by e-mail.

I do have a customer who for this reason chose to not merge new contacts with existing ones and de-duplicate only manually.

---
Tags: duplicate-contacts, security
---


# Question
Title: Determine client of new case from within hook
I'm setting up CiviCase with a new case type of 'Press Release'. We only have one press officer, but want other staff (those who more often deal directly with our members) to be able to open cases. So I wanted a case role of 'Press Officer', as the case manager, automatically given to a particular cid for all cases of that type.

My first thought for this was a post hook, but when you create a case, what you get in the post hook has no client contact IDs set yet. (This isn't a case of CRM-15914, it's not there if I do an explicit Case.get on that case ID either.) The problem is, clients are added to the case (inserted into civicrm\_case\_contact) only after the post hook is fired for the case creation, and adding a client has no hooks of its own.

How can I automatically assign a role to someone other than the creator when a case is created?

# Answer
> 1 votes
The post hook does not perform as expected for cases :-) I have done some mods to do exactly what you are doing: automatically assigning a role. I have done this in 2 ways:

1. using the post hook on the Activity Open Case
2. using the caseSummary hook and checking if there is no other activity than Open Case. In this case I still allow the user to override what I have done as it would then have more activities than just Open Case

A refactor of CiviCRM Case is still on my wish list :-)

# Answer
> 0 votes
How I solved this was to bring CRM\_Case\_BAO\_Case into custom PHP, and basically copy the firing of the hooks from create() to addCaseToContact(), changing the entity type to the new 'CaseContact'.

Now the adding of a contact to a case fires a hook, that I can catch to create the relationship for a case role. It even works for cases with multiple clients, if you have this enabled.

Would pre/post hooks for adding a contact to a case be a useful thing to have in core?

# Answer
> 0 votes
You can use the postprocess hook and check for CRM\_Case\_Form\_Case. I did have some trouble finding the case id though, but maybe I'm just not seeing it. A "bad" workaround would be to assume the case id is the latest one just created in the database, unless it's a busy site.

---
Tags: civicase, hooks
---


# Question
Title: Issue to install civicrm 4.6.10 on Drupal 7.41
I'm trying to install civicrm 4.6.10 with Drupal 7.41 on Ubuntu server 14.04 through Virtualbox. I installed successfully Drupal 7.41 and after that tried to follow the installation guide of civicrm. My first attempt was to use the "Install New module" though URL but it was not working. I have a "HTML-1" error. Related to posts I see on civicrm forum it could be due to redirection of sourceforge website that is maybe not well managed by Drupal. So I tried the alternative way, described in installation guide : manual installation. I download civicrm-4.6.10-drupal.tar.gz file from official repository and copy it in my drupal repository in /sites/all/modules folder and uncompress it. A civicrm folder has been correctly created. Coming back to Drupal administrator interface, going in Modules part, I see nothing related to civicrm. I tried to continue to follow the installation guide and tried to access to the installation script here : http://your\_drupal\_home/sites/all/modules/civicrm/install/index.php but file was not reachable.

What am I doing wrong ?

Thanks in advance for all help and advices you can provide to me.

# Answer
> 1 votes
It looks like something is wrong with your Drupal installation. Does any other module work in Drupal? And also when the module is stored in the directory sites/all/modules

# Answer
> 0 votes
I assume you are following the install instructions \- As you correctly questioned, yes the permissions need to be correct (user www-data needs ownership I believe)

I also assume you are using Virtual Box to test, you might find it easier to use the Bitnami CiviCRM installer

# Answer
> 0 votes
Since I encountered pretty much the same errors as Ajrarn, I though that I should share my solution.

I couldn't for the love of me install CiviCRM via URL, no matter how hard I tried. I used wget and then copy the proper link once the download starts in a console. However, the URL wasn't correct and I tried different URLs too, but Drupal couldn't install CiviCRM.

I looked on the net for any proper tutorials and all I found was the official one which says that installing CiviCRM via URL is possible and the best choice. I finally stumbled upon an article with Rosehosting which has a different way to deploy CiviCRM with Drupal. I tried the instructions and everything went OK. I hope you'll find the tutorial useful.

---
Tags: drupal, installation, issues
---


# Question
Title: CiviMail causes read timeout on Methods.pm
Version 4.6.9

When a scheduled bulk email is sent, Cron Daemon returns `read timeout at /usr/local/share/perl5/Net/HTTP/Methods.pm line 271.` Line 271 is inside the function sub my\_readline. This has been going on for about a week, but it's been months since I've done any settings changes on the server.

Email delivery is unaffected according to CiviMail reports. I get this multiple times if sending lasts for multiple cron cycles. The Send Scheduled Mailings job shows no anomalies. Does anyone have experience resolving this error?

# Answer
> 1 votes
It sounds like your site or hosting environment runs cron via some Perl wrapper.

You may need to talk to your hosts about hitting this timeout when cron tasks are running - if they call cron via a web based tool which times out after a few minutes, that tool may not be suitable for running Drupal cron.

Talk to your hosting experts and see if they can help?

---
Tags: civimail
---


title: cron.php error with joomla 3.4 uri.php

text:
# Question
Title: cron.php error with joomla 3.4 uri.php
I'm running civicrm 4.4.19 with Joomla 3.4.4. Sometime back in September my scheduled crons stopped running. Debugging shows that it is throwing an error of:

Fatal error: Class 'Joomla\Uri\Uri' not found in /home/XYZW/public\_html/libraries/joomla/uri/uri.php on line 24

I've gotten the same error both by using the cron execution of the php file and by browsing to:

http://sitename.org/administrator/components/com\_civicrm/civicrm/bin/cron.php?name=USER&pass=PASSWORD&key=SITEKEY

I get the same error if I type the wrong username or password, but not the key (then I get invalid key error).

It looks like the cron had stopped working when I updated from Joomla 2.5 to 3.4 back in September.

Ideas?

# Answer
> 2 votes
I had exactly this problem too and it seemed to me that the missing class should have been loaded earlier in the sequence. In Civi 4.6 there is an extra statement on line 646 of /home/\[USERNAME\]/public\_html/info/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php so I made my 4.4.20 version look like this (with Joomla 3.4.5):

```
if( version_compare(JVERSION, '3.0', 'lt') ) {
  require $joomlaBase . '/libraries/joomla/environment/uri.php';
  require $joomlaBase . '/libraries/joomla/application/component/helper.php';
}
else {
  require $joomlaBase . '/libraries/cms.php';
  require $joomlaBase . '/libraries/joomla/uri/uri.php';
}

```

It is the require $joomlaBase . '/libraries/cms.php'; statement that I added.

I am not sending mail at the moment but at least the crons have stopped sending me error messages every 10 minutes. I could not upgrade to 4.6 so this will have to do for me for now.

---
Tags: joomla, cron-job, cron
---


title: Drupal 8.0.1 compatibility with CiviCRM

text:
# Question
Title: Drupal 8.0.1 compatibility with CiviCRM
Is the newest version of CiviCRM compatible with the newest 8.0.1 version of drupal? I have loaded drupal on my VPS but wonder if I load CiviCRM into the module folder, if it will be reccognized. If I have to delete 8.0.1 and reload drupal 7 please advise. Thanks for your time.

# Answer
> 4 votes
I'm afraid CiviCRM doesn't support Drupal 8 yet. You will need to install Drupal 7.

You can find more details here: Installation and Upgrades

See also this question: Does CiviCRM work with Drupal 8 and how can I help?

---
Tags: drupal, drupal-8, compatiblity
---


# Question
Title: Year End Contribution Summary for Donors
I'd like to send out to all my donors a summary of all their contributions in the past year.

CiviCRM seems to have a feature that should do that by grouping the contributions per contact when printing out thank you letters but that feature is broken as illustrated here : Table not rendering data properly using new contribution grouping feature

Any work arounds that I am not thinking of? Thanks

# Answer
> 1 votes
The extension Summary Fields, will give you a token for total contributions per year, which you can use

# Answer
> 1 votes
In case you are looking for a formal contribution receipt you may want to have a look at those two extensions for contribution receipts:

1. Donation Receipts

2. CDN Tax Receipts

# Answer
> 0 votes
SO I ended up solving this by using Drupal Views. I created a list of all the donors who have completed donations in 2015 and linking each name to another page which is also view (table) that lists all the 2015 contributions with a header which includes the letter.

I then formatted the page for printing with css.

The only downside is that I have to print them one by one but it works.

---
Tags: civicontribute, receipts
---


# Question
Title: How to find users that have taken more than one action?
We want to identify the most active users (eg. those that register to several events, or made several contributions, or signed several petitions).

Is there already a report or a custom search that allow to search users that have more than x activities of the same type?

In the future, can we use the engagement index somehow to identify them?

To make things more complicated/useful, I would like to be able to filter these activities by date, so for instance finding all our contacts that have signed more than 2 petitions in the past year. Is there something existing that I haven't found yet?

# Answer
This may not be a comprehensive answer, but do you have this extension installed? https://github.com/progressivetech/net.ourpowerbase.sumfields

Some of these calculated fields used with advanced search could answer some of your questions.

> The benefit of making these items available as calculated fields is that they can be searched in Advanced Search and used as a basis for a smart group as well as for tokens in email and print communications.

Sumfields that are available:

> ```
> Total Lifetime Contributions
> Total Contributions this Year
> Total Contributions last Year
> Amount of Last Contribution
> Date of Last Contribution
> Date of First Contribution
> Largest Contribution
> Count of Contributions
> Average Annual (Calendar Year) Contribution
> Date of Last Membership Payment
> Amount of Last Membership Payment
> Name of the last attended event
> Date of the last attended event
> Total Number of events
> Number of events attended
> Events attended as percent of total
> Number of no-show events
> No-shows as percent of total events
> Number of turnout attempts
> Number attended from turnout attempts
> Number noshow from turnout attempts
> Attended as percent of turn out attempts
> No-shows as percent of turn out attempts
>
> ```
> 3 votes

---
Tags: activities
---


# Question
Title: Getting a DB Error: unknown error when entering and saving phone number
I see that there's a few threads out there around this topic. I've just installed a brand new instance of WordPress 4.4 with CiviCRM 4.6.10. I've got three other installs of CiviCRM with Drupal on this same host, so, I can't imagine that it's a problem with the host.

Here's a portion of the log:

Dec 14 21:53:32 \[info\] $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_numeric' [nativecode=1548 ** Cannot load from mysql.proc. The table is probably corrupted]
[type] => DB_Error
[user_info] => SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_numeric' [nativecode=1548 ** Cannot load from mysql.proc. The table is probably corrupted]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_numeric' [nativecode=1548 ** Cannot load from mysql.proc. The table is probably corrupted]"]

```

)

Database is 5.5.47-MariaDB. The user account has "ALL PRIVILEGES".

Any thoughts? Any help is *greatly* appreciated!

# Answer
There is a mysql function that is called to save a normalized phone number (stripping spaces and so on). You seem to have a problem as mysql can't load this function

Cannot load from mysql.proc. The table is probably corrupted

This might be several issues and potentially indicating bigger issues, database corruption should be handled seriously.

The indicated fix might work:

```
mysql_upgrade

```

Backup the database first. if it doesn't solve the problem, restore it on a different server (or on your laptop) and check if you can get a working civicrm there.
> 1 votes

---
Tags: wordpress, database, error
---


title: Highly unusual matching error

text:
# Question
Title: Highly unusual matching error
One of my users created a petition: Both he and I responded and it appended our responses to the wrong records. I wasn’t logged in and it tried to write to an {surname matching mine\]. I suspect that this is the first A. Ross and it is only matching surnames. It appends my data to the existing record.

I just re-submitted my petition signature and it over wrote it again... Re-submitted petition after changes - Logging Details

```
Top of Form
Change to Mrs Peter Ross made by on 2015-12-14 10:00:03:

Field
Changed From
Changed To
Sort Name (id: 1945)
Ross, Alison
Ross, Peter
Display Name (id: 1945)
Mrs Alison Ross
Mrs Peter Ross
First Name (id: 1945)
Alison
Peter
Modified Date (id: 1945)
2015-12-14 09:15:43
2015-12-14 10:00:03
Source Record (id: 1375)
7
Activity Type ID (id: 1375)
Petition Signature
Subject (id: 1375)
Petition to xxx xxx
Activity Date (id: 1375)
2015-12-14 09:58:53
Activity Status (id: 1375)
Completed
Priority (id: 1375)
Normal
Test (id: 1375)
false
Auto (id: 1375)
false
Is this activity a current revision in versioning chain? (id: 1375)
true
Activity is in the Trash (id: 1375)
false
Campaign (id: 1375)
12

```

# Answer
What is the default unsupervised dedupe rule you have? it should probably have first+last+email if you want to be on the safe side and avoid incorrect merging
> 3 votes

---
Tags: issues
---


title: How to clone webforms?

text:
# Question
Title: How to clone webforms?
They are various drupal modules that allow to clone a webform, but so far, all the ones I tried didn't play nicely with webform\_civicrm and introduced weird problems.

Do you have one that you use and that works when your form is connected to civicrm?

# Answer
> 5 votes
I previously had problems with node\_clone (you had to enable civicrm option in cloned node), but last few projects it seemed to work properly.

What are the weird problems?

---
Tags: webform-civicrm
---


title: Case Overview Button Not working

text:
# Question
Title: Case Overview Button Not working
I'm using Civi CRM as a local Healthwatch. I can't see an overview of cases - when I click the button, or try to enact a search, the page below shows. Any idea how to fix it?

TIA!

# Answer
> 1 votes
Check the civi log for more details. It looks like you're using drupal so it's either under sites/warrington.healthwatchcrm.co.uk/files/civicrm/ConfigAndLog or sites/default/files/civicrm/ConfigAndLog.

---
Tags: civicase, search, error
---


# Question
Title: Subject line problem when using action "Thank-you Letters for Contributions" in Find Contributions v4.6.8
I'm trying to use an email template in the "Thank-you Letters for Contributions" action on the Find Contributions results page - civicrm v4.6.8

This action brings up the form "Create Printabe Letters (PDF)" In this form: \- I select "Send emails where possible. Generate printable PDF’s for contacts who cannot receive email." for the Print and email options. \- I choose an email template with which the civi form correctly fills in the Activity Subject and Your Letter fields.

But no matter what text I put in the Activity Subject field, every email sent has the subject line: Thank you for your contribution/s

Any ideas for getting the template subject line to appear would be appreciated.

# Answer
> 1 votes
I tried searching for solutions before posting this, but but clearly didn't search on the right thing. Found a jira reference today. Looks like this was solved last month. Check it out here: https://issues.civicrm.org/jira/browse/CRM-17548

---
Tags: civimail, civicontribute
---


# Question
Title: How do I make tag sets searchable in Find Contacts?
I'm pretty new to civiCRM and it feels like I'm missing something obvious. The tags that are in tag sets don't show up in the Find Contacts search. They show up in Advanced Search just fine. Is this just how tag sets work or is there a way to make them show up in both search options? I'm using Civi 4.6.10 in Wordpress.

# Answer
> 4 votes
Matthew, welcome to the CiviCRM community.

Have a look at http://book.civicrm.org/user/organising-your-data/groups-and-tags/ \- there's a section on using Tag Sets.

It does say "adding them creates an additional search field in the Basic Criteria section of the Advanced Search" indicating that they are not available in the Find Contacts search.

---
Tags: tags
---


# Question
Title: Can I add fields to the "New Individual" popup window?
When adding a new contribution we have the option of a quick entry popup for "New Individual" when associating it with a contact, which shows up as follows:

Is there a way to add additional fields here? For example, address fields and/or phone number?

# Answer
> 5 votes
Yes you can.

This form is actually a configurable profile. To edit it:

1. Go to *Administer \> Customize Data & Screens \> Profiles*
2. Click on the "Reserved Profiles" tab.
3. Find the "New Individual" profile and click "Fields" to add or modify the list of fields:

---
Tags: civicontribute, contacts
---


# Question
Title: CiviCRM Profile / new contact: is there a way to automatically update the Source Field?
I set up a Profile which collects contact information for new supporters. It automatically creates a new contact record, but I'd like the CiviCRM Source field to be automatically filled in (e.g. Petition Signer). Also, it would be nice if it automatically triggered a thank you email. Is there a way to do these things? Thanks much for a great product!!

# Answer
> 1 votes
If you are using Drupal, Webforms give you full control over these things.

---
Tags: profile
---


title: Can a household register online?

text:
# Question
Title: Can a household register online?
I'm testing CiviCRM for a camp, and some of the families that come to a week of Family Camp are very large (some have 10+ kids). I tried the "Register additional participants" method for a large test family, and it

1. Took forever,
2. Generated massively long email receipts, and
3. Didn't generate any family relationships, shared addresses, etc on the backend. This isn't surprising, but it was depressing to think how much manual cleanup this will require after every single registration.

Household registrations seem to be a good potential solution. I cannot find a mechanism for anyone to act as a household, but some of the settings, such as allowing a household to edit member's addresses, seem to indicate that this is possible.

Is there a way that an external constituent can register a household for an "event" (camp session)?

# Answer
If you are using Drupal as your CMS, then the answer is "yes". The drupal Webform-CiviCRM Integration module allows you to set up a form to register one or more people for any number of events, with full control over creating relationships, sharing addresses, sending a concise email recipt, and customizing the look and feel of your form.

For more information, see the user manual, or this how-to video from CiviTeacher.
> 5 votes

# Answer
For drupal you can use webform civicrm. This related discussion may be useful which also talks about alternatives:https://forum.civicrm.org/index.php?topic=27970.0
> 1 votes

---
Tags: civievent, registration, households
---


# Question
Title: Editing the Batch entry form/template fields
I am looking at the batch data entry form and wondering if it is possible to modify this:

For example, I'd like to remove some columns (e.g. *Invoice ID*) and add others (e.g. *Campaign*).

Is there a way?

# Answer
> 2 votes
I was overthinking this and missed the memo in green in my own screenshot. Another case where the solution is in the Reserved Profiles.

**Administer \> Customize Data and Screens \> Profiles \> Reserved Profiles \> Contribution Bulk Entry**

---
Tags: civicontribute, civicampaign, batches
---


title: change default 'district'

text:
# Question
Title: change default 'district'
CiviCRM newbie here!

When I want to add a new contact (individual or organisation) to the db there're a set of checkboxes under the 'District' accordion – District A, B, etc

How do I change those options to postcode AB1, AB2 etc, for example?

Also, how do I change the title of the accordion itself?

TIA

# Answer
> 2 votes
Welcome! In future: it would help if you tell us what version of CiviCRM you are using with what CMS. Also, it looks like you are working on a customised version of CiviCRM. The tab 'District' is not part of core CiviCRM, but looks like a Custom Group.

If you select 'Administer/Customize Data and Screens/Custom Fields' in your menu you will get a list of custom sets. I expect you will see 'District' there. If you click on 'More' and then 'Settings' you can change the label (and hit 'Save') which will then also be the title of the tab.

If you are then back in the list with Custom Data, you have to click on 'View and Edit Custom Fields'. This will show a list of fields in the group. One of those (and possibly the only one) will be 'Districts'. You should see an option 'Edit Multiple Choice Options' which will allow you to change the options.

This is all on the assumption that this is a custom group :-)

---
Tags: contacts
---


title: Column sorting not working

text:
# Question
Title: Column sorting not working
I have civicrm 4.4.2. When I try to order any search result by other columns, I always get the same message:

> *No matches found for: Contacts IN Administrators AND Group Status - "Added" Suggestions: check your spelling try a different spelling or use fewer letters if you are searching within a Group or for Tagged contacts, try 'any group' or 'any tag' add a New Individual, Organization or Household make sure you have enough privileges in the access control system*

I have tried with Firefox 31.5, with IE9, and Chrome 47.0. When I click the different columns, a parameter appears in the ULR ...&crmSID=4\_u The only one working is the default one &crmSID=1\_u (first column).

Any help? Thanks!

# Answer
You should start by upgrading to the latest version in the 4.4 series. (4.4.20).

The problem you refer to sounds like a bug that was fixed in a later point version of the 4.4 series. We are using 4.4 and can sort successfully by all but State.
> 1 votes

---
Tags: sort-order
---


# Question
Title: How to get a participant list of multiple events ordered by event name
I want to get a list of participants of multiple events ordered by event name (primary) and participant name (secondary) but I don't know how to accomplish this with CiviReport. The result should look like this:

I'm only able to sort by the participants name. And group by event name results a list of events, not participants.

Currently I'm using CiviCRM version 4.6.10. In 4.3.4 it was possible to accomplish such a list but I'm not able to reuse those reports (blank screen on request).

# Answer
Which report template are you using?

I'm able to bring up a list like this using the Event Participant Report (list), just by sorting by Event and then name - by default it sorts by name first - and not using any grouping.

It doesn't change the column layout - it still has the name first, but it is ordered by event first.

(I have noticed some old saved reports failing after upgrades, but haven't had problems recreating them)
> 2 votes

---
Tags: civievent, civireport
---


title: REPORTS-Participant List 4.6.10

text:
# Question
Title: REPORTS-Participant List 4.6.10
I edited the report for our needs, which is a primarily a list of attendees. We only require the following for our reporting needs:

Name Organization Event Status Start Date End Date

I cannot get anything when I preview the report.

I input in filter:

Participant Status: Attended

Participant Role: Attendee

Event Type: I clicked on all the events I would need attendee info for

then I input a start and end date

I get no names at all - blank

Under columns I checked off what I needed as well

?????

I am not a programmer.

# Answer
> 3 votes
I've had the same problem - it's a bug in the current version of the Participant list Count Report which should be fixed in the next release. The bug report is here: https://issues.civicrm.org/jira/browse/CRM-17485

It's the participant role filter that is causing the problem. If you de-select the participant role, you should see all the participants. Depending on what else you need from the report, you might be better off using the 'Event Participant Report (List)' report.

---
Tags: civireport
---


# Question
Title: Problem processing payment after CiviCRM Drupal to Wordpress migration
After migrating from Drupal to Wordpress, my payment processor is no longer working.

After having gone to the payment processor I am redirected to the URL: ?page=CiviCRM&q=civicrm/payment/ipn&processor\_name=Sagepay.....

The error I get is: You do not have permission to execute this url.

Any help in getting to the bottom of this would be appreciated!

# Answer
> 1 votes
A bit of a stab here, but have you checked the Wordpress Access Control (**Administer \> Users and Permissions \> Permissions (Access Control) \> WordPress Access Control**) settings to make sure that Anonymous users have access to the "*CiviContribute: make online contributions*" permission?

---
Tags: wordpress, payment-processor
---


# Question
Title: Any happy IE8 users with civicrm image display issues?
We've discovered an issue while trying to display civicrm contact image via Drupal Views in Internet Explorer 8, it shows famous red cross instead of image; interesting thing happens when direct image url is being loaded, here is it:

We're aware that currently (CiviCRM 4.6) ImageCache presets don't play nice with Civicrm image (there are civicrm forum discussions here: https://forum.civicrm.org/index.php?topic=34929.0 and here: https://forum.civicrm.org/index.php?topic=32232.0 ) but no clear resolution so far. We realize it's quite historical and rare case nowadays, however, have hope someone out here might be able to shed some light on this.

# Answer
Not exactly a fix, but rather a workaround: https://www.drupal.org/project/imagecache\_external module has been used for an additional image pre-processing. Images processed by drupal imagecache module work just fine in IE8.
> 2 votes

---
Tags: images, contact-image
---


# Question
Title: CiviCRM 4.6 - Duplicate memberships/memberships inheriting themselves. Screenshot included
We have permissioned relationships where an Organization will own a primary membership and members will inherit this membership.

We've run into an issue where the Organizational membership will inherit its own membership and the only way to fix is to delete and re-create it. See the screenshot. Anyone experience this before?

There was a similar issue described for CiviCRM 4.3/4.4 posted on the CiviCRM forum here: https://forum.civicrm.org/index.php?topic=29822.0 -- but this does not seem to relate to our issue.

# Answer
It could be that you have the Relationship setting on the Membership Type wired back to front. Can you pls provide details of the settings on the Membership Type, ie are you using Employer of, or Employee of, or something else, and please make it clear which is Contact A and Contact B in the Relationships
> 3 votes

# Answer
I have something like this happening with parent/child relationships.

Relationship type of the membership is defined as "Parent of" and "Partner of"

When entering children and setting relationship as child of both parents (and parents are marked as being partners of each other), they are inheriting the membership from both parents and membership is showing up twice. Would be cool if it would only inherit from the primary member.
> 1 votes

---
Tags: civimember
---


# Question
Title: Why do reminders not go out to some of the contacts who should receive them
Situation is that having ruled out contacts with no emails, blocked, etc there are still some contacts that are not having reminders created/sent

# Answer
> 2 votes
One reason could be that an existing Reminder had its criteria changed! EG ... X was sent a scheduled reminder for reminder no 14 on 23 Jan 2015 and the entry relates to his membership end date being 31 Dec 2015.

At the time the reminder was sent scheduled reminder no 14 was configured to send a mail 23 days **after** the expiry date (then 31 Dec 2014). On 25 May the reminder was changed to send out 7 days **before** expiry date.

The reference\_date column was not added until 28 August and at that point the current end\_date was stored for the reference date. There was some calculation that went on regarding this but to the extent that it was correct in general terms, it was messed up by this reminder's history.

# Answer
> 2 votes
Zombies? (is\_deceased, do\_not\_email etc may be NULL rather than 0)

See: https://civicrm.org/blogs/andrewhunt/new-extension-finds-zombies

---
Tags: scheduled-reminders
---


# Question
Title: Changed URL, but Event and Contributions modules not recognizing the change
Hope someone can help me.

I changed the URL, the directories and server are the same, and I still keep the old domain as well. I have changed the directories, cleaned the cache and followed the instructions for moving the server (even though I did not change servers, only the Domain name).

Everything works fine, the url address is the new address and all the links work great, until I go to an Event and someone tries to register. Once the person clicks on 'register here' the url goes back to the old one. What setting am I missing???

In the contributions the same thing happens it does not recognize the new domain and it goes back to the homepage with the old URL.

For example, I am in

http://NEWDomain//index.php?option=com\_civicrm&task=civicrm/event/info&Itemid=146&reset=1&id=59

Once I click Register it goes to

http://OLDDomain/index.php?option=com\_civicrm&task=civicrm/event/register&Itemid=146&id=59&reset=1

Any ideas why?

# Answer
It sounds like you changed your URL in the CiviCRM user interface, but perhaps not in your civicrm.settings.php file. In that file you will need to look for and adjust your CiviCRM Base URL to the new domain.
> 3 votes

---
Tags: civievent, civicontribute
---


# Question
Title: Error while installing CiviVolunteer on civicrm 4.6.5
When trying to install CiviVolunteer with CiviCRM 4.6.5

Wordpress 4.2.3 and CiviVolunteer4.5-1.4.0

I get the error:

"'Multi-select' is not a valid option for field html\_type"

# Answer
Based on this screenshot, two possibilities occur to me, neither of which I like very much:

* Something is different about 4.6.5, and it no longer accepts 'Multi-select' as an HTML type. In the code for the extension, this appears on line 433 of CRM/Volunteer/Upgrader.php. In some other usages of this HTML type, I see it referred to as 'Multi-Select' (note the different capitalization) -- it could be that capitalizing the S solves the problem for you. If so, please let me know, and we'll make sure that goes into the next release.
* I see you're not running CiviCRM in English. Is your site running in French only, or is it a multilingual site? I'm not sure yet why this would matter, but I've seen strange things occur with the schema changes, etc. that come with a multilingual site -- there are some circumstances CiviVolunteer doesn't account for. It seems like a long shot that the problem is related, but I thought I'd ask anyway.

The failure occurs during a step of the installation that creates custom fields for the volunteer contact subtype. Since the API call that performs this task has worked with previous versions of CiviCRM, I suspect something has changed with the parameter validation, either in the API itself or further down the stack. Either this change was intentional and CiviVolunteer should be updated, or it was unintentional and we should consider filing a regression bug.

Note: I haven't yet tried to reproduce this on a test copy. I'd say this is a necessary step before speculating much further.
> 3 votes

# Answer
I also get this error when installing either civivolunteer 1.4.1 or 2.0beta1 on civicrm 4.6.10. I tries to manually apply the uninstall.sql and retry but with no succes. Also changes our language back to english, did not work. Not sure what answer would solve this.

```
CiviCRM_API3_Exception: "DB Constraint Violation - possibly custom_group_id should possibly be marked as mandatory for this API. If so, please raise a bug report"

#0 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm_extensions/org.civicrm.volunteer/CRM/Volunteer/Upgrader.php(491): civicrm_api3("customField", "create", (Array:7))
#1 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm_extensions/org.civicrm.volunteer/CRM/Volunteer/Upgrader.php(54): CRM_Volunteer_Upgrader->createVolunteerContactCustomFields(116)
#2 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm_extensions/org.civicrm.volunteer/CRM/Volunteer/Upgrader/Base.php(248): CRM_Volunteer_Upgrader->install()
#3 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm_extensions/org.civicrm.volunteer/volunteer.civix.php(50): CRM_Volunteer_Upgrader_Base->onInstall()
#4 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm_extensions/org.civicrm.volunteer/volunteer.php(123): _volunteer_civix_civicrm_install()
#5 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(78): volunteer_civicrm_install()
#6 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(50): CRM_Extension_Manager_Module->callHook(Object(CRM_Extension_Info), "install")
#7 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Extension/Manager.php(233): CRM_Extension_Manager_Module->onPreInstall(Object(CRM_Extension_Info))
#8 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Admin/Form/Extensions.php(195): CRM_Extension_Manager->install((Array:1))
#9 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Form.php(345): CRM_Admin_Form_Extensions->postProcess()
#10 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess()
#11 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
#12 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), "next")
#13 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), "next")
#14 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("next")
#15 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller->run()
#16 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(174): CRM_Core_Page_Basic->edit(1, NULL)
#17 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Admin/Page/Extensions.php(125): CRM_Core_Page_Basic->run()
#18 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Extensions->run((Array:3), NULL)
#19 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#20 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#21 /home/ozk/domains/onvergetelijk.nl/public_html/prod/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
#22 [internal function](): civicrm_invoke("admin", "extensions")
#23 /home/ozk/domains/onvergetelijk.nl/public_html/prod/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
#24 /home/ozk/domains/onvergetelijk.nl/public_html/prod/index.php(21): menu_execute_active_handler()
#25 {main}

```
> 0 votes

# Answer
I did the same installation on civicrm version 4.6.5 with drupal it went alright without any error - so, Please try to install the same again or please install civicrm again
> -2 votes

---
Tags: civivolunteer
---


# Question
Title: Can I find the target contact ID in hook_civicrm_buildForm?
**Summary**

Is it possible to extract the target contact ID of a form during hook\_civicrm\_buildForm?

**Details**

We are trying to manipulate a wide range of fields across the site, ones that might be present in event registration forms, contact profile forms, etc.

We want to disable editing of the field if there is a value in it, and the contact has a certain value on their record.

The workflow we have in mind is...

* Is 'Field A' on the form?
* If yes, does 'Field A' have a value already?
* If yes, is there a 'target contact' for the form (ie: a logged in user is registering for an event, or updating their profile)
* If yes, fire an API call to get the value of 'Field X' from the record of the target contact.
* If 'Field X' is 'Yes' then disable editing of 'Field A' on the form.

We understand that not all forms will have a target contact ID, and we would only want to go through this logic if there was one. So it wouldn't do any of this if an anonymous user was signing up to an event; but would if a logged-in user was.

The logic itself isn't the problem, but we can't seem to find the target contact ID stored anywhere at this point.

Thanks in advance!

# Answer
> 1 votes
There is no target contact ID stored in the $form, however...

As ErikH mentioned, most of the time the logged-in user fills in the form themselves. In that case, you could retrieve the `contact ID` like this:

```
$session = CRM_Core_Session::singleton();
$contactId = $session->get('userID');

```

If another user or admin is filling in the form for another contact, the URL should have something like cid=xxx specified. It's true for participant registration and profile editing.

There is still the case of a new contact, either with cid=0, either if not logged in (session does not contains userID).

# Answer
> 1 votes
Not sure about them, but you can at least always retrieve the logged in user? Like so:

```
$session = CRM_Core_Session::singleton();
$userId = $session->get('userID');

```

# Answer
> 0 votes
It really depends on the entity you are processing I guess....if you are working on the activity form, you can get the activity id and with that id retrieve the target it from the API? Or from the table civicrm\_activity\_contact directly using CRM\_Core\_DAO::executeQuery?

# Answer
> 0 votes
Just in case, alternative solution via hook in Drupal module:

```
function MYMODULENAME_civicrm_buildForm($formName, &$form) {
# Form we work with, print_r($formName) for name;
  if ($formName == 'CRM_Profile_Form_Edit') {
     $curr_user_civiID = $_SESSION['CiviCRM']['userID'];
# Check if it matches current user's civicrm contactID via print_r($curr_user_civiID);
 }
}

```

---
Tags: hooks, forms
---


# Question
Title: 404 Error with all links on Administer Page
I just installed fresh CiviCRM 4.6.10 on Wordpress 4.4

Everything seems to be working fine and it looks like this crm is perfect for our needs but I am running into one problem-

If I go to Administer \> Administration Console on the dropdown menu, every single link on that page brings me to a 404 not found error. EX: clicking on Organization and Contact info this is the URL I am getting a 404 not found http://(site)/civicrm/admin/domain?action=update&reset=1

But, if I go on the dropdown menu to Administer \> Administration Console \> Configuration Checklist and edit settings from links in there.. everything seems to be fine. URL for Organization Address and Contact Info is http://(site)/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fdomain&action=update&reset=1&civicrmDestination=%2Fwp-admin%2Fadmin.php%3Fpage%3DCiviCRM%26q%3Dcivicrm%2Fadmin%2Fconfigtask%26reset%3D1

Seems like something is wrong and the full URL isn't linked in the Administration Console?

Any help is appreciated. Thanks

# Answer
Have you set the base URL correctly?

You can set this at: `http://[site]/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/updateConfigBackend&reset=1`

The default setting for this is: `http://[site]/`

See the Wiki for more details.
> 1 votes

---
Tags: wordpress, error
---


# Question
Title: contribution page PayPal error "The link you have used to enter the PayPal system contains an incorrectly formatted item amount"
Strange problem. I've just added a new price field to the price set on my membership renewal form, and whenever that price field is used, the link to PayPal fails with this error on the PayPal side:

"The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

Any submissions made where there is no data entered for this field work correctly.

I've tried recreating the price field, changing the price, and changing the order of the fields. But the result is the same: the confirmation pages show correct totals, but if that one line item is included, PayPal throws this error.

Any ideas?

# Answer
> 1 votes
Well, asking the question seems to have helped me find the answer on my own :-)

Turns out that a custom extension for adding a percentage surcharge was not rounding the result of its calculations to two decimal places. Therefore, the total value calculated and sent to PayPal had more than two decimal places in the cents -- which PayPal doesn't accept. However, the DISPLAYED total amount value on the confirmation page DOES round to two decimal places, so it's hard without looking at the actual PayPal data to see the problem.

The form worked fine as long as all the prices were in whole dollars, but the new price item included cents. Pure percentage calculations with cents were almost always producing surcharge values with hundredths and thousandths of cents.

Putting in a round() function on the offending calculation solved the problem.

Hope this helps someone else!

---
Tags: civicontribute, civimember
---


# Question
Title: How can I modify the displayed discount message?
Are there any controls for the displayed discount message?

I'd like to change the message and, if possible, not show it depending on user criteria - membership, etc.

A nice to have would be to have control over the location.

I can't seem to find documentation on this extension

Thanks

# Answer
> 1 votes
Documentation isn't complete but is available here. It specifically mentioned control over the location as something that doesn't exist yet. If you're JavaScipt-savvy, a single line of jQuery will let you move the box wherever you want; a second line will let you control the wording. I wish there was an answer for non-coders to do what you're asking for. If this is important to you and you're not a coder, you might be able to fund someone (either the core team or another CiviCRM developer) to add those features.

---
Tags: cividiscount
---


# Question
Title: Social Media: In receipts, {$url} incorrect from SocialNetwork.tpl, SEF URL, missing buttons
I have done a search here, bug reporting and general web search to no avail.

Platform: CiviCRM 4.6.8 on J!3.4.4

1. Problem: In CiviContribute, seems in both the receipts, webpage and email confirmation, the token {$url} is not being appended correctly for both the Twitter and Facebook buttons contained in `/administrator/components/com_civicrm/civicrm/templates/CRM/common/SocialNetwork.tpl`. Here are the results for both:

Twitter:

> Donate to Domain Name https://domain.org/index.php?option=com\_civicrm

Facebook:

> https://domain.org/component/civicrm/?amp%3Btask=civicrm%2Fcontribute%2Ftransact&amp%3Breset=1&amp%3Bid=1&fb\_action\_ids=10206214067365432&fb\_action\_types=og.likes
2. Also, is there a token for grabbing whichever (SEF) URL is being used for the landing contribution form page? Or, if desired to just hand code the absolute URL, what is the format in that line?

From the Twitter dev page the above doesn't look correct. Please confirm: https://dev.twitter.com/web/tweet-button/parameters
3. Also, on the webpage receipt confirmation, Twitter, G+, Facebook and LinkedIn are listed but in the email receipt only Twitter and Facebook buttons appear.

Please advise. Thank you in advance.

# Answer
@BruceW

I have created an issue and included a patch.

look at here. Hopefully this resolve it.

https://issues.civicrm.org/jira/browse/CRM-17725

Regards Kajan
> 1 votes

---
Tags: civicontribute, tokens, receipts, 4.6.8, social-media
---