# Question
Title: How do I hide wordpress and get pretty urls
I know that "standalone" civicrm is not supported, but I'd still like to get rid of the wordpress side menu, and just see the civicrm top menu. i'd also like to have pretty bookmarkable urls like foo.org/contacts/98234 or at least foo.org/civicrm/contacts/9823 And if i go to foo.org, all that would be there is a simple login page for either contacts or staff to use. I'm sure i'm not the first to consider the cms-crm combo to be somewhat a fish-bicycle combo? thanks.

-mda

# Answer
> 5 votes
If you don't want or need a CMS, Drupal works a little better than WordPress for this. WordPress wants to make it as easy as possible to run a blog, so it makes decisions for you that can work against having a minimalist framework.

On the other hand, you can easily disable a ton of Drupal's functionality and even make CiviCRM the homepage. Direct URLs to CiviCRM contacts aren't quite as pretty as you like, but they're much more concise than WordPress or Joomla: `foo.org/civicrm/contact/view?cid=1234&reset=1` brings up contact 1234.

Working with Drupal also gives you a lot more flexibility in your page layout: you can use any theme, and there are a number of blocks (widgets in WP parlance), unavailable in WordPress, for CiviCRM admins that let you view the most recent contacts, quickly add new activities/contacts/etc., and more.

A friend mocks Drupal by saying that it's like going to the car dealer and being asked, "Would you like a steering wheel with that? How about a brake pedal?" WordPress makes it easy to build a basic website because it makes a lot of assumptions. However, if you just want a stripped-down framework to render CiviCRM and let people log in, Drupal's lack of assumptions will make it a lot easier.

# Answer
> 4 votes
First of all, I am a non-developer, non-web server guy. But I do know a lot about application systems. I have been using CiviCRM on WordPress for about a year and it has helped our organization greatly.

I am sure there is a much better to do what you ask but I have a solution;

* I used a plugin called Adminimize. This plugin allows you to remove WordPress admin items from the display based on type of user. I removed all the stuff on the left side for all users except Administrators.
* I created a home page for my site and just put a logon feature. I am just using the wordpress logon widget that is with my theme. I also created a menu item that appears after logon and when clicks takes the user to the CiviCRM dashboard. You could probably also have a redirect to the dashboard upon login.

I only have about 10 users so I have not looked for a better solution. However, I will be expanding within 6 months and would like to know if there is a more appropriate solution.

---
Tags: wordpress
---


# Question
Title: Chain API call cascade, pass second value as third call argument, "id is not a valid integer"
While making a cascade API call, a roadblock has been hit, here's a code:

```
$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => "id",
  'id' => array('IN' => array(168, 169)),

 // Second call

    'api.Relationship.get' => array(
      'return' => "contact_id_a",
      'contact_id_b' => "\$value.id",
      'relationship_type_id' => 4,
      'is_permission_b_a' => "1"),

          // Third call

        'api.Contact.get' => array('id' => array(
           'IN' => array("\$value.api.relationship.get"))), // <-- here
));

```

It returns

```
{
    "error_field": "id",
    "type": "integer",
    "error_code": 2001,
    "entity": "Contact",
    "action": "get",
    "is_error": 1,
    "error_message": "Error in call to Contact_get : id is not a valid integer"
}

```

What exactly returns third call and how these results should be properly "plugged in" to get correct output? Thanks anyone for any bit of advice!

# Answer
so you are trying to fetch the details of contacts that are related to the ones you search for first? The $value refers to the last call in a nested one.

```
$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => "id",
  'api.Relationship.get'
   => array(
     'contact_id_a' => "\$value.id",
     'api.contact.get' => "\$value.contact_id_b"),
));

```

If you want to give more params to the inner api.contact.get:

```
$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => "id",
  'api.Relationship.get'
   => array('contact_id_a' => "\$value.id",
     'api.contact.get'
      => array(
        'id' => "\$value.contact_id_b",
        'sequential' => 1,
        'return' => "display_name"
      )
    ),
  )
);

```
> 1 votes

---
Tags: api, relationships, developer, chaining
---


# Question
Title: Recommended process for credit card additions/'edits' to event registrations?
Using CiviCRM 4.6.4 and Drupal 7.41, we have a large event set up with complex pricing (3000+ registrants each year, lots of price options). Folks forget to register for things the first time through, or they change their mind.

We haven't been able to determine a good way to process these people who need to edit their fee level choices. I can edit fee level choices just fine when there isn't any money involved, but don't see a good way to make a 'credit card 'edit' to a registration'.

To make it more difficult, we would prefer to turn 'multiple registers with same email' *off*, because we tend to have admin assistants and the like sign up many folks under one email and it takes a lot of staff time to sort that out.

The fee level choices must be accurate and held in a single event record (no dupes for the event) to print the correct badge onsite, so if we do need to submit a second registration we would have to create a new with all fee level choices and delete the old ones. This tends to cause the financial tally to be off and is a different admin headache, but this is the route we have taken for now.

Does anyone have a recommendation for processing these credit card edits without the admin headaches?

# Answer
You're not the only one looking for this solution, but it has been unfunded so far because it would be so complex.

As an alternative, you might consider separate events, either using the Event Additional Signup extension or the new conference session features. People who come back later and want to sign up for an additional option can just sign up for the event directly.

You'd then have a different, but much simpler, customization to build out: just getting the appropriate events onto someone's badge.
> 6 votes

---
Tags: civievent, registration
---


# Question
Title: How do I configure printing to format properly?
We have a WordPress install that has never had the report printing formatted properly. A report list does not have columns and rows with lines around cells. Attached is an example from my system and one from the CiviCRM demo WordPress site.

What do we need to do to get properly formatted reports.

# Answer
This is a known bug that is fixed in 4.6.11--I discovered it on a client's site. Basically, if your report doesn't have the header explicitly saved in the report settings, the header is blank rather than the default. The default header contains the CSS to make your report look like it should.

The simplest solution is to upgrade, or you can apply the diff.

Finally, a rough option is to edit the header and footer manually. Your header should be:

```
<html>
  <head>
    <title>CiviCRM Report</title>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
    <style type="text/css">@import url(/wp-content/plugins/civicrm/civicrm/css/print.css);</style>
  </head>
  <body><div id="crm-container">

```

and the footer should be

```
<p><img src="/wp-content/plugins/civicrm/civicrm/i/powered_by.png" /></p></div></body>

```

You'll need to paste this in for each report, so it's more efficient to just upgrade, but if you're in a pinch trying to get the report out right away, this will help.
> 2 votes

---
Tags: civireport
---


title: Where is invoicing information stored?

text:
# Question
Title: Where is invoicing information stored?
I enabled "Billing address required" on my event. Registering now shows fields to fill in.

But where do I look to retrieve it? It's not in the registration nor in the payment info, as far as I can see.

# Answer
> 2 votes
It's on the contact itself. It has become one of the addresses, the billing address.

---
Tags: civievent, invoice
---


# Question
Title: Soft credit / honoree info in a token for Thank You letters?
I have hunted and not found anything so I am assuming that this does not exist -- but thought I'd ask just in case. I'd like to be able to reference the soft credit / honoree information in Thank You letters but can't find this as a token.

I guess it's tricky to do this as a token since it relates to a specific contribution and not the contact in general. What is the best way to try to do this?

# Answer
Here's an attempt to address this with a token that can be used with Fuzion's CiviToken extension. With that extension installed, this token file can be added to a `tokens` directory in your custom PHP folder to provide a "Latest Contrib Soft Credit Name" token. (It checks the latest contribution and if there is a soft credit adds the name(s) in this token). The caveat being that it only checks the latest contribution and won't work for previous contributions.

https://github.com/laryn/nz.co.fuzion.civitoken/blob/master/tokens/latestcontribs.inc

File: **tokens/latestcontribs.inc**

```
<?php

function latestcontribs_civitoken_declare($token){
  return array(
    $token . '.softcredit_name' => 'Latest Contrib Soft Credit Name',
  );
}

function latestcontribs_civitoken_get($cid, &$value, $context){
  $params = array(
    'sequential' => 1,
    'contact_id' => $cid,
    'options' => array('sort' => "receive_date DESC", 'limit' => 1),
  );
  $softcredit_formatted = "";

  $softcredit_name = civicrm_api3('Contribution', 'getsingle', $params);

  if (isset($softcredit_name['soft_credit'])) {
    $connector = "";
    $i = 0;
    $total = count($softcredit_name['soft_credit']);
    foreach($softcredit_name['soft_credit'] as $softcredit) {
      $i++;
      $softcredit_formatted .= $connector.$softcredit['contact_name'];
      if ($i == ($total-1) ) {
        $connector = " and ";
      } else {
        $connector = ", ";
      }
    }
  }
  $value['latestcontribs.softcredit_name'] = $softcredit_formatted;
  return $value;
}

```
> 4 votes

---
Tags: civicontribute, tokens, message-templates, honoree, soft-credit
---


# Question
Title: Adjusting the Contact selection display (e.g. New Contribution)
When adding a new contribution (as well as a few other places, I believe) we have the option to auto-complete a contact's name or create a new contact:

When we begin typing, a list of contacts appears, including email addresses if they have one:

Is there a way we can adjust this display to show different/additional information? For example, we may want to show city in small writing like the email address currently shows:

> Adams, Daren
>
> darena55@hotmail.co.in (Bangalore)

# Answer
You can, from the menu:

*Administer \> Customize Data and Screens \> Search Preferences.*

The setting to adjust is **Autocomplete Contact Search**. There are a number of choices you could include. This doesn't impact the field in question only though. The biggest additional impact would be the Quick Search. Note the help text:

> Selected fields will be displayed in back-office autocomplete dropdown search results (Quick Search, etc.). Contact Name is always included.

---

The next option down on Search Preferences (Contact Reference Options) may come into play for certain fields as well. Its help text:

> Selected fields will be displayed in autocomplete dropdown search results for 'Contact Reference' custom fields. Contact Name is always included.
> 4 votes

---
Tags: contacts
---


title: copies of events appearing continually

text:
# Question
Title: copies of events appearing continually
Civi 4.6.10 Joomla 3.4.5

Our events after being created at some pointed are being copied by the system. Note the following id numbers as well. Original event was 4352.

LILA TEST RECORD (ID: 4352)

Copy of LILA TEST RECORD (ID: 4370)

Copy of LILA TEST RECORD (ID: 4420)

Copy of LILA TEST RECORD (ID: 4470)

This happened to us in the old version. I have over 451 event copies to delete now.

here is another sample it even went back to 2012:

Copy of Advanced Air Sealing (ID: 3871) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Advanced Air Sealing (ID: 4217) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Advanced Air Sealing (ID: 4218) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Advanced Air Sealing (ID: 4219) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Advanced Air Sealing (ID: 4022) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Advanced Air Sealing (ID: 4562) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Advanced Air Sealing (ID: 4563) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Copy of Advanced Air Sealing (ID: 4564) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Advanced Air Sealing (ID: 4565) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Copy of Advanced Air Sealing (ID: 4566) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Advanced Air Sealing (ID: 4567) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Copy of Advanced Air Sealing (ID: 4568) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

Copy of Advanced Air Sealing (ID: 4332) Smyrna New York Advanced Air Sealing No Aug 07, 2012 8:00 AM Yes

again note the ID numbers....

# Answer
> 1 votes
It doesn't feels like a CiviCRM Core problem to me but I don't know what else it could be either.

The "Copy of" seems to indicate that it use the CRM\_Event\_BAO\_Event::copy as if used by the Copy action in manage event page.

You may check for any custom code that could contains `CRM_Event_BAO_Event::copy` or something like that.

You could also try to disable CiviCRM extensions or Joomla extensions one by one and see if it keeps happening

---
Tags: civievent
---


# Question
Title: Why did we lose contact data after deleting the default location type "Home"?
So we lost 2/3 of our email and addresses on 6/15 around 1pm. Everything else seemed fine. I was able to get the civi log that pointed to a deletion command (DELETE FROM civicrm\_location\_type) around the same time. We have no idea how this happened. Thankfully we were able to make a new database from a backup file and not much damage was done.

Does anyone know what could have caused this and how we could prevent it in the future? Thanks!

Here's the log:

```
Jun 15 13:11:01  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`gbapgh_civicrm`.`civicrm_mapping_field`, CONSTRAINT `FK_civicrm_mapping_field_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`))]
    [type] => DB_Error
    [user_info] => DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`gbapgh_civicrm`.`civicrm_mapping_field`, CONSTRAINT `FK_civicrm_mapping_field_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`))]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`gbapgh_civicrm`.`civicrm_mapping_field`, CONSTRAINT `FK_civicrm_mapping_field_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`))]"]
)

Jun 15 13:11:01  [info] $backTrace = #0 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(239): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: constraint violation", -3, 16, (Array:2), "DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 )  [...")
#4 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-3, 16, (Array:2), "DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 )  [...")
#5 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -3, NULL, NULL, "DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 )  [...", "DB_Error", TRUE)
#6 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-3, NULL, NULL, NULL, "1451 ** Cannot delete or update a parent row: a foreign key constraint fails ...")
#7 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 ) ")
#9 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 ) ")
#10 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1456): DB_DataObject->_query("DELETE FROM civicrm_location_type  WHERE (  civicrm_location_type.id = 1 ) ")
#11 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/LocationType.php(179): DB_DataObject->delete()
#12 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/LocationType.php(96): CRM_Core_BAO_LocationType::del("1")
#13 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(328): CRM_Admin_Form_LocationType->postProcess()
#14 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(162): CRM_Core_Form->mainProcess()
#15 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(60): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_LocationType), "next", "Next")
#16 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_LocationType), "next")
#17 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_LocationType), "next")
#18 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("next")
#19 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller->run()
#20 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(178): CRM_Core_Page_Basic->edit(8, "1")
#21 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(331): CRM_Core_Page_Basic->run((Array:3), NULL)
#22 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:13))
#23 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#24 /usr/home/gbapgh/public_html/go-gba/wp-content/plugins/civicrm/civicrm.php(506): CRM_Core_Invoke::invoke((Array:3))
#25 [internal function](): CiviCRM_For_WordPress->invoke("")
#26 /usr/home/gbapgh/public_html/go-gba/wp-includes/plugin.php(505): call_user_func_array((Array:2), (Array:1))
#27 /usr/home/gbapgh/public_html/go-gba/wp-admin/admin.php(212): do_action("toplevel_page_CiviCRM")
#28 {main}

Jun 15 13:41:30  [info] r_authresponse X07

Jun 15 13:41:30  [info] r_code 03924D1557233524:YYYM:

Jun 15 13:41:30  [info] r_tdate 1434390089

Jun 15 13:41:30  [info] r_avs YYYM

Jun 15 13:41:30  [info] r_ordernum A7DEDC06-557F0E49-608-E0474

Jun 15 13:41:30  [info] r_error

Jun 15 13:41:30  [info] csp FDMS

Jun 15 13:41:30  [info] r_message APPROVED

Jun 15 13:41:30  [info] r_ref 1557233524

Jun 15 13:41:30  [info] r_time Mon Jun 15 13:41:30 2015

Jun 15 13:44:08  [info] $Fatal Error Details = Array

```

# Answer
This is a result of someone going in CiviCRM and deleting the Home location type, either through **Administer \> Customize Data and Screens \> Dropdown Options \> Location Types** or clicking the wrench next to the dropdown of location types on some other form.

It's obviously not a good idea to do that if you have a lot of email addresses, phone numbers, and postal addresses with that location type; doing so will actually give you the message:

> WARNING: Deleting this option will result in the loss of all location type records which use the option. This may mean the loss of a substantial amount of data, and the action cannot be undone. Do you want to continue?

I hope/assume that nobody did that on purpose, but you might double-check with everyone with that permission.

If you can't track down who did it, you should assume someone has compromised your system and has admin permissions (or potentially full shell and/or MySQL access such that they could create a user). At the very least, each user should change passwords, and you should review all user accounts in WordPress. To be truly safe, you might reset/reinstall everything in your hosting environement, replace all your WordPress, CiviCRM, and other plugins' code with freshly-downloaded copies, manually review any other files one-by-one, and check your database for anything fishy.
> 5 votes

# Answer
As well as Andrew's answer, which involves directly deleting the Location Type, I believe there is a route that this can be done inadvertently when editing a single contact record in order to delete a single address record. This came up on this JIRA ticket.

In the scenario we investigated, it seems that the user was editing a single record, and in order to edit a single address entry they accidentally / inadvertently clicked on the 'spanner' icon to the right which opens up the Location Type page, and this gives access to the Delete button which it is concievable the person might click on thinking they are deleting the single Address, rather than the Location Type.

They do then get the big warning noted in Andrew's answer which we are suggesting could be improved in the JIRA ticket.

Note that the user requires 'administer CiviCRM' permission to get that link to edit location types.

It was possible to restore the data from the log\_tables in this case.
> 2 votes

# Answer
I've seen this happen three times now - someone intends to delete an email/address/phone number, ends up attempting to delete the entire location type. I decided this was too dangerous, so as of CiviCRM 4.6.12 and 4.7, you can no longer edit location type when inline editing phone/email/address/IM. See https://issues.civicrm.org/jira/browse/CRM-17273 for details.
> 2 votes

# Answer
I'm curious about your claim that you lost all that data. Is it possible it's there but just not showing up where you expect? The location type is just a way of classifying the data that lives in it's own tables.

Unless there's another trigger that clears all the data, it's possible that the data is still there and could be recovered by adding a new location and then using sql to update the id of that new location so it's connected to all the existing actual data. Your error suggests that because of the foreign key dependency the type wasn't even deleted, but maybe just the label.
> 0 votes

---
Tags: database, security
---


# Question
Title: CiviDiscount - what is the correct URL for contribution pages
I am working with CiviDiscount 3.1, CiviCRM 4.6.9 and latest Drupal. I have set up a membership discount and would like to use it on contribution pages.

According to documentation, for Event Pages the URL is supposed to be like this: civicrm/event/register?reset=1&id=XXX&discountCode=YYYY

Can anyone tell me how the url is supposed to look for (membership) contribution pages? civicrm/contribute/transact?reset=1&id=1&discountCode=YYYY does not seem to work.

# Answer
The documentation page was outdated. The correct format for event pages is

```
civicrm/event/register?reset=1&id=XXX&discountcode=YYYY

```

and

```
civicrm/contribute/transact?reset=1&id=XXX&discountcode=YYYY

```

for contribution pages
> 4 votes

---
Tags: contribution-page, cividiscount
---


# Question
Title: How long does sourceforge keep older versions / Where can I download an old version?
I tried a couple of the older links at sourceforge, e.g. 4.0.x, 4.1.x, 4.2.x, and I get "file not found" for all of them. How long are older versions archived at sourceforge? If they are really gone, where can I get an older version? I could probably do a subversion checkout from svn.civicrm.org, but then I need to be able to assemble it etc. Web search didn't come up with anything other than sourceforge, or maybe I'm just not seeing it.

Thanks.

P.S. What I really want to do is upgrade a 3.1 site to the latest, but after a couple days effort it just seems like that's going to take forever to track down the errors/dependencies and manually deal with them, so I was hoping to upgrade through intermediate versions incrementally.

# Answer
> 4 votes
**EDIT**: as Coleman pointed out on the forum, SourceForge downloads seem to work sometimes. I just retried 4.1.6 and it worked.

In theory, the upgrade documentation says that we can upgrade from CiviCRM 2.2 to 4.7. I have doubts on that, however upgrading from 4.0 to 4.7 should work. A few years ago, I managed to run upgrades from CiviCRM 1.7 to 2.0, then 2.0 to 2.1, 2.1 to 4.0. So in your case, I would recommend 3.1 to 4.0 (or even 4.1?), then to 4.7.

The are archives available up to CiviCRM 4.1 if you use the following URL:

CiviCRM 4.1:

https://download.civicrm.org/civicrm-4.1.6-drupal.tar.gz
https://download.civicrm.org/civicrm-4.1.6-drupal6.tar.gz
https://download.civicrm.org/civicrm-4.1.6-joomla.tar.gz (etc)

CiviCRM 4.2:

https://download.civicrm.org/civicrm-4.2.19-drupal.tar.gz
https://download.civicrm.org/civicrm-4.2.19-drupal6.tar.gz
https://download.civicrm.org/civicrm-4.2.19-joomla.tar.gz
https://download.civicrm.org/civicrm-4.2.19-wordpress.tar.gz

For CiviCRM 3.0 to 3.3, you will have to use SVN. It's not that bad, although I don't know if it will run on a current version of PHP 5.6. It might work on PHP 5.3.

```
svn checkout http://svn.civicrm.org/civicrm/branches/v3.4 civicrm-3.4
cd civicrm
cd xml
php GenCode.php

```

As you have probably noticed the version number in the above URL (v3.4), you can repeat the same process for versions v3.3, v3.2 and so on.

It doesn't help that the SVN virtual-machine of CiviCRM has been having issues lately (full disk). I cleared up some space, but the issue will only be resolved for good next week (another service needs to be moved off that VM).

Reference: Installing CiviCRM from subversion

Reminder: CiviCRM 3.4 is the same as CiviCRM 4.0, but 3.4 is for Drupal 6 and 4.0 is for Drupal 7.

# Answer
> 2 votes
Sourceforge recently had a major hardware failure and they still seem to be recovering. I don't think the problem is specific to CiviCRM. I was able to successfully download an old version a few minutes ago. It might just depend on what mirror you get.

# Answer
> 1 votes
I checked, and the 4.3.1 was the first that worked via SourceForge.

Yes, upgrading incrementally is the best way to go. I always go from major version to major version, so from 4.0 to 4.1 to 4.2 etc..

If you go that far back as 3.1 you likely even need to consider php versions.

---
Tags: upgrade, installation
---


# Question
Title: Check custom data field value change to trigger activity status change
How would you recommend to check data change (with pre and post values) on a custom field (attached to a case) and then to mark an activity in that case as completed?

I have looked at hooks like hook\_civicrm\_custom and the \_pre/\_post hooks, but having difficulty getting this to work.

Thank you!

# Answer
I finally made this work by applying a modified version of the patch at https://issues.civicrm.org/jira/browse/CRM-9649 which adds an additional array of the previous values for all the custom fields to the hook\_civicrm\_custom hook.

There is also a plan to make the \_pre and \_post hooks consistent by including custom data fields (see https://issues.civicrm.org/jira/browse/CRM-15261). This will also solve the issue I had when done.
> 2 votes

# Answer
I am not sure if it can already do exactly what you want, but my advice is to first look at the CiviRules extension.

https://civicrm.org/extensions/civirules
> 3 votes

---
Tags: custom-fields, civicase, activities
---


# Question
Title: CiviReport: Cannot remove Contact ID filter
Suddenly a filter on Contact ID is unexpectedly appeared on my "Constituent Detail" report. Since Contact ID is not one of the fields enabled for filtering, I cannot remove it. So, every time I want to use the report, the filter is automatically set and I cannot use the report.

Any suggestion?

Thanks

Note: This issue has been reported at: https://issues.civicrm.org/jira/browse/CRM-17872

# Answer
The same thing happened to me. The Constituent Detail report is called from the Constituent Summary Report. I ran the summary report and clicked on a contact to go to the detail report. As an Administrator I accidentally updated the Constituent Detail Report. It must have saved the contact ID used in the call from the summary report. Every time I tried to use or call the detail report from then on it used the stored (saved) contact ID.

To solve the problem I deleted the Constituent Detail Report from the Contact Report area. I then created a new report using the standard Constituent Detail Report as the basis.
> 2 votes

# Answer
I have recently seen the same thing with the Contribution Detail report.

As Ron also suggested this was fixed by recreating the report using the report template. Reports \> All Reports \> New Report \> Contribution Detail Report

This seems to be a recurring problem as described starting 2010: https://forum.civicrm.org/index.php?topic=16905.0
> 1 votes

# Answer
I solved the problem going in the table "civicrm\_report\_instance" the column "form\_values" had the filter recorded in. Properly editing the field value, the filter was removed
> 0 votes

---
Tags: civireport
---


# Question
Title: hook_civicrm_permission in a drupal module
How should custom permissions created by hook\_civicrm\_permission be properly checked?

Have defined custom permission like this:

```
function mymodulename_civicrm_permission(&$permissions) {
    $prefix = ts('SpecialPermissions') . ': '; // name of extension or module
    $permissions['SpecialPermissions'] = $prefix . ts('SpecialPermissions');
}

```

and checking it later on, same module, hook\_civicrm\_buildForm, have tried every option listed below:

```
* if (CRM_Core_Permission::check('SpecialPermissions')) {
* if (CRM_Core_Permission::check('Drupal: SpecialPermissions')) {
* if (CRM_Core_Permission::check('CiviCRM: SpecialPermissions')) {
* if (CRM_Core_Permission::check('cms: SpecialPermissions')) {

```

Code looks like exactly according to specs from: * http://wiki.civicrm.org/confluence/display/CRMDOC/hook\_civicrm\_permission * http://wiki.civicrm.org/confluence/display/CRMDOC/Permission+Reference

However, both test user with a corresponded permission AND Drupal user 1 (UID=1) are being affected, even when Drupal User 1 doesn't have role with custom permissions attached. Not sure if it is by design or something wrong with my implementation of this? Please advice.

# Answer
I may be misreading this, but it sounds like you're saying that you've got a new permission, and the user with the role that has the permission granted is working just fine. However, you're saying that Drupal user ID 1 is being treated as if it has the permission, even though it doesn't have any role with that permission.

If so, this is totally normal. Drupal user ID 1 gets all permissions, even when using `CRM_Core_Permission::check('SpecialPermissions')`. You should be able to confirm by creating another user without that permission and seeing that `CRM_Core_Permission::check('SpecialPermissions')` returns false.
> 1 votes

---
Tags: api, permissions, developer, hooks
---


# Question
Title: How can a user related to an Organization login and be restricted so they only see related members of the organisation
With CiviCrm can you manage accesses of single organization, set user and password for this single organization, and show only individuals related this organization, and only manage related membership of this organization? Thanks

# Answer
> 3 votes
I will try to answer though the english version of your question may mean i guess wrongly.

if the goal is to have John connected to organisation First Co, and Mary connected to organisation Second Co, then yes it is possible that when John logs in he is restricted to seeing only contacts connected to First Co and will not see those connected only to Second Co., and the opposite will apply for Mary.

EDIT: To do this you need to apply Access Control ACL and the way to do that will depend a bit on the general purposes of your site.

One option for example is that you can set ACLs to work on Relationships (I can provide more detail on this) so that for example John or anyone else who is an 'officer' of First Co can then access anyone who is an 'employee' of First Co.

To achieve the latter involves installing extensions. In this case the Related Permissions extension and the extension that it depends on, CiviCRM Entity Settings.

When the above extensions are enabled, on any Relationship Type you should now see a new field saying Always Permission A to B (and vv). And at civicrm/admin/setting/misc?reset=1 you should see an option for 'Allow second-degree relationship permissions'.

---
Tags: civimember, contacts, permissions, relationships
---


# Question
Title: Scheduled reminders working for some but not all
Drupal 7.41, Civi 4.6.9

The scheduled reminders are working except for 1 or 2 per day might not be sent. It appears random which ones don't get the reminder sent. The 1 or 2 a day is based on a rather small sample size. This client doesn't have all that many memberships so it's usually 5 or less reminders for any given day. Sometimes none are sent.

I have looked at the members/memberships that don't get reminders and I have not been able to find a reason those members didn't get a reminder while others have on that same day. If anyone has experience with this I would sure appreciate any help you might have.

# Answer
I believe this is a bug and I have submitted an issue: https://issues.civicrm.org/jira/browse/CRM-17880.

Basically, if there is a previous entry in the civicrm\_action\_log (like from last year) with the same action\_schedule\_id (same reminder) no new reminder is sent.
> 6 votes

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


# Question
Title: How to show CiviCase activities in client Actions dropdown?
I would like to create an extension that pulls in activity types from CiviCase and allows creating those activities against a client record using the "Actions" dropdown on the Client Summary page.

If anyone has done this or similar I would be grateful for any advice.

Thanks

EDIT: The activities need to also be associated with the relevant case types (for reporting and other categorisation needs). Also, they need to be only available for a certain contact type. I'm imagining that attaching them to case types will provide a way of differentiating between them and activities that are available to all contact types.

EDIT2: I now realise this question is a product of my muddled thinking. I'll ask again when I have a clearer idea of what I actually want to achieve!

# Answer
> 1 votes
If I understand right I think this is just a config change. You just need to mark those activity types as being for Contact instead of Case, and then they appear available for use in the normal activity menu, and you can still use them for case if they are listed in the case-type config.

---
Tags: extension, civicase, activities
---


title: How to allow "Bank Transfers"

text:
# Question
Title: How to allow "Bank Transfers"
I am trying to install a new payment processor. Right now, visitors to my site only have an option to give their credit card, but I also want them to have the option to do a "Bank Account Transfer." How would I do this?

# Answer
Unless William has addressed your "Bank Transfer" question, and you actually mean you want users to pay by entering their bank details, often known as ACH transfer.

You will need a merchant that allows that, an example post on this: https://civicrm.org/blogs/adixon/iats-next-generation-payment-processor-acheft

The link William provided indicate IATS and Vanco offer ACH,
> 4 votes

# Answer
You can find information about setting up payment processors in the documentation: Payment Processors.

However, a 'bank account transfer' sounds like it would have to be a 'pay later' option. I presume that the user won't be able to do this as part of the transaction on your site but would have to separately go to their bank and make a transfer to your bank? If so, I would suggest that you enable the 'pay later' option and provide your bank details so that people can make the transfer into your account.
> 0 votes

---
Tags: drupal, payment-processor
---


# Question
Title: Disabling automatic inheritance for Member type relationship
One of our client would like to use the CiviMember module to setup memberships for organisation they work with. They offer a subscription service where an organisation is a member and as part of that membership 5 users can access specific content on the website.

Reading through the document I see that this can easily be setup. However, the issue is that the client would like to have an approval workflow process instead of just allowing people to signup from the front end of the site and get automatically attached to an organisation i.e. the client would like to verify the person signing up for the organisation membership before allowing them to access information on the site.

In the CiviBook it says *Use this field to configure Membership Types where memberships are automatically granted to related contacts*. However, we would like to stop memberships being automatically granted.

I tried the option of not assigning a relationship type to the Membership option but then the Max related option disappears. Is there any way to stop this from automatically happening or am I missing something in the setup.

This is a Drupal 7 website using CiviCRM 4.6.11.

Thanks in advance.

# Answer
Might this be a question of which Relationship you are using this on. Eg you could create a new Relationship Type of 'associate of' to link the individual to the organisation.

When individuals sign up, they get the usual 'employee of' relationship. And then the admins for the client can 'verify' by also giving that contact an 'associate of' Relationship
> 1 votes

---
Tags: civimember
---


title: civivolunteer extension

text:
# Question
Title: civivolunteer extension
my civi version is 4.5.2 I wanted to activate civiVolunteer at administer. but there is no civivolunteer. the civicontribution etc. is there. how can I activate the civivolunteer?

# Answer
> 2 votes
Did you install the extension? It is not automatically shipped with CiviCRM. Check here to see how you can install extensions: http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions

---
Tags: extension, civivolunteer
---


# Question
Title: Is it possible to extend an existing custom field set to allow multiple values?
I have a site with a number of custom field sets. I need to change one of those to allow multiple values. Specifically, the field set holds fields relating to a vehicle; the site now needs to allow each contact to have multiple vehicles. The field set in question is assigned only to the Individual contact type.

I can see the option "Does this Custom Field Set allow multiple records?" on the field set settings page, but I can't enable it. However, if I create a new field set, this option is available.

I"m assuming that once created, you can't enable this option on a field set, although I can't find this documented. But I want to be sure before I delete the field set and recreate it with this option enabled.

Thanks for any guidance on this one.

# Answer
You can only edit the settings for allowing multiple records if the custom set is an empty set, i.e, the checkbox for this setting is only shown for those custom sets for which the custom table created has no rows in it.

This is checked here. variable `$this->_isGroupEmpty` is set to FALSE if you have any record in the custom table.
> 1 votes

---
Tags: custom-fields
---


# Question
Title: Create menu for "Event registration" on Joomla site
I have created a menu item "Event registration" on the backend of my Joomla site (localhost). In civiCRM I created a template and created a new event. On the front end it displays the below error message.

I will appreciate help.

Many thanks in advance

@import url(/civicrm/administrator/components/com\_civicrm/civicrm/css/civicrm.css); @import url(/civicrm/administrator/components/com\_civicrm/civicrm/bower\_components/jquery-ui/themes/smoothness/jquery-ui.min.css); Sorry but we are not able to provide this at the moment. The page you requested is currently unavailable.

Return to home page.

function toggle( element ) { var className = element.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } }

# Answer
> 0 votes
Thanks I managed to get this to work. I had to in the Joomla menu manager select even information page and enter the title of the event

---
Tags: civievent, joomla
---


title: Export Gift Aid?

text:
# Question
Title: Export Gift Aid?
We have a gift aid tab as show on the attached image.

I can search using the fields using the advanced search function but cannot export the data held in the gift aid fields.

Is there a way I can do this?

Many thanks, Andy

Drupal, CIVI 4.5.8

# Answer
Please try Constituent Summary report where you can set the filters to select all the "UK Tax Payer? **is equal to** yes"

This will give you all the list and you have an option of exporting to CSV or PDF
> 4 votes

---
Tags: custom-fields, export
---


# Question
Title: WordPress: Creating new WP Users from Civi Contacts
I've seen some example posts here for other CMS', but I haven't seen it explained for a WordPress environment. My situation is I have an Individual DB of 2,500 Contacts in Civi, and I want to turn them all into WP Users. I know I can convert Users into Contacts, but I want to do it the other way around.

Only thing I can think of is I would have to export the Contacts database as a CSV and then import them as Users either with a plugin or PHPmyAdmin. Isn't there some other way?

# Answer
> 5 votes
You can use my CiviCRM WordPress Profile Sync plugin to do this, but I can't guarantee that it'll do them all in one go! You'd have to install the plugin, then set a PHP constant in the main plugin file (because it's a feature only really intended for developers at this stage) to enable this feature. Change line 22 to read:

`define( 'CIVICRM_WP_PROFILE_SYNC_BULK', true );`

EDIT: Better yet, add the above line to your `wp-config.php` file - then you won't have to re-edit the plugin after each update.

You will then be able to select contacts in CiviCRM and use the Bulk Operations menu to "Create WordPress Users from Contacts". I'd recommend limiting the number of contacts you migrate in each run. And that you backup before you try this.

Did I mention that you should backup before trying this? Oh, good!

---
Tags: wordpress, contacts, database, user
---


title: Bugs in localization

text:
# Question
Title: Bugs in localization
I'm localizing (Italian) some parts of CiviCRM, but I noticed how some terms are not sensible to be translated. I had a look on the code and I found that these terms are written without the ts() call.

I correct the code, using ts() function, and the problem was solved.

Now I have a little list of these bugs, and my question is: what is the procedure to signal them to the community?

Thanks

# Answer
Thanks. Please open an issue on http://issues.civicrm.org/ There you can also add a diff file to an issue.

If you're really hardcore you can fork https://github.com/civicrm/civicrm-core, add your changes to the git project and do a pull request.
> 3 votes

---
Tags: issues, localisation
---


# Question
Title: How can I use custom tokens when grouping Thank You letters
Being able to group Thank You Letters by contact is a great feature for both everyday receipts (we have a company that will donate via multiple smaller donations at once) and end of the year receipts.

But I'm running into a problem, if I use an if statement around a contribution token, the token no longer loops for each contribution printed. For example:

```
{crmAPI var='contresult' entity='Contribution' action='get' sequential=0 id=$note_id}
 {foreach from=$contresult.values item=contribution}
  {if $contribution.non_deductible_amount gt 0}${$contribution.non_deductible_amount}{else}N/A{/if}
 {/foreach}

```

The function doesn't display anything when I 'group by' (If I run a thank you letter for a single contribution it does work.)

In this example:

```
{capture assign='note_id'}{contribution.contribution_id}{/capture}
{crmAPI var='result' entity='Note' action='get' sequential=0 entity_table="civicrm_contribution" entity_id=$note_id}
 {assign var='note_count' value=$result.count}
  {if !$note_count}None{elseif $note_count}
   {foreach from=$result.values item=note}{$note.note}{/foreach}
  {/if}

```

It only returns "None" once, when the contributions all have notes.

How can I make the if statement run for each of the contributions selected for the thank you letter?

# Answer
> 2 votes
The error comes from `{capture assign='note_id'}{contribution.contribution_id}{/capture}`. When grouping, if you have more than one contribution the output will be ie. `1, 2, 3, 4 ...`, try printing `{$note_id}` when grouping and you'll see what I mean, passing `1, 2, 3, 4` as contribution\_id to the API call the response is `"is_error": 1`

**Edit:** so having a look at `CRM/Contribute/Form/Task/PDFLetterCommon.php`, I believe that's the correct class, there´s a `$contributions` variable which holds the contributions, so if you loop through it, the above could look like this:

```
{foreach from=$contributions item=contribution}
{crmAPI var='result' entity='Note' action='get' entity_table="civicrm_contribution" entity_id=$contribution.id}
 {assign var='note_count' value=$result.count}
  Contribution note: {if !$note_count}None
  {elseif $note_count}
    {foreach from=$result.values item=note}
      {$note.note}
    {/foreach}
  {/if}
 | Non deductible amount: {if $contribution.non_deductible_amount gt 0}${$contribution.non_deductible_amount}{else}N/A{/if}
<br/>
{/foreach}

```

Now this **works when grouping** but it won't when you are not grouping, so my guess is that you'll have to create two ThankYou templates, one for grouping and one for ***no grouping***.

Also important to mention this is **smarty** they are not custom tokens.

---
Tags: tokens, receipts
---


# Question
Title: Membership contribution page leads to "Not found" error
When setting up a membership contribution page the Test Drive works fine - including successful adding of test members. The link to the Live Page leads to the server responding with a "Not found" error. Not sure where to look... Using CiviCRM 4.6.8. on a hosted Wordpress 4.4.1. Regards - Stefan

# Answer
Most likely, if the test drive page is working and the live page is failing, your CiviCRM base page isn't set up yet. On Civi 4.6, this is supposed to happen automatically, but either a) you upgraded, or b) I've seen plugins that interfere with the alias naming process.

In CiviCRM, go to **Administer menu \> System Settings \> CMS Database Integration**. Note the "Wordpress Base Page" setting. Next, in Wordpress, go to **Pages \> All Pages**. Make sure that page exists.

Last time I had a plugin interfere with the naming process, Civi had created a base page called "CiviCRM", but I had to go in and manually edit the permalink to match the base page setting.

Hopefully this clears up your issue!
> 1 votes

---
Tags: civicontribute, civimember
---


# Question
Title: Backbone isn't loading on Civi 4.6.11/WP 4.4.1
UPDATE: Changing my theme seems to have fixed the problem - but I'm not sure how to fix the original theme. Any advice on that issue is still welcome!

I'm seeing symptoms identical to this question: Backbone JS error with 4.6.4 on WP messing up contribution page set up

Pages using Backbone - particularly the "Include Profile" contribution configuration page - are broken, and the JS console says:

```
TypeError: Backbone.Marionette is undefined
TypeError: Backbone.CollectionSubset is not a constructor

```

However, the issue seems to be different than other folks experiencing it. Here's what I've tried so far (including all at once):

* Disabling all WP plugins except CiviCRM.
* Disabling Summary Fields (the only CiviCRM extension in use).
* Clearing cache, deleting templates\_c.

What else can I look for regarding this Backbone error? I assume it's a collision with WordPress's Backbone, but I don't know enough about Wordpress to troubleshoot that.

# Answer
> 2 votes
OK, I've got this working - I didn't use Andrew West's technique above, but I still upvoted the answer as helpful.

The theme had this code in one of its includes:

```
if ( ! function_exists( 'optionsframework_media_scripts' ) ) :

add_action( 'admin_enqueue_scripts', 'optionsframework_media_scripts' );

function optionsframework_media_scripts(){
  if ( function_exists( 'wp_enqueue_media' ) )
    wp_enqueue_media();
  wp_register_script( 'of-media-uploader', OPTIONS_FRAMEWORK_DIRECTORY .'js/media-uploader.js', array( 'jquery' ) );
  wp_enqueue_script( 'of-media-uploader' );
  wp_localize_script( 'of-media-uploader', 'optionsframework_l10n', array(
    'upload' => __( 'Upload', 'organizedthemes' ),
    'remove' => __( 'Remove', 'organizedthemes' )
  ) );
}

endif;

```

This was loading Backbone. It also seems to be extraneous; the media uploader seems to work fine with this function commented out.

So I created a child theme, and in the `functions.php` file in my child theme, I added this code:

```
//put in a blank function here to override loading this function in the parent theme.
function optionsframework_media_scripts(){}

```

This worked great! Ideally I'd like to copy the code from the child theme and add some conditional logic to say, "Only enqueue these scripts on a non-CiviCRM page" - but unfortunately that's beyond my Wordpress knowledge.

# Answer
> 3 votes
I *think* that when I had this it was caused by a theme loading a newer version of Backbone. Can you dequeue the script in that theme's functions.php? And try queuing the Civi version direct? Admittedly a bit of a long shot.

---
Tags: civicontribute, backbone
---


# Question
Title: Where Can I Alter the Event Additional Participant Wording?
What I am trying to do is alter the wording on CiviEvent registration forms. It currently reads:

*How many people are you registering?* \[Drop down list\] *(including yourself)*

What I am trying to get it to read is:

*How many people, including yourself, are you registering?* \[Drop down list\]

Although I have found the line in CRM/Event/Form/Registration/Register.php to amend the bit of text before the drop down list which for me is in line 363; I can not find where the (including yourself) is located. The only reference to the phrase refers to groups partly needing the waitlist.

# Answer
You could check *templates/CRM/Event/Form/Registration/Register.tpl* around line no 71.
> 1 votes

---
Tags: civievent, registration
---


title: Change Default Organization

text:
# Question
Title: Change Default Organization
I am on CiviCRM 4.4.9. I have followed the instructions for "Moving an Existing Installation to a New Server." When I open the Civicrm in the new location, it appears that it is setting the default organization to my contact (my contact ID is 1) instead of the organization's contact ID which is 26299. My contact has about 58K of activities; the organization's activities are 2.

How do I change the default organization to the proper contact?

# Answer
> 2 votes
You should be able to set it in Administer \> Communications \> Organization Address and Contact Info, as per: Wrong default organisation

ETA: As I just went through the process of transferring to a new server, I've realised that the instructions result in your original civicrm\_domain being skipped in the MySQL dump. A fresh install of CiviCRM on the new server will assign the contact id 1 to the default organisation in the civicrm\_domain table - you can get around his by either including civicrm\_domain in the initial SQL dump, or by editing the contact\_id field in the new database's civicrm\_domain table.

---
Tags: contacts, configuration
---


# Question
Title: Overcome API KEY request at Relationship edit / delete for users of certain Drupal Role
Is it possible to skip api key check at Relationships delete? We'd like to create one-click link for altering Contact, where users of certain **Drupal Role** should be able to click "Resign" link and all magic happens behind the scenes. Since there are a lot (really) users of acting role, playing with individual user api key(s), described here http://wiki.civicrm.org/confluence/display/CRMDOC/REST+interface#RESTinterface-CreatingAPIkeysforusers , doesn't sound like a good idea. So, are there something like **"skip\_key\_check"** for such a cases? Here's a piece of code currently being used:

```
CRM.api3('Contact', 'create', {
  "contact_type": "Individual",
  "id": key,
  "is_deceased": 1,
  "deceased_date":yestrDate,
      "custom_197": 0,
    // Relationships part - this is here  api key is being asked
    'api.Relationship.create': {
       "id": value.rel_ID ,
       "contact_id_a" : value.cont_A,
       "contact_id_b" : value.cont_B,
       "relationship_type_id" : value.relationship_type_ID,
       "end_date": yestrDate,
        "is_active": 0
        // Would be nice to have "skip_permissions_check": 1, here
     },

```

# Answer
> 3 votes
you seem to me mixing two related but different concepts:

* the REST API, that's an interface to connect to Civi, mostly from external servers (eg another application). In principle, the api\_keys and server key shouldn't be visible to the end user but stored in a configuration setting somewhere.
* the ajax API, that's how a user interact with civicrm to avoid to reload the page completely. This one doesn't need the api\_key, as it relies on the user authentication to know what is allowed

In both case, it's not possible to bypass the permissions from an external call directly, it would defy the purpose of having a permission system in the first place ;)

What I would suggest you to do is to write a simple civicrm extension that offers a "member.resign" API and a new "quiter" permission (name to be improved ;) and configure the api so it's only the quiters that can resign.

your api can then call the apis to remove the relationship or whatever else you want to do, and can have the skip\_permissions parameter

Then you simply have to grant that permissions to the roles you want in drupal and call your new api CRM.api3('member','resign', {...}) and voila

As an aside, I'm not a lawyer and I don't want to speculate what you do with your contacts that resign, but marking them as deceased is likely to be considered illegal in most jurisdictions ;)

---
Tags: api, relationships, developer
---


title: Setting up unsubscribe page

text:
# Question
Title: Setting up unsubscribe page
Currently using CiviCRM 4.1.11 and Joomla 4.6.8.

We're looking to set up a newsletter and that will require an unsubscribe page. I gather that you use a token to set up an unsubscribe link but does that actually set up the unsubscribe page or do I need another way?

# Answer
> 1 votes
If you use the token {action.unsubscribeUrl} CiviCRM will create a personalised link in the mailing. Users are be able to click on it and will be redirected to a page generated by CiviCRM.

In addition, they will get a confirmation via email. If this standard workflow is sufficient for you you don't need to do anything else.

You can try it out yourself: Just send out a mailing including you and use it.

# Answer
> 3 votes
You can set up a profile that includes the field Contacts \> Groups.

Then send the link to that profile in edit mode, in Joomla the url will look like: http://joomla.demo.civicrm.org/index.php?option=com\_civicrm&task=civicrm/profile/edit&gid=1&reset=1

This url is the modified **Create Mode** (changing create to edit). To see how to get that click here

The user will need to be logged in to make changes. You can send a token in an email by adding &id={contact.contact\_id}&{contact.checksum} to the url.

---
Tags: newsletter
---


# Question
Title: non-asci characters ending up in database
Today we spent about 2 hours bashing our heads trying to get a string compare to work so we could run a query against contact sub type while setting up a new participant public listing.

We started realizing what was going on when the string length getting returned was 7. When it should have been 5, for Child. Took a look at it in the command line and saw this:

Anyone know why they might have ended up in the database? And how to avoid them showing up again?

Thanks!

I think this was also the problem behind another question I asked here previously.

drupal 7 civicrm 4.6.11

# Answer
> 4 votes
CiviCRM historically uses the CRM\_Core\_DAO::VALUE\_SEPARATOR character as a serialization technique for storing multiple values in a field. Best practice is use the API for accessing values, or if you really want to do direct database access then you need to treat that value as a multiple value separator.

# Answer
> 1 votes
To enhance a little on Demerit's correct answer, this is what I do in PHP when I need to separate contact\_sub\_types or case\_types (which have the same setup in the database):

```
$typeIds = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
$value   = array();
foreach ($typeIds as $typeId) {
  $value[$typeId] = $this->_caseTypes[$typeId];
}
$rows[$rowNum]['case_type'] = implode(', ', $value);

```

Or if you need to create a query and use the VALUE\_SEPARATOR in a clause do something like this:

```
 $where .= " ( " . $field . " LIKE CONCAT ('%" . CRM_Core_DAO::VALUE_SEPARATOR . "'," . $filter['value'] . ",'" . CRM_Core_DAO::VALUE_SEPARATOR . "%') ) AND ";

```

---
Tags: drupal, mysql
---


# Question
Title: Create a membership list with employee name
I have a public directory list that is created based on a relationship with an organization that is set-up as a smart group. I have a profile that lists the organizations that are included in the smart group along with their web address and email address. I also want to include the employees or contacts for each organization. How do you create a list or directory on a web page that includes an organization name and an individual's first and last name?

I see that this is a limitation of CiviCRM - can't combine individuals with organizations, but that doesn't seem practical. When you create a directory of member organizations it seems appropriate to include a contact name. How have others handled this problem?

I am using CiviCRM 4.4 and WordPress.

# Answer
To get the employees, run an advanced search. In the relationships section, select the relationship type and enter the organization that the employers are related to. Then, go up to the top section and find **Display Results As**. Select "Related Contacts" and then in the relationship type drop-down that appears, select "Employee Of".

You should get results of all the employees. Create a smart group from this search, and have your directory profile use this new group instead.

Finally, to display the employees' employers, add the field "Current Employer" (available under "Individual") to the profile, making it visible as a result column ("In selector"). (You may need to remove any organization-specific fields and/or create a fresh profile as your profile is now a listing of individuals rather than organizations.)
> 1 votes

# Answer
Two ways I can think of for identifying the lead contact for an organisation- a contact reference custom field, or a relationship. I'd generally prefer the relationship (you can keep historical information, have more than one of them, etc) but the custom field would be easier to show in a profile.
> 0 votes

---
Tags: profile, smartgroups
---


# Question
Title: CKEditor not fully functional in CiviCRM 4.6.11
We are expecting the editor in CiviCRM to look like this: http://docs.cksource.com/CKEditor\_3.x/Users\_Guide/Interface/Toolbar

There is at least one row missing on the toolbar that we can see. Is there a way to fix this on CiviCRM 4.6(Joomla 3.4.8) or install CKEditor Premium?

# Answer
> 1 votes
Take a look at Is there a way to enable or install the full version of CKEditor in CiviCRM 4.6.x? as well as Big Changes To WYSIWYG Editing In 4.7

# Answer
> 0 votes
I don't know if this will work with Joomla. It does with Drupal. In the display preferences you can pick use Default Joomla editor. Then on the Joolma side you can probably configure the editor with which toolbar options are available. Some of them might not work as expected on the Civi side of things.

# Answer
> 0 votes
We discovered the Joomla Editor ourselves and were using that with limited succsess. Of course now 4.7 is available hopefully this shouldn't be an issue anymore! :)

---
Tags: joomla, ckeditor
---


title: Scheduled emails not working

text:
# Question
Title: Scheduled emails not working
I have set up scheduled reminder emails for events, but they do not seem to go out. I tested it by signing up for an event myself and did not receive a reminder email. Anyone got any idea on what I'm doing wrong?

# Answer
> 2 votes
Have you enabled the **Send Scheduled Reminders** scheduled job? You can check by going to *Administer \> System Settings \> Scheduled Jobs*. Scroll down to **Send Scheduled Reminders** and ensure that the *Enabled?* box is set to *Yes*.

You'll also need to ensure that you have a cron job enabled for your Civi installation.

# Answer
> 2 votes
We had the same problem - it was due to the developers setting the cron job to only run once per day at midnight (not very useful for timely responses!)

---
Tags: civimail, civievent, scheduled-reminders
---


# Question
Title: Email css and fonts being miscounted as 'clicks' in CiviMail Clickthrough Reports
I have noticed that in our CiviMail ''Mail clickthroughs' reports, styling links are sometimes being reported as 'clicks' when they are loaded which is skewing our click rate reporting.

E.g. The report shows one of the clickthrough URLs as:

> `https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic`

Which is presumably being caused by the following in the email template being automatically loaded:

> `<style type="text/css"> @import
>  url(https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic);
>  </style>`

Have I just implemented the code wrong in the email, or is this a general problem with using references to external styles/fonts in CiviMail?

Apologies if I'm just being really thick here...

# Answer
Interesting. I can understand that CiviCRM would see it is an click-through link.

Although external CSS and fonts is very normal for web sites, it is not for emails.

Both Mailchimp and Campaign Monitor advise you to only use inline CSS.

The reason for this is that it is hardly predictable what different mail readers do with the external css. To have a reliable idea how your email will look for your Mailing subscribers it is better to avoid external css.

I would advise you to follow the email rules as shown on the Mailchimp and Campaign Monitor pages for CiviCRM too.

http://templates.mailchimp.com/getting-started/html-email-basics/

https://www.campaignmonitor.com/dev-resources/guides/coding/

*Addition:*

Campaign Monitor and Mailchimp do a last minute check and make all css'es inline just before sending. They both have published their inline css tool for us to use. The MailChimp version is the best in my experience:

http://templates.mailchimp.com/resources/inline-css
> 4 votes

---
Tags: civimail
---


# Question
Title: How to send "thank you" emails to donors?
We want to send emails to our donors of the previous week. This email needs to be customised, as it's an opportunity to tell them what has happen in the week or what's the plan to the week ahead.

I tried to use the thank you letter feature, but I haven't been able to customise much of the email (eg. the subject line) easily for each mailing.

If I do a "normal" mailing from an advanced search on donors, I haven't found an easy way to set the "thank you" date on the contribution, and only filtering on the contribution date isn't robust enough, and I'd like to use that field to know as well when the donor has received the thank you email.

# Answer
Although it will not be a completely clear-cut solution without any work, you could try to use CiviRules? It allows you to specify sending a email to the donor 1 week after the actual receipt of the contribution. You can specify the template, which will probably require some work to do exactly what you want it to do, but it might be worth a try?
> 4 votes

# Answer
I think if you search contributions instead of contacts, you can do exactly what you want out of the box.
> 2 votes

# Answer
The code that places the default subject line "Thank you for your contribution/s" is in this file. /CRM/Contribute/Form/Task/PDFLetterCommon.php

It's hardcoded in there but I can't imagine other's wouldn't appreciate a quick fix that sends the "Activity Subject" as the email subject line.
> 0 votes

---
Tags: email, contributions
---


title: Update membership status automatically

text:
# Question
Title: Update membership status automatically
Using CiviCRM 4.6.9 on Drupal.

We've never enabled automatic updating of membership status, but now it's time.

How to do this? I remembered that there is a Scheduled Job for this, but in looking at the description it says that it's obsolete as of v 4.3.

It seems this functionality has migrated over to Scheduled Reminders, however we had not planned on doing membership reminders automatically. Our membership director is very comfortable sticking with her own mass emailing of membership reminders on her own schedule.

Suggestions?

# Answer
I think the reminders portion of the memberships has migrated to "Scheduled Reminders" but I believe the status update portion remains in the "Scheduled Jobs" area.

Once you get to 4.7 that warning about reminders is gone:
> 3 votes

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


title: Free membership auto-renewal

text:
# Question
Title: Free membership auto-renewal
We have a few membership types that are "semi-automatic". They are honorary memberships that we don't charge for, but we want them to renew manually because it's an opportunity for them to update their data and donate to the society. So, officially, it's an annual membership that they have to renew themselves.

However not all of them do, and for those that don't we want to make sure they stay members. In this sense it's a lifetime membership.

So what I need to do is find a nice way of doing a mass renewal of all those members of these types sometime after our regular renewal period is over. Which is now.

My best idea so far is to do a search for all expired members of each type, export them, and then use that exported data to import new memberships for those people.

It should work, but is there a better way?

# Answer
> 1 votes
If you do a Search for Memberships (eg Find Members, or Adv. Search but set to show results as Memberships) then you should have access to a Batch Update via Profile that I think lets you change Membership characteristics such as Status.

You will also need to create a Profile with the relevant Membership fields in it.

# Answer
> 1 votes
Similar to your idea, if you search for expired members, export them, and then update the file to adjust the expiration date, you can update the existing memberships rather than importing new memberships. The exported file will contain the membership ID, which can be used to update existing instead of importing new. (It just seems a little cleaner than creating a new membership).

---
Tags: civimember
---


# Question
Title: Allowing a contact to update their related contacts via Webform-CiviCRM
We have a webform that allows a contact to sign up for a membership and specify two related contacts (let's say "Spouse" and "Child" for the example).

When they come back to renew, we can prefill the contact's info via a checksum token in a link from CiviMail (or automatically if they are logged in) -- but is there a way to prefill the other related contacts as well, so they don't add duplicates when they renew?

# Answer
If you have the Spouse and the Child set up with Relationships - and you configure the webform to have 3 contacts, and you set the contact 2 "Existing contact" webform component to have a 'default value' based on 'relationship to contact 1' then I would expect that using a checksum for contact 1 should result in those other contacts being prefilled. Is that what you need?
> 8 votes

# Answer
If you use an Existing Contact field for the other contacts, you can include their contact IDs in the URL arguments with something akin to this: `/your-link?cid1=[id]&cid2=[id]&cid3=[id]`

Though it's not as clear as it could be, the Webform-CiviCRM documentation hints at multiple contacts getting pre-loaded, and notes the requirement of the Existing Contact fields for each (you can hide the EC fields), but doesn't show how. Per Coleman's comment on this question: Displaying a Views block with a CiviCRM-enabled webform, the code snippet above is an example of how to do it.
> 3 votes

# Answer
One way to do it is using the checksum and cid tokens in the URL as mentioned in the other posts.

If you don't want to be limited to users needing you to send them the URL in order to access the form, there is another way using the relationship-permission extension here : https://civicrm.org/extensions/relationship-permissions-acls

The extension will create ACL permissions based on the relationship permission (the relationship permissions are usually only to access the contact's dashboard.)

You can set the first 'existing user' as the current logged in user and for every other contact, set 'existing user' to auto-fill or select list. Make sure that 'enforce permission' is enabled in the 'existing contact field'. If the logged in user has the permissions set to edit those he's related to, he will be able to select then in the webform and will not have access to any other contact.
> 2 votes

# Answer
In webforms we have an option called checksum - In Civicrm Tab **Enable CiviCRM Processing**

This will generate an Link in the **Additional Option Tab** which will generate an link for sending to each member monthly for renewal - I guess this might help you
> 0 votes

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


# Question
Title: Can Drupal send password reset tokens to non-default emails for accounts?
**Can Drupal send password reset tokens to email addresses other than the Primary in the linked CiviCRM contact?**

If this question veers too far away from CiviCRM, I apologize. This ability might permit resetting passwords for all users in our Active Directory Federated Services/Office 365 environment - a huge benefit!

We are migrating away from a CRM we can't afford. We had a custom web application resetting AD passwords by searching the old CRM's email database and generating a link for the associated user, who could have any number of emails associated. The big problem is that the **Primary email is likely issued by us** via Office 365 and thus uses the same AD FS credentials that we would like to sync Drupal to. (We have achieved SSO everywhere else and don't want Drupal/CiviCRM to be separate.) Therefore, someone needing a password reset probably can't access his/her Primary email, either.

As the trend is lately, we allow students access to .edu emails after graduation, so we have quite a few random people out there forgetting passwords. A very desirable side effect of using CiviCRM for password resets is that alumni will probably care a lot more about keeping their own contact information up-to-date with us (since access to their .edu email depends on it).

If I can send password reset tokens to any one of a contact's emails, a lot of problems are suddenly solved.

# Answer
> 1 votes
This is not default. It's a custom drupal module or a custom CiviCRM extension, depending on the exact use case. Should not be that difficult.

---
Tags: drupal, authentication, sso
---


# Question
Title: Why are my QuickForm checkboxes always ticked, in postProcess()?
I'm trying to build a form using QuickForm checkboxes. Here's what should happen:

1. The form displays a bunch of checkboxes. These are ticked or unticked according to a load of API calls in buildQuickForm(). If ticked, this is set using setChecked-\>true.
2. The user then ticks or unticks appropriately, and postProcess() handles the changes.

Except, the form data received by postProcess() is wrong: if a checkbox is set as ticked using setChecked-\>true, it always comes through as ticked, even if the user unticked it.

I assume I'm not understanding Civi's QuickForm process properly. Could setChecked-\>true be kicking in after the form is submitted? During validation, or something?

Any advice appreciated...

Andrew

# Answer
Two suggestions:

1. Do the setting in setDefaultValues() instead of buildQuickForm().
2. I find the "form data received by postProcess" often contains duplicates and miscellaneous other stuff and I'm sometimes not sure what to look at but usually use $this-\>\_submitValues for visible fields. What are you examining?
> 1 votes

# Answer
I always use the setDefaultValues() to add values to my form fields and boxes, like so:

```
function setDefaultValues() {
    $defaults = array();
    foreach ($this->_monthlyPattern as $number => $percentage) {
      $defaults['month'.$number] = $percentage;
    }
    return $defaults;
  }

```
> 1 votes

---
Tags: quickform
---


# Question
Title: Email me every time someone makes a contribution
I've made a contributions page with CiviCRM on my site. How can I configure CiviCRM to send me an email anytime anyone makes a donation, please?

(I know I can have Civi send me a report of recent contributions periodically, but that doesn't solve this case. I want to configure Civi to send me an email with info about a single donation immediately, when the donation is made.)

# Answer
> 7 votes
If you have it set to email a receipt to the contributor you can have that receipt bcc'd to you.

In Manage Contribution at the bottom of the receipt tab page is the option to cc or bcc someone.

# Answer
> 6 votes
If you need a more complicated workflow you could also use the CiviRules extension.

That way you could send an email to a backoffice manager when certain criteria are met and when other criteria are met you could send it to another backoffice manager.

# Answer
> 4 votes
If you have a profile in use on the contribution page, you can configure the profile to send a notification whenever it gets submitted.

---
Tags: civicontribute, email
---


# Question
Title: Fatal error on CiviEvent dashboard in 4.7 using PHP 5.3.5
Just tried the 4.7 upgrade and found it was giving a fatal error when I tried to acces either the event dashboard ( `/civicrm/event?reset=1` ) and Manage Events ( `/civicrm/event/manage?reset=1` ).

`Fatal error: Can't inherit abstract function Civi\ActionSchedule\MappingInterface::createQuery() (previously declared abstract in Civi\ActionSchedule\Mapping) in C:\xampp\htdocs\switch\sites\all\modules\civicrm\Civi\ActionSchedule\Mapping.php on line 64`

I can access the other CiviEvent pages (e.g. add new event, add participant, etc), and none of the other components seem affected.

Using Drupal 7.41, and upgraded to 4.7 from 4.6.10. I am running PHP 5.3.5, which the upgrade warned against but only for future versions?

# Answer
> 3 votes
Not sure if it relates, but if so it is likely your PHP version:

---
Tags: civievent, error, php
---


title: How to change Notes editor to HTML

text:
# Question
Title: How to change Notes editor to HTML
How can we change the editor for a contact's notes to an HTML editor instead of a standard textbox?

# Answer
This might be a nice feature to add, but it is not something you can configure without rewriting code.

It would actually take more than just setting the editor: notes display plain text, so if you were to give the box a WYSIWYG editor, you'd see a bunch of HTML tags in the content. Building the feature would require adding the editor, modifying the display, and making sure that old notes display properly after the upgrade.

However, if you want to work around this, you can build your own equivalent of notes:

1. Create a new set of custom fields, called "Comments" or "Improved Notes" or whatever. Have it used for Contacts, allow multiple records, and have the Tab display style.
2. Add an Alphanumeric / Text field called "Subject". Make it searchable.
3. Add a Note / Rich Text Editor field called "Comment". Make it required and searchable.
4. Add a Date field called "Date". Make it required and searchable.
5. Add a Contact Reference field called "Author". Make it required and searchable.
6. Add a File field called "Attachment". Add additional ones if needed.
7. Now, go to Administer - Customize Data and Screens - Display Preferences, and uncheck Notes in the Viewing Contact and Contact Search sections.

You should now have a tab for your new custom notes, and people won't see the standard notes (so you don't have to worry about people setting notes in the wrong place). A couple of caveats:

* You'll need to transfer any notes from the standard system.
* The "privacy" feature isn't available--either you can view all notes or none.
* The date and author will need to be set manually, though on the other hand, you now have the ability to backdate notes or write them on behalf of others.
> 7 votes

---
Tags: contacts
---


title: Access denied on price set page

text:
# Question
Title: Access denied on price set page
I have this problem

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

'access denied' for administrator on the price set admin page

```
civicrm/admin/price?reset=1&action=add

```

using civicrm 4.5.3 and drupal 7.33

The 'access denied' screen is a drupal screen, not an apache error. The message shows up in the 'recent log messages'.

Where should I start looking ?

# Answer
> 6 votes
I had a similar problem (CiviCRM 4.6) and solved it as follows:

The price sets kind of belong to the event component, and therefore they require not only "regular" CiviCRM permissions, but also access CiviEvent. Since the CiviEvent component wasn't enabled, the permissions weren't there, and the admin user didn't have them.

After enabling CiviEvent and giving CiviEvent access (in Drupal) to the administrator role it worked.

# Answer
> 1 votes
One solution, that I have verified as working, is to check the .htaccess file in the root Drupal folder.

As administrator, I would log in to the site, navigate to CiviCRM and find areas, such as price sets, profiles, even dashlets on the dashboard, were all coming up "access denied".

It would occur after a major Drupal update. What was happening, was I was navigating into (example) http://www.drupal.com, while the server was set up to http://drupal.com.

I could log in fine. But I would get the access denied issues. The reason is the Drupal update had overwritten my .htaccess file.

So, for whatever set up you have, ensure that your .htaccess corresponds.

From the .htaccess file, located in your root Drupal folder (use your server control panel, or an ftp client to see the file):

```
  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} .
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
   RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
   RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

```

Originally, the last two lines of the above .htaccess file were # out.

1. I removed the #.
2. Refreshed my browser.
3. Re-logged in.

**Result: all the "access denied" errors are gone.**

You will have to select the correct option for your server settings.

Hope it helps!

# Answer
> 0 votes
please have a look at

Administer -\> Users and Permissions -\> Access Control -\> Drupal Access Control

you will find all the user access right available for the user

---
Tags: drupal, acl, price-sets
---


# Question
Title: Custom dropdown field not populated when selecting contact on contribution page
I have an issue with special custom fields

I am logged in as admin on public contribution page on front end.

I click on "not Mister XXX XXX"

Then I choose the user I want to renew.

The text fields are well populated with information from database But the dropdown fields and date fields are not populated.

I would like to know if this a known issue of CiviCRM or how to fix it ? It's seem to be a ajax issue ?

# Answer
> 1 votes
It sounds like you may be wanting to renew the membership of another person as an administrator. To do that you should use a backend form rather than the front end one which has "not Mister XXX XXX". One way to do this is to find the contact to renew, click on their Membership tab on the Contact Summary page, then beside the membership to renew click More \> Renew.

---
Tags: custom-fields
---


title: Event management problems

text:
# Question
Title: Event management problems
1. My events will not appear on the website calendar
2. Unable to upload images to the event description page
3. When doing a test registration, I do not receive a confirmation email

Could you please review?

Link to registration for Leadership Givers Reception: https://www.unitedwaydgco.org/civicrm/event/info?reset=1&id=74

Link to registration for Campaign Celebration Dinner:

https://www.unitedwaydgco.org/civicrm/event/info?reset=1&id=75

Thank you, Colleen

# Answer
The calendar is not part of core CiviCRM, so I can't be 100% sure without looking at it, but the first issue may be that you didn't mark the event as "public". If I were setting up a calendar like that, I'd want to limit it to events marked "public" in case I wanted to record other events that shouldn't go on the calendar.

Your other two issues could be so many different things that it isn't worth hazarding a guess without more information or access to your site. If you are in touch with the company who built your site, you should contact them, or you might contact a CiviCRM Partner.
> 1 votes

---
Tags: civievent
---


# Question
Title: Can I send automatic, scheduled e-mails about expiring or just-expired memberships?
Using CiviCRM 4.6.11, Drupal 7. We want to create a workflow for membership renewals, part of which will include automatic, scheduled e-mails to members with expiring or just-expired memberships. I can create a Smart Group based on membership expiration date, then create a (say) daily,weekly scheduled job to send an e-mail to Smart Group members.

Is this the best or only way?

I'm also checking out the CiviRules extension compatability with 4.6.11 and 4.7 then checking out using CiviRules to create such a workflow.

# Answer
> 4 votes
Multiple scheduled reminders are already possible out of the box using the "Scheduled Reminders" feature.

From the online book:

> **Creating and managing scheduled reminders**
>
> Scheduled reminders can be created from the administration page at **Administer \> Communications \> Schedule Reminders** or during the creation of an event.
>
> *From the administration page:*
>
> 1. Click on Add Reminder.
> 2. Give your reminder a name that will help you identify it if you need to edit it in the future.
> 3. Select an entity for your scheduled reminder. This will bring up a further set of options relevant to that entity: activities have activity types and statuses; membership gives membership types and statuses, and so on. These secondary options are (usually) multi-select fields, so you can choose to include more than one option in each field.
> 4. Choose when to send the reminder. This can be a set date or an amount of time before or after the start or end of your chosen entity.
> 5. If you want to send more than one reminder, check the Repeat box. This gives you choices about the interval of repetition and when the repetition should end.
> 6. Check Record activity for automated email if you want a record of the contacts who received this reminder.
> 7. Fill in From Name and/or From Email if you don't want this reminder to come from the default name and email address for your site.
> 8. Refine or add to your recipient list. For more about your choices, see Limiting or adding to your recipient list in this chapter.
> 9. Choose to send your reminder as an email, an SMS or either depending on the preferred method(s) of communications for the contact.
> 10. Compose your message. You can use Message Templates or write the message from scratch. Note that you cannot save your message as a new template or modify an existing template from this screen, so if you are writing a reminder for the first time and you think you will want to re-use it, consider creating it as a Message Template instead.
> 11. Click Save when you are are done.
>
> Reminders can be edited, disabled, or deleted from **Administer \> Communications \> Schedule Reminders**.
>
> IMPORTANT: Your system administrator will need to ensure that the *Send Scheduled Reminders* scheduled job is enabled and runs at least once a day. Refer to the Scheduled Jobs chapter for configuration details.

---
Tags: civimail, civimember, scheduled-reminders, civirules
---


# Question
Title: Is it possible for a non-logged in user to check the status of their membership?
We had a request for some functionality where a not-logged-in user could check the status of their membership easily by entering their member number (internal ID) or email address into a field. After submitting the form, they'd be taken to a page that would show them their current membership status, if one exists. I can see this having some additional functionality as well:

1. They'd be shown if there are multiple contact records that match if an email address was used
2. A "renew now" button could be shown beside each returned result, would be tokenized / checksummed for them

Have any of you heard of anything like this? Does this already exist? Seems like it could be a cool thing for users of sites that don't require logging in to join (like ours) to be able to check their status, and potentially help reduce duplicates in the database.

# Answer
> 4 votes
In a slightly different way this is possible with checksum tokens.

You can create a profile or a contribution page with membership data. Then you send a Mailing to all people who need a renewal (soon). That Mailing contains a link to the profile or contribution page with their contact ID and an individual checksum token as parameters.

When people click that link they see their data in the profile or contribution page and have the option to change it or to get a membership renewal.

For more info see http://wiki.civicrm.org/confluence/display/CRMDOC/Tokens

From this page:

> There is a very powerful feature to allow you to send an email with CiviMail to your constituents with a link to the contribution form, profile, or event registration form with all of their contact information already filled in! This saves them the hassle of filling it out and increasing the chances they would ultimately donate. Or it can be a simple way to periodically allow people to review their contact info and update it if applicable.
>
> The way it works is you create a "special" link in the CiviMail message that includes the checksum token {contact.checksum}. When people click on the special link, it looks them up in the database and prefills any information on the contribution form or profile with any data that exists in their record. The special link lasts for seven days from the time it was sent out.
>
> Checksum for Contribution Pages: To send people to a contribution page use this path where N is the ID of your contribution page:
>
> ```
> Drupal: http://www.myorganization.org/civicrm/contribute/transact?reset=1&id=N&{contact.checksum}&cid={contact.contact_id}
>
> Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/contribute/transact&reset=1&id=N&{contact.checksum}&cid={contact.contact_id}
>
> WordPress: http://www.myorganization.org/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=N&{contact.checksum}&cid={contact.contact_id}
>
> ```
>
> Checksum for standard Profiles (edit mode): To send people to a profile use this path where N is the ID of the Profile you want to send them to:
>
> ```
> Drupal: http://www.myorganization.org/civicrm/profile/edit?reset=1&gid=N&{contact.checksum}&id={contact.contact_id}
>
> Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/profile/edit&reset=1&gid=N&{contact.checksum}&id={contact.contact_id}
>
> WordPress: http://www.myorganization.org/?page=CiviCRM&q=civicrm/profile/edit&reset=1&gid=N&{contact.checksum}&id={contact.contact_id}
>
> ```

# Answer
> 2 votes
You should be able to do this by creating a profile, and selecting the email address as a search term. This is fairly rudimentary, but works; if you're using Drupal, you can use Views to build a much slicker version of the same.

Note that while this is closer to what you're asking for than what Catorghans is discussing, his approach is fundamentally more secure; otherwise, you're opening an avenue for someone to harvest data from your system.

---
Tags: civimember, profile
---


# Question
Title: CLI Contact Import is not importing address details
I have a local test environment on a mac where the site is installed.

I'm trying to do a CLI import via the mac terminal and unfortunately, address details are not being imported.

Command Used: php \[absolute path\]/sites/all/modules/civicrm/bin/csv/import.php -e Contact --file \[absolute path\]/csv/test.csv

Column headers: "contact\_type","email","first\_name","middle\_name","last\_name","street\_address","city","state\_province","country","gender","custom\_1"

Sample CSV: "Individual","person.email@local.dev","FirstName","MiddleName","LastName","Street Address Details","City Name","State Name","Country Name","Female","custom\_1 value"

As you can see above, there's even a custom value and it get's imported, but address details are not.

Please help.

Mac: El cap, Drupal: 7, CiviCRM: 4.7

# Answer
The CLI Contact import is meant to work on a per-entity basis, since it uses the API. So Contact is a separate entity from Address. The Contact entity API has a couple of hacks to accept certain parameters from other APIs - e.g. primary email address - but generally speaking, what you're doing is unsupported.

If you'd like to do what you're doing via command-line, you have a couple of options:

* Pull the contact ID into your CSV, and do a second import using the Address entity.
* Write a small PHP script that handles this using the API Chaining rules.
* If you're super-ambitious, you could write support for API Chaining into the existing CLI import, or submit a paid issue queue item to the core team to do so.

If this is a one-time import and you're not a coder, the first choice is the easiest. Do your initial contact import first. I use a tool called Pentaho Kettle to automate the process of substituting contact IDs into my address etc. imports - but it's got a steep learning curve if this is a one-off job. Instead, export contact ID and external identifier from Civi, open it in a spreadsheet program, and use a VLOOKUP formula to generate your address import.
> 4 votes

---
Tags: api, import, error, cli
---


# Question
Title: Error Running Contributions Summary Report
When trying to run the Contributions Summary report I get the following message:

```
DateTime::__construct(): Failed to parse time string (2010401) at position 6 (1): Unexpected character

```

Tried standards tricks, checking file permissions, clearing caches unable to resolve the issue.

```
$Fatal Error Details = Array
(
    [message] => DateTime::__construct(): Failed to parse time string (2010401) at position 6 (1): Unexpected character
    [code] =>
    [exception] => Exception Object
        (
            [message:protected] => DateTime::__construct(): Failed to parse time string (2010401) at position 6 (1): Unexpected character
            [string:Exception:private] =>
            [code:protected] => 0
            [file:protected] => /var/www/example.com/sites/all/modules/civicrm/CRM/Report/Form/Contribute/Summary.php
            [line:protected] => 745
            [trace:Exception:private] => Array

```

# Answer
> 1 votes
It seems like you have some invalid data in your database. I don't think this is related to file permissions or caches. Is it possible that you imported data via a SQL command rather than the UI or API?

Try turning on the backtrace function in **Administer menu \> CiviCRM \> Debugging and Error Handling**, and hopefully you'll get a better sense of which field this is supposed to be. Alternatively, look at the fields that are likely to be called in your instance of the report - checking columns, filters, etc. - and then run SQL commands to find a datetime field with a value of "201401".

Since this is likely to be in civicrm\_contribution, I looked up the datetime fields in that table. There are four. Try running these commands, then see how this data get entered?

```
SELECT id, contact_id, receive_date FROM civicrm_contribution WHERE receive_date = '201401';
SELECT id, contact_id, receipt_date FROM civicrm_contribution WHERE receipt_date = '201401';
SELECT id, contact_id, cancel_date FROM civicrm_contribution WHERE cancel_date = '201401';
SELECT id, contact_id, thankyou_date FROM civicrm_contribution WHERE thankyou_date = '201401';

```

UPDATE: That backtrace is super-helpful! I looked at the code in `CRM/Form/Contribute/Summary.php` and I see better what's happening here. The issue is still invalid data - just not in the format I expected.

This part of the code is the part that creates the links on the Summary Report to drill-down links. See the links in the screenshot:

So Civi is converting the start dates of each of those months into a different format. One of your contributions still seems to be happening in a different month.

* You can try commenting out lines 737-786 of the file I mentioned - you'll lose the drill-down links, but hopefully the invalid data doesn't affect anything else.
* This bug shouldn't trigger unless you're grouping by receive date.
* You can try tracking down that bad data. Try this SQL:

SELECT id, contact\_id, receive\_date FROM civicrm\_contribution ORDER BY receive\_date; SELECT id, contact\_id, receive\_date FROM civicrm\_contribution ORDER BY receive\_date DESC;

Check the bottom of both those lists for odd-looking receive\_dates, my guess is you'll find one!

---
Tags: civireport
---


title: Upgrade error from v4.5.8 to 4.6.11

text:
# Question
Title: Upgrade error from v4.5.8 to 4.6.11
There is an upgrade error from v4.5.8 to v4.6.11. Even i tried to upgrade to v4.6.0, it fails. Please suggest an solution how to fix it. I upgrade the existing database from v4.5.5 to 4.5.8 which is running without errors.

# Answer
Jitendra's comment is correct - it should be posted as an answer!

As for your second error, that's caused by skipping the first error. The SQL for 4.6.alpha1 includes the command to create the "civicrm\_recurring\_entity" table. When you skip the rest of the 4.6.alpha1 SQL, you're creating the circumstance that leads to the second error.
> 1 votes

---
Tags: upgrade
---