# Question
Title: Automated Messages - Welcome message not working
I've had one of my colleagues request an email to be sent when users sign up to one of our mailing list, I've got a profile set up for the sign up process and the users are added to a specific group. Upon testing I realise that no automated welcome are being sent when users sign up for **any** of the mailing lists. Is there a way to disable this function (other than disabling it on the **Headers, Footers, and Automated Messages** listings?) or is there settings that need to be set before it will send.

Out bound email is working fine and opt out messages are working fine!

# Answer
To clarify, there are a few features you are mentioning that work as follows:

Notification of a profile form submission is managed in the Advanced Settings of the profile (reached by clicking on the Settings hyperlink to the right-hand side of the profile) - typically this would be the email of someone on staff/responsible for follow up:  You ask how to disable the option of automated emails being sent in conjunction with the headers and footers of mass email - but I think you meant to ask whether it is possible to send an automated message after profile submission to the person who is submitting the profile (please correct me if I'm wrong), but if I'm right, there are two ways to go about this:

* Enable the double opt-in process feature that sends a ***very*** generic email asking the contact to confirm their subscription. You can read more about it **HERE**.
* If you want to send a warm and fuzzy welcome message, then you could accomplish this with the use of a handy extension called **CiviRules** \- if you don't have this extension, have your system admin install it - once it is enabled, you would first create your welcome message template(s), then configure the rule as follows:

1. Trigger = "Contact is Added to Group"
    2. Condition = "Contact (not) in group" \> Save
    3. On the next screen of the Condition, leave the default of "In one of selected" and click to highlight the group(s) of interest (these would be your mailing groups as configured in the profile - if you want to send a different email to each group, then you'll need to create a separate rule for each group)
    4. Action = "Send email" \> Save
    5. On the next screen of the email, there are detailed instructions at the top of the screen - the default behavior is that the email is sent to the primary email address of the contact who is submitting the profile (which is what you want), so ***don't*** toggle the "Send to Alternative Email Address" option
    6. Test the rule(s) out by submitting the profile and confirming that you receive a welcome message

**Note:** You often have to save to get to the next step of the configuration in CiviRules, so when in doubt, click the Save button and see what's on the next screen :-)

Hope this helps!
> 2 votes

---
Tags: profile, header-footer
---


# Question
Title: CiviVolunteer Not Working After CiviCRM 5.5.2 Upgrade
I just updated CiviCRM from 5.4 to 5.5.2, and now when I click on Volunteer -\> Manage Volunteer Projects, or Volunteers -\> New Volunteer Project, it just dumps me back to the dashboard, and I don't see any errors in the logs. It was working fine on CiviCRM 5.4.

Is CiviVolunteer not compatible with CiviCRM 5.5.2? This is on WordPress, and the version of CiviVolunteer I have installed is 4.7.31-2.3.1.

Any ideas would be greatly appreciated. Thanks.

# Answer
> 4 votes
Matt,

Can you perform CiviCRM cleanup cache? This usually happens when menu is not registered. You can do this by navigating to CiviCRM \>\> Administer \>\> System Settings \>\> Cleanup caches and reset paths and then click on cleanup cache. Or you can just hit the url with civicrm/menu/rebuild&reset=1

HTH

Pradeep

# Answer
> 0 votes
I'm running Civi 5.3.1 under Drupal, so I cannot tell you if Volunteer is compatible with 5.4 under WordPress. But I have a vague recollection of having your symptom after upgrading Civi some months ago. I believe the problem was solved by deleting the contents of the templates\_c directory, which in WordPress is found under /wp-content/uploads/civicrm/.

---
Tags: wordpress, civivolunteer, 5.0
---


# Question
Title: How to set user permission for a particular user?
I have two accounts. One is admin and another is observer. I want only read-only permission for demo account. Please help. If I logged in by observer account then that CiviCRM option not showing on dashboard.

# Answer
Dipak,

You will need to add permission for roles to access certain CiviCRM functionality. You can do this by navigating to CiviCRM \>\> Administer \>\> Users and permisions \>\>Permissions (Access Control). And then click on Drupal Access Control. Give permission to specific role and save the form.

HTH

Pradeep
> 3 votes

---
Tags: permissions, civicrm-home
---


# Question
Title: Problem with incoerent local currency in contribution
I have a problem after upgrading to civicrm 5.4.1 from 4.7

When I confirm the record of a payment for a contribution the operation goes on forever and I have to exit the page although when I enter the contribution again the payment is registered.

When I look into the ajax requests with the Chrome DevTools I see that when the "record a new payment" popup is loaded it loads this script from the server (extract):

```
<span id='totalAmount'>
<select class="eight crm-select2 eight crm-form-select required" name="currency" id="currency">↵
<option value="EUR" selected="selected">EUR (€)</option>
</select> <input size="6" maxlength="14" name="total_amount" type="text" value="1.00" id="total_amount" class="eight six crm-form-text required" />
</span>
<span class="status">Balance Owed: € 1,00</span>

```

Why is the value in total\_amount 1.00 and the value showed in the Balance Owed 1,00?

When I confirm and register the payment the loading of the page goes on forever and when I look into the DevTools I see that this happens as the ajax request answers with an error:

> Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. amount is not a valid amount: 1.00

Can anyone help with some ideas?

# Answer
Looks like the decimal delimiter present at `civicrm/admin/setting/localization?reset=1` is configured as a comma (`,`) instead of a default `.`.

Civi might not be handling this correctly when the record payment form is loaded. The value of the total amount defaults to `1.0` instead of considering the delimiter configured for your site, i.e, `1,0`. Either this might be a bug which needs to be fixed OR you can try using the default `.` in the above settings and check if it fixes for you.
> 3 votes

---
Tags: drupal, contributions, ajax
---


# Question
Title: Checking across all email addresses for contact registration
We use Drupal and have a lot of users with more than one email address (but not within the Drupal accounts) - they forget they registered with one email and try to use another to login and failing that, use this other address to create another account. We thus get duplicate accounts.

To add better account information etc to Drupal, i.e. to store proper address details and more than one email address, I thought I would try out CiviCRM.

Last week I set up a local dev environment (Ubuntu 14.04, CiviCRM 5.5.2, Drupal 7.59, PHP5.6.37, MySQL 5.5.61) and synced users. I amended the Name and Address profile to customise it to our requirements and so that users could amend their address details.

I am 100% sure that when I tested someone trying to register through the (now amended) Drupal registration form, it would reject the registration if the email address was already in another field, like 'Other' or 'Home'. I could also login to Drupal with any other the email addresses a CiviCRM user had in their record.

I have rebuilt my environment (to prepare for a pilot) and the duplicate checking and login behaviour has now stopped... I did a demo to a colleague and so I was not dreaming this! I do not remember specifically 'enabling' duplicate checking etc, but it was working exactly as we needed and I was really pleased. It also made logical sense that, as CiviCRM hooks into to the registration screen etc, that somewhere in the background there would be a check on existing email addresses etc.

The other thing I notice is that I am unable to add other email addresses to the Name and Address profile - they just do not display. They do in the user profile (from Drupal) so I am assuming that this is a permissions thing somewhere.

Rebuilding has clearly reset something - does anyone anyone have any ideas as to why this behaviour has changed?

Many thanks

Martin

# Answer
On the Drupal side, there is a **Multiple Email Address** module that will allow for multiple emails to be associated with the same user account (not sure if you can configure specific email fields to map to the corresponding location types in Civi such that whatever changes/additional emails are added on the Drupal side would be communicated to the same contact record on the Civi side - you might want to check on that). The first paragraph at the link above indicates the following:

> Only one e-mail address is considered to be the "primary" email address, and will continue to behave as normal. Non-primary accounts are mostly functionally meaningless, except that during user registration any e-mail address registered to a user cannot be used to create a new account.

The Multiple Email Address module will in effect prevent duplicate contacts from being created in Civi as well.

Without this module, there is a 1:1 relationship between a drupal user account and a primary email address of a Civi contact record (keep in mind, the primary email address can be of any location type - if you were able to login with more than one email address without having the above module installed, it may be that you have duplicate contact records in Civi with a different email location set as primary - you can check the civi contact IDs associated with the drupal user IDs directly in the database in civicrm\_uf\_match). With regards to duplicate matching, the default behavior is as follows:

* When a user creates a Drupal user account using anything other than a primary email address of an existing Civi contact record, a new contact record is created in Civi
* If a user attempts to login with an email address that is not their primary email address, they will not succeed
* Conversely, Drupal does not allow a duplicate user record to be created for the same primary email address

You mention additional email fields are not displaying in the Name and Address profile - I am assuming this is a Civi profile configured with email fields of various location types - the same behavior happens on my end and I have a faint recollection of this being a programmed behavior to avoid overwriting the primary email address - but not 100% sure about this - anyone else who can confirm that please chime in.

Hope this helps!
> 3 votes

---
Tags: drupal, contacts, duplicate-contacts
---


# Question
Title: Inheriting memberships through Households
I have some individual contacts that are related both directly, and through Households.

When one of these contacts has a membership, I want all the household members to also get that membership.

However, it seems that only the household inherits that membership, other individual contacts don't get it.

Should this work out of the box, or do I need to do something specific?

# Answer
> 1 votes
For all individual contacts of a household to inherit a membership from another member of the household, you need to add the relationship type between the individual contacts to the membership type (e.g. Spouse of, Household Member Is, etc.) but you will not be able to modify the membership type accordingly if there are membership records associated with it:

If you want to avoid having to create a new membership type and then updating all of your existing primary membership records with that membership type, you will need a programmer who can update the membership type directly in the database and then run a query to create the related memberships.

Good luck, Tamar

---
Tags: civimember, households
---


# Question
Title: How to check contact read email or not when send email to Individual?
I'm using WordPress 4.9.8, CiviCRM to 5.5.1, I usually send email to contact by

1. Search\> Find contacts
2. View contact details
3. Action\> Send email
4. Send email ok, Contact received mail ok like picture

But status only Email sent though contact read email or not. So, can CiviCRM can change status to **Email read** when contact read email?

# Answer
> 3 votes
You might need to try installing the Transactional Emails extension which aims to address the limitation of CiviCRM which only handles the tracking of emails sent through civimail.

This extension tracks bounce, click, open events for single emails sent from civicrm, either with `Send Email` action, scheduled reminders, contribution receipts, etc.

The description on the extension link explains in detail on how to install and check the report of these events.

# Answer
> 1 votes
You would need to look into your email server/ SMTP provider to check on the status of an email as the send email action (up to 50 contacts) does not currently offer the ability to track this information.

Sorry not to have been of more help, Tamar

---
Tags: wordpress, email
---


# Question
Title: Is this a paypal bug, or is this just fantasy?
An odd one this! We have taken around 50 online event bookings today with no trouble, except for one.

We happened to notice that one contribution for £300 was showing as complete, but in fact the transaction at PayPal (using Website Payments Pro) was for £0.

The contribution has been set to the 'Accounts Receivable' Account, rather than the Payment Processor Account.

A **submit credit card payment** link has appeared, so Civi seems to know something is up, but to all intents and purposes the transaction appears successful so it was only by chance that we noticed. Is this a bug, or have I missed some intended behaviour?

Thank you!

# Answer
> 2 votes
We have got to the bottom of this - due to an unforseen combination of selections, the customer's basket value at the time of transaction was indeed £0. The £300 item was added later.

---
Tags: civievent, civicontribute, paypal
---


# Question
Title: create user choice form and store that value into database
I want create a custom form and that value into database using civicrm.

How can I create this using civiCRM and drupal.

# Answer
You can create custom field for a contact and then include the custom field on drupal webform.

Below are the documentation to

HTH

Pradeep
> 4 votes

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


# Question
Title: How do I disable custom css on frontend with Wordpress?
I currently have a custom CSS file specified in Settings \> Resource URLS. In this CSS file I override some civicrm.css styles to make the CiviCRM admin screens look a little more like the Wordpress admin area. However, I would like to disable this file when viewing frontend pages e.g. contribution pages.

I've tried the basic usage of the Wordpress wp\_dequeue\_script option but I can't find what the handle is for this file, so this doesn't work.

Note: I have successfully disabled the standard civicrm.css on my front end pages with this code in functions.php suggested by another user:

```
function rs_remove_civicrm_styles() {

  global $civicrm_root;

  if (empty($civicrm_root)) {
   return;
  }

  $civicrm_css = CRM_Core_Resources::singleton()->getUrl('civicrm', 'css/civicrm.css', TRUE);
  CRM_Core_Region::instance('html-header')->update($civicrm_css, array('disabled' => TRUE));

}

```

But I'm not sure same method can be used for the custom css file?

# Answer
> 2 votes
It might be simpler to just tweak the css to apply only to the admin pages using body.wp-admin (there may be more specific CiviCRM or WP classes you can use).

# Answer
> 1 votes
Just to clarify, the block of code to drop into your functions.php to disable civiCRM CSS on the front-end only looks like this:

```
// Remove the CiviCRM styles from front-end displays.
function my_remove_civicrm_styles() {
    if (!is_admin()) {
        global $civicrm_root;
        if (empty($civicrm_root)) {
            return;
        }
        $civicrm_css = CRM_Core_Resources::singleton()->getUrl('civicrm', 'css/civicrm.css', TRUE); CRM_Core_Region::instance('html-header')->update($civicrm_css, array('disabled' => TRUE));
    }
}
add_action( 'wp_print_styles', 'my_remove_civicrm_styles', 100 );

```

# Answer
> 1 votes
CiviCRM Admin Utilities version 0.4.1 introduces options on the plugin's Settings screen to disable (on the front-end of your website):

* the default CiviCRM stylesheet
* the CiviCRM menu stylesheet

And, when the Shoreditch extension is enabled, you can also disable:

* the Shoreditch custom stylesheet
* the Shoreditch Bootstrap stylesheet

For reference, the following code will disable *any* custom stylesheet defined in CiviCRM when not in WordPress admin:

```
add_action( 'wp_head', 'my_disable_resources', 9 );
function my_disable_resources() {

    // front-end only please
    if ( is_admin() ) return;

    // bail if CiviCRM isn't present and inited
    if ( ! function_exists( 'civi_wp' ) ) return;
    if ( ! civi_wp()->initialize() ) return;

    // get CiviCRM config
    $config = CRM_Core_Config::singleton();

    // bail if there's no custom CSS file
    if ( empty( $config->customCSSURL ) ) return;

    // get registered URL
    $url = CRM_Core_Resources::singleton()->addCacheCode( $config->customCSSURL );

    // get registration data from region
    $registration = CRM_Core_Region::instance('html-header')->get( $url );

    // bail if not registered
    if ( empty ( $registration ) ) return;

    // set to disabled
    CRM_Core_Region::instance('html-header')->update( $url, array( 'disabled' => TRUE ) );

}

```

# Answer
> 0 votes
Just an improvement for @jeff-van-loben-sels's answer (which saved my day). I've just added a condition on `CRM_Core_Resources` to prevent a fatal error.

```
function my_remove_civi_style() {
  if (!is_admin()) {
    global $civicrm_root;
    if (!class_exists('CRM_Core_Resources') || empty($civicrm_root)){
        return;
    }
    $civicrm_css = CRM_Core_Resources::singleton()->getUrl('civicrm', 'css/civicrm.css', TRUE); CRM_Core_Region::instance('html-header')->update($civicrm_css, array('disabled' => TRUE));
  }
}
add_action( 'wp_print_styles', 'my_remove_civi_style', 100 );

```

---
Tags: wordpress, css
---


title: Is 1Gb memory enough for small server?

text:
# Question
Title: Is 1Gb memory enough for small server?
We have AmazonAWS t2.micro server (free tier). T2. micro has 1 Gb of ram and 1 vCPU. Only CiviCRM (4.7.14) is hosted there along with its Drupal.

Currently the database is very small (less than 5000 contacts). Once a day we request **Cron** to email 6-8 reports (e.g., all contacts, contributions in last 3 years, etc.). The summary daily traffic seems to be below 10Mb. Other than that there are some Smart groups (100-200).

With this setup MySQL is sometimes running out of memory. Could it be wrong **settings** or 1Gb is just not enough?

# Answer
> 1 votes
I would say it's your smart groups causing the problem. They get recalculated a lot and this can use a lot of RAM.

Are you sure MySQL is running out of memory, rather than getting deadlocks? Deadlocks are also a problem that can occur when you are using a lot of smart groups.

I would recommend upgrading the RAM anyway, because it is bound to make everything smoother. 1GB is very small. You may find it fixes your problem instantly, and then the money is well spent. But if that doesn't help, or you get other MySQL-related problems, I would suggest trying to cut down on smart groups if you can.

# Answer
> 0 votes
What are your settings for /etc/mysql/my.cnf and what's running your webserver (NGINX or Apache2)?

Generally you want to give about 60% of available RAM to MySQL and the rest to Apache2. Check if you have bin-log enable in MySQL, which can increase your RAM usage. What's the behavior that you see when MySQL runs out of memory? Does mysql stop, or do you get a WSOD or an error message from PDO in Drupal?

Generally a 2 GB RAM instance should sufficiently power a small CiviCRM instance as the one you're describing with no hiccups.

# Answer
> 0 votes
An anecdote, but I put an install on Digital Ocean's cheapest server (512MB RAM) and kept having to restart it due to MySQL crashing due to lack of memory. I upgraded to a 1GB Droplet and haven't had to since.

\[My personal POV is that RAM is cheap, so put it on something that isn't a smart watch.\]

---
Tags: mysql, core, performance
---


title: Manual entry of recurring donation

text:
# Question
Title: Manual entry of recurring donation
We're moving over to CiviCRM. We don't currently use - or actually really plan to use - it for our donations, many of which are just sent as regular bank transfers. I'd like to be able to record these on CiviCRM without entering them manually, but can't see a way to do this - any thoughts?

# Answer
There is an extension available for adding offline recurring contributions but unfortunately the tag says it works till 4.4. Might be worth contacting maintainer if they have any plans to upgrade.

Pradeep
> 3 votes

# Answer
If you are not processing the contributions directly through CiviCRM, then there is no way to create what Civi refers to as a recurring donation. There are, however other options:

1. Import contributions received on a periodic (e.g. monthly) basis
2. Have a programmer develop an interface with whatever system you are using to process the donations to feed the information into CiviCRM

If you tell me the name of the system you are using for payment processing, I can let you know if an extension exists for it.
> 1 votes

---
Tags: drupal, donations
---


# Question
Title: How to remove the link 'do this for different person?' on a contribution / membership renewal page
I'm obviously missing something...

Wordpress / civicrm 5.4

I have a contribution / membership renewal page to allow members to renew. They need to log in before veiwing the page It presents them with their contact info via a profile and allows them to change any incorrect info and then asks them to select their membership type and pay. All seems to work great!

Except for the link that says 'want to do this for someone else?' If they click on this and happen to know the email address of another member seems they can rewrite all their contact info?!

I don't seem to be able remove this link.

The above is obviously bonkers. But what am i doing wrong please? Is the 'do for different person' link removable? Is it not possible to limit the ability of members to update info to their own records? Is there a permission I need to set somewhere? Or do I just need to separate out the processes for making contribution from the process for maintaining contact info?

thank you:)

# Answer
Have you tested this as a regular user and not as an admin or higher-level user? There should be a set of permissions that define whether or not users can edit their accounts, the accounts of others, etc. Make sure "edit all contacts" is only select for the appropriate role(s).

Here's what they look like in Drupal, for an idea:
> 2 votes

# Answer
I do not know if you can achieve this with configuration. However, it can be coded. The idea is that section you want to hide is marked with a unique css class `crm-not-you-message`.

Create an extension (see https://docs.civicrm.org/dev/en/latest/extensions/).

Create a file in the extension with the name `<extensiondir>/templates/CRM/Contribute/Form/Contribution/Main.extra.tpl`

Add the following code to the file

```
{literal}
  <!-- ui removing link -->
  <script type="text/javascript">
     CRM.$('.crm-not-you-message').hide();
  </script>
{/literal}

```

This code is appended (due to workings of the CiviCRM extension) to the page. The `CRM.$` function selects the elements and hides it.
> 1 votes

# Answer
Editing the ACL configuration does a good job of handling broad, role-based problems of anonymous users accidentally or deliberately overwriting data in a profile, (eg. Unwanted links "do this for different person" on membership signup page and How to delete "Not you or want to join..for a different person"?. Hiding the code from display is one way of solving the problem that stems from what I think is a design feature that may work well for many but in some cases like this, is sub-optimal. The message tends to appear for authenticated users, and the feature is illustrated by this help dialog for 'What to do upon duplicate match' in *advanced settings* for the relevant profile settings page:

> If you are using the profile as a contact signup and editing form - this option controls what happens if the data matches an existing contact record. Using this option user can update the matching record or create a duplicate record or otherwise he will get a 'duplicate record' warning, and their input will not be saved.

However, it goes on to say:

> This setting is ignored if the profile is embedded in an online \> contribution, member signup or event registration form. In this case a contact match always results in the transaction being linked to the matching contact.

So, the message combined with the default "Individual Strict Duplicate Matching Rule" (match on email address) gives rise to a concern with existing contact data being over-written by authenticated visitors with many ACL's.

The solution given is as follows:

> ...if you NEVER want anonymous input to match (i.e. always create a new contact record) - edit that rule and set the 'weight threshold' higher than 10. You will then need to run Find Duplicates periodically using a different rule, and merge any duplicate records with their associated passports, contributions, etc.

For smaller outfits this seems like a fair bit of admin overhead, so if this is a concern I suggest setting up your own custom `Main.tpl` template file here:

```
[civicrm.root]/custom_templates/CRM/Contribute/Form/Contribution/Main.tpl

```

At around line 75 remove the link so it just leaves: `{ts 1=$display_name}Welcome %1{/ts}`.
> 0 votes

---
Tags: civimember, permissions
---


# Question
Title: Civirules: how to move contact into NEW group XX days after added to group
I want to automatically move Contacts from my "New Organizer" group to my "Active" group 90 days after the Contact is ADDED to the "New organizer" group.

I have created a pipeline to track the stages of my volunteer's involvement. I am triggering movement into each stage by manually setting an Activity Type and a Unique Activity Status for each stage of my pipeline. I'm then added people to groups based on their Activity Status using Civirules. This works great.

But I also want to set rules that automatically move new and inactive volunteers into new groups.

I can *almost* see the way there using Civirules, but don't see the option to do a Field Value Comparison on Date Added to Group (or Activity Created Date, which could be another option for me)

# OPTION 1

LINKED TRIGGER: Daily trigger for group members

FIELD VALUE COMPARISON: I can only select from Contact or GroupContact fields, so I can't proceed.

# OPTION 2

LINKED TRIGGER: Activity Date reached ; Activity with type XX AND Status XX

LINKED CONDITION: Field Value Comparison; Activity Created Date = +90 days

LINKED ACTIONS: Remove Contact from initial Group; add Contact to new Group

Is this going to work as I expect? Will the Civirule be activated without an explicit trigger to do the date comparison 90 days after the Activity Created Date?

# Answer
> 1 votes
A rule can't be created without indicating an explicit trigger - there is a cron job for CiviRules whose description reads: trigger civirules cron triggers.

A few things about your condition:

1. If you are not 100% sure that the created date will always equal the activity date, you're probably better off using the activity date instead since this is user-driven whereas created date is system-driven
2. Using an operator of "Greater than or equal to" will allow you to capture any retroactively created/updated activities (another argument for using the activity date instead of the created date)
3. "Compare Value" assumes system date, so it actually needs to be negative to compare the previous 90 days (when you save the condition, you will see the date 90 days ago listed as follows: Activity.activity\_date\_time \>= YYYY-MM-DD).

If you find that the activity based rule is not working out for you, you may wish to consider the development of custom triggers, conditions and actions as documented **HERE**.

Hope this helps, Tamar

---
Tags: activities, groups, civirules
---


title: CiviCase Permissions

text:
# Question
Title: CiviCase Permissions
So I am very new to both civicrm and Drupal, but I have read the setup and can’t seem to get the permissions to work for Civicase

Obviously my administrator account - it all works. I created a second user ( and yes I made sure the user was in both civicrm and drupal ) I get access denied for my other user and really the only permission for civicase that is different is seeing only my cases is checked for the standard user, and all cases is unchecked - can someone give me a basic persmissions list to make this work.

# Answer
See Problem with CiviCase, which is scheduled to be fixed in version 5.6 as per the comments there.
> 2 votes

---
Tags: civicase
---


# Question
Title: strange issue(permission error with 'civicrm_contact') while installing civicrm
while installing civicrm , there is a weird permission error with table 'civicrm\_contact'. i have same setup on localhost with the same wordpress version and civicrm version. on localhost it runs fine but on live website there is an issue.

error can be seen in screenshot

# Answer
> 1 votes
Mehta,

You will need to grant mysql user permission to create table and other necessary permission. Also can you check if username and ip are matching.

HTH

Pradeep

---
Tags: wordpress, civicrm.settings.php
---


# Question
Title: Upgrading from 4.6 to 5.5.3 - [Error: Remove Moneris] CiviCRM_API3_Exception: "Could not delete payment processor type"
This is a Drupal 7+CiviCRM deployment. Trying to upgrade to 5.5.3 - we're getting this error that stops the upgrade script. Is there a database value I can edit to skip over this to proceed with the upgrade?

```
[Error: Remove Moneris]
CiviCRM_API3_Exception: "Could not delete payment processor type"

#0 X:\test\temp\sites\all\modules\civicrm\CRM\Upgrade\Incremental\Base.php(129): civicrm_api3("PaymentProcessorType", "delete", (Array:1))
#1 [internal function](): CRM_Upgrade_Incremental_Base::removePaymentProcessorType(Object(CRM_Queue_TaskContext), "Moneris")
#2 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Task.php(88): call_user_func_array((Array:2), (Array:2))
#3 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
#4 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(52): CRM_Queue_Runner->runNext(TRUE)
#5 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
#6 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(54): CRM_Queue_ErrorPolicy->call(Object(Closure))
#7 [internal function](): CRM_Queue_Page_AJAX::runNext()
#8 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(275): call_user_func((Array:2))
#9 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#10 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
#11 X:\test\temp\sites\all\modules\civicrm\drupal\civicrm.module(445): CRM_Core_Invoke::invoke((Array:5))
#12 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
#13 X:\test\temp\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
#14 X:\test\temp\index.php(21): menu_execute_active_handler()
#15 {main}

```

----- UPDATE -------

So we restarted the entire upgrade - manually deleted Moneris, and commented out line 193 as suggested by Jon G, but the script seems to stubbornly want to do its own thing. This is the error now:

```
[Error: Remove Moneris]
CiviCRM_API3_Exception: "Unexpected result from getcountArray ( [error_field] => payment_processor_type_id [error_code] => 2001 [entity] => PaymentProcessor [action] => get [is_error] => 1 [error_message] => 'Moneris' is not a valid option for field payment_processor_type_id ) "

0 X:\test\temp\sites\all\modules\civicrm\CRM\Upgrade\Incremental\Base.php(122): civicrm_api3("PaymentProcessor", "getcount", (Array:1))
1 [internal function](): CRM_Upgrade_Incremental_Base::removePaymentProcessorType(Object(CRM_Queue_TaskContext), "Moneris")
2 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Task.php(88): call_user_func_array((Array:2), (Array:2))
3 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
4 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(52): CRM_Queue_Runner->runNext(TRUE)
5 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php(106): CRM_Queue_Page_AJAX::{closure}()
6 X:\test\temp\sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php(54): CRM_Queue_ErrorPolicy->call(Object(Closure))
7 [internal function](): CRM_Queue_Page_AJAX::runNext()
8 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(275): call_user_func((Array:2))
9 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
10 X:\test\temp\sites\all\modules\civicrm\CRM\Core\Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
11 X:\test\temp\sites\all\modules\civicrm\drupal\civicrm.module(445): CRM_Core_Invoke::invoke((Array:5))
12 [internal function](): civicrm_invoke("upgrade", "queue", "ajax", "runNext")
13 X:\test\temp\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:4))
14 X:\test\temp\index.php(21): menu_execute_active_handler()
15 {main}

```

# Answer
> 2 votes
This error relates to the fact that there used to be payment processor code in CiviCRM core to support the Moneris payment processor. If you don't interact with Moneris, this is fairly safe to ignore. However, I suspect the error may mean you use Moneris, in which case I would NOT follow the instructions below.

* In your CiviCRM folder, find the file located at `CRM/Upgrade/Incremental/php/FourSeven.php`.
* Delete line 193. Confirm it matches the line 193 linked here.
* Run the upgrade again.

Note that it's common to experience upgrade errors because you have a partially upgraded database - so be sure to restore the pre-upgrade database backup to minimize your upgrade pain.

---
Tags: drupal, upgrade, 4.6
---


# Question
Title: How to dynamically add datafields/profiles in form?
I am trying to set up a committee registration form where the registrant also adds contact information for three other people (more contacts being added as the number of people grows in that group). How can I do this with Civicrm? Until now I was adding custom datafields for the other 3 contacts, then I realized that more people will be added later, so I can't be creating a custom datafield per person. If I create a new profile, how can I embed it in the initial registration form? Is there a way to add fields dynamically to a form (so that the registrant can add more than 3 people during registration)?

# Answer
There's no way to dynamically add fields without custom code to a profile - and that code sounds onerous. There's a better way, though: I'd recommend creating a CiviEvent and enabling "register multiple participants" from there.

You've tagged this "Wordpress", which rules out using Drupal Webform with CiviCRM integration. That's another alternative for anyone else with a similar issue using Drupal.
> 1 votes

# Answer
There's now a new option, the Profile Conditional extension. This extension requires some tech know-how to configure, but you need not be a programmer.
> 0 votes

# Answer
In addition to the Drupal-native and CiviCRM-native options linked above, there's also a WordPress-native option by using Caldera Forms with Caldera Forms CiviCRM.
> 0 votes

---
Tags: wordpress, custom-fields, forms
---


title: Change membership expiration rules

text:
# Question
Title: Change membership expiration rules
We want membership signups or renewals to expire at the end of the following year if made after July 1. So for example you sign up today (Sept 2018), then your membership is good through Dec 31, 2019. Is there any way to do that?

# Answer
> 2 votes
You can do this by:

* Going to **Administer menu \>\> CiviMember \>\> Membership Types**.
* Next to each membership type you'd like this to apply to, click the "Edit" link (see screenshot 1 below).
* On the Membership Type screen, set **Membership Type Plan** to "Fixed", set **Fixed Period Start Day** to "January 1st", and **Fixed Period Rollover Day** to "July 1st" (see screenshot 2 below).
* Press **Save**.

---
Tags: civimember
---


title: Address formatting

text:
# Question
Title: Address formatting
I'm trying to find a way to change the address format in CiviCRM, to the Australian address format. I've had a good search but can only find this these from 5 years ago.

https://civicrm.org/blog/erikhommel/street-parsing

I want to be able to have the items in separate fields when importing and adding contacts. Eg:

{apartment or unit} {street number} {street name} {street type} {city} {state} {postal code} {country}

Here is an example if that helps. https://www.imgur.com/a/ZhWVtAD

Any advice would be appreciated.

Kind Regards Scott

# Answer
To enable CiviCRM storing in separate addres fields you have to tick the box for Steet Address Parsing in Administer\>Localization\>Address Settings. I do not know for certain if this will allow you to import into separate fields but I would expect so.

If you want your own specific format or additional fields you will have to make changes in the code, here is an (old) example: https://github.com/CiviCooP/org.civicoop.streetformatnl
> 1 votes

# Answer
You could try the l10naddress extension by Megaphone Tech which appears to be aimed specifically at meeting this need for regionalised address formats.
> 1 votes

---
Tags: contacts, import, forms, addresses, data-import
---


# Question
Title: No contact names in activity emails but only name_{contact_id}. Why?
The emails that are sent by civicrm 5.5.3 (but had same problem with 5.4.1) to a an assigne of a case activity don't have the names of the client, assigne, etc but only a signpost made up of name\_{contact\_id}. Why?

Example from an e-mail:

```
> Client    name_74294
> Activity type Incontro Individuale
> Subject Incontro Test 2
> Created by name_74294
> Riportato Da  name_74294
> Assegnato a   name_28453

```

Any idea, advice? Johan

# Answer
> 4 votes
The comment by Demerit solved my problem:

Check under Administer - CiviCase - CiviCase Settings, there's an option that says "Redact Activity Email". That was set to "Redact Emails" and I had to set it to "Do Not Redact Emails".

---
Tags: civicase, activities, templates
---


# Question
Title: Set Hidden Field Value on Webform Connected to CiviCRM on Submit
I want to set a value on a field in a CiviCRM webform only when the form is submitted and not when saved as draft. The field is a CiviCRM field that appears in the webform but is not shown to the user.

The reason is I want to allow users to access and edit the information in the webform, but find a way of preventing them from accessing/editing the form once it has been "submitted". So I had created a yes/no field in Civi which I could set to yes when they submit the form and then prevent them from accessing the form if the value for the field was yes.

I was trying to set the value of the field using hook\_webform\_submission\_presave but kept on getting errors. Not sure if this was because the form is split up into several pages and is using the "Save Draft" functionality. I'm not sure also if this is the right approach for CiviCRM enabled webforms.

This webform could be for either creating a new CiviCase record or editing an existing one.

Am open to suggestions of any other ways of preventing users from accessing the form after they have already submitted it.

I am using CiviCRM 5.3.1 with Drupal 7.59.

# Answer
> 2 votes
I managed to get this to work by creating a custom text field in Civi. I then included this text field in the webform as a hidden component and set a default value. This value then gets set (for the text field) only when the form is submitted. I can then test the field to see if it has the set value or not and use this to hide or block the webform from the user.

# Answer
> 0 votes
There are Drupal permissions that can prevent certain Roles seeing Submitted forms which may deal with "The reason is I want to allow users to access and edit the information in the webform, but find a way of preventing them from accessing/editing the form once it has been "submitted".

---
Tags: webform-civicrm
---


# Question
Title: When editing my own profile visible under my contact dashboard, it does not enter CiviCRM "civicrm_post"API hook?
When I try to edit my profile fields from my own contact dashboard as seen in the two images attached and click save, It does not seem to invoke civicrm\_post hook in WordPress instance.

```
add_filter( 'civicrm_post', 'alter_profiles_event', 10, 4  );

function alter_profiles_event($op, $objectName, $objectId, &$objectRef){
   if ($objectName == 'Profile'){
    print_r($op);
    print_r($objectRef);
    die('ed');
    //does not enter here.
   }
}

```

How can I make sure the hook is invoked?

# Answer
> 0 votes
Add following line before `add_filter` function:

`require_once(ABSPATH . 'wp-includes/pluggable.php');`

---
Tags: wordpress, contact-view
---


# Question
Title: Can't use backup migrate module, CIVI crm error is: "The website encountered an unexpected error. Please try again later."
Been using Xampp and doing backups for years, it's Xampp portable, so solved my timeout issues a long time ago...

All other sites on this Xampp local work fine, using windows 10, 64, and Drupal7/CIVI CRM.

This worked fine, but just stopped suddendly.

I looked a the error log , and Drupal doesn't even have an "admin/config/system/backup\_migrate" directory, am I missing something here?

Now getting these errors:

```
The website encountered an unexpected error. Please try again later.

```

Log shows this:

```
Type    php
Date    Friday, September 28, 2018 - 16:50
User    1
Location    http://localhost/crm4/admin/config/system/backup_migrate
Referrer    http://localhost/crm4/admin/config/system/backup_migrate
Message PDOException: SQLSTATE[42S02]: Base table or view not found: 1932 Table 'crm4.civicrm_value_files_8' doesn't exist in engine: SHOW CREATE VIEW `civicrm_value_files_8`; Array ( ) in backup_migrate_source_db_mysql->query() (line 435 of C:\Core\XAMPP_2018\htdocs\crm4\sites\all\modules\backup_migrate\includes\sources.db.mysql.inc).

```

\**

# Answer
To clear up the smaller issue - Drupal, like most modern web apps, will not have a directory corresponding to most of its URLs. It will use redirects (defined in the webroot `.htaccess` file) to map URLs to a dynamically-generated page which doesn't exist on disk.

To speak to your primary issue - it sounds like you've got a MySQL view in your database. CiviCRM doesn't typically create MySQL views, though there are some exceptions (I believe CiviCase might use them). There are also sometimes reasons to create them manually - for instance, I created one for a client so CiviCRM could integrate with software that produces membership cards.

You have a view that references data that no longer exists. It seems someone recently deleted a custom field group called "Files" with a custom group id of 8. You have a MySQL view built in part from the table that holds that data. The table is gone, so the view is broken.

Most likely, if the custom group is deleted, you no longer need the view, and it's safe to simply delete the view using PhpMyAdmin or similar. However, it may be worth exploring whether that custom field group was deleted intentionally.
> 1 votes

---
Tags: error, backups
---


# Question
Title: CiviCRM BuildKit install fails on Ubuntu 18.04.1 LTS
Running the BuildKit installer script on Ubuntu 18.04.1 LTS doesn't work - it fails trying to resolve the conflict between the openssl libraries used by Ubuntu's NodeJS/NPM packages and the libssl-dev package.

# Answer
# Updated:

The fix for this has now been merged as https://github.com/civicrm/civicrm-buildkit/pull/427

# Original

**Full solution:** https://github.com/civicrm/civicrm-buildkit/issues/426

*Assuming that we can get this fixed in the BuildKit installer this answer will be updated to reflect such a change.*

1. Install a compatible version of NodeJS/NPM from NodeSource
    * `curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -`
2. Download, **don't run**, the *get-buildkit.sh* script.
    * `wget https://civicrm.org/get-buildkit.sh`
3. Using the editor of your choice, edit the downloaded script.
    * `editor get-buildkit.sh`
4. On line **453**:
    * (`PACKAGES="acl git wget unzip zip mysql-server mysql-client php7.2-cli php7.2-imap php7.2-ldap php7.2-curl php7.2-mysql php7.2-intl php7.2-gd php7.2-dev php7.2-bcmath php7.2-mbstring php7.2-soap php7.2-zip php7.2-xml apache2 libapache2-mod-php7.2 nodejs npm php-pear libmcrypt-dev libreadline-dev"`) Remove **npm**:
    * (`PACKAGES="acl git wget unzip zip mysql-server mysql-client php7.2-cli php7.2-imap php7.2-ldap php7.2-curl php7.2-mysql php7.2-intl php7.2-gd php7.2-dev php7.2-bcmath php7.2-mbstring php7.2-soap php7.2-zip php7.2-xml apache2 libapache2-mod-php7.2 nodejs php-pear libmcrypt-dev libreadline-dev"`)
5. Make the script executable:
    * `chmod +x get-buildkit.sh`
6. Install BuildKit:
**Important** The script CANNOT be in the same directory you intend to install BuildKit to!
    * `./get-buildkit.sh --full --dir ~/buildkit`
7. Continue the usual steps from here:
> 0 votes

---
Tags: developer, civicrm-buildkit
---


# Question
Title: Different Membership fee for each member
Our organization have different membership fee (monthly) for each member which can be decided while signup or setup manually. How can i achieve this ? Is it possible to create a user dashboard item to display pending membership overdue ?

Jaisal

# Answer
You can use price set to create options for the membership type and include it on online membership page(Contribution Page).

The contact dashboard does display all membership and payment information for logged in user.

HTH

Pradeep
> 1 votes

---
Tags: civicontribute, civimember
---


# Question
Title: Can't access contribution page without a login
I have recently updated CiviCRM in Joomla 3.x to the latest 5.5.2 build. I'm finding on my main contribution page (used for subscriptions), that I can't access it unless I'm logged in. When logged in, it loads fine. As a public user, I get just HTML on the page, which is an error saying I can't access it. The main part of this HTML is:

```
<div class="messages status no-popup">
<i class="crm-i fa-exclamation-triangle crm-i-red"></i>
<span class="status-fatal">Sorry, due to an error, we are unable to fulfill your request at the moment.
You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.</span>
<div class="crm-section crm-error-message">You do not have permission to access this page.</div>

```

My Joomla menu item that is used in the URL for the page is set to public access. The settings for the contribution page itself haven't changed. What could I be missing here?

# Answer
> 2 votes
You may need to check/add necessary permission that is required to access contribution page for anonymous user.

You can check by navigating to CiviCRM \>\> Administrator \>\> Users and Permissions \>\> Permissions (Access Control). Click on 'Joomla Access Control'.

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


# Question
Title: Render a previously submitted event registration
I would like to display to the user their existing event registrations in a format similar to what they see on the "Thank-you" screen &/or receive in the confirmation email. There are multiple event registrations that have different profiles and all use Price Sets.

Ideally, I'd like to create a function that takes the id of a Participant record and returns the formatted HTML that we see on the Thank-you screen; then I'd call this for each of the user's Participant records.

Any suggestions on how to do this efficiently would be most appreciated.

# Answer
There is not straight forward solution for this. However you can certainly achieve this by 1. Register URL in xml 2. Create a page and copy template from thank you page of event. 3. Assign all the required variables to smarty template.

HTH

Pradeep
> 1 votes

---
Tags: civievent, drupal, quickform
---


# Question
Title: Can't save profiles (any type) getting an error, this is CIVI Crm 5.x and drupal 7 on localhost
Whenever I try to edit or save a profile, I get this error:

```
Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
DB Error: no such field

```

Error in D7 log messages is:

```
Type    page not found
Date    Sunday, September 30, 2018 - 11:39
User    1
Location    http://localhost/crm4/undefinedjs/jquery/jquery.crmAjaxTable.js
Referrer    http://localhost/crm4/civicrm
Message undefinedjs/jquery/jquery.crmAjaxTable.js
Severity    warning
Hostname    ::1
Operations

```

# Answer
I found the problem, disabled the jQuery update module.

I could play around with Jquery versions as I am using Boostrap with different themes so I'll leave it off for now.

But no doubt, playing with Jquery versions on admin theme would solve this also ;)
> 1 votes

---
Tags: error
---


# Question
Title: Total Amount not displaying in contribution price set in Joomla 3
I have seen this issue in a couple other posts, but none that had an answer that applied to me.

I have CiviCRM 5.5.2, Joomla 3.8 and the RocketTheme Notio template. I have upgraded from a much older setup. In this updated build, the total amount doesn't display in my online form. In the backend preview, it displays and works just fine. On the website, not so much. I get the "Total Amount" label, but nothing for content.

Ideas of what I could be missing?

# Answer
> 2 votes
There should be JS errors on browser console. Since the total amount is calculated using javascript. If you see JS errors check

1. Directory path in CiviCRM
2. Resource URL 3 Cleanup CiviCRM Cache

HTH

Pradeep

---
Tags: civicontribute, joomla, contribution-page, price-sets
---


title: Mailing_send_test - job_id is not valid

text:
# Question
Title: Mailing_send_test - job_id is not valid
I am having a "Error in call to Mailing\_send\_test : job\_id is not valid : 14" when I send test email in Mosaico (to one email or to a group) whereas email settings are working perfectly.

My mailing id seems to be 16, 14 have been deleted weeks ago. Why the test functions are stuck with job\_id 14 ? How to release it ?

Any idea ?

* Civicrm : 5.5.1 - Wordpress 4.9.8
* Mosaico : 2.0-beta4.1528762072
* FlexMailer : 0.2-alpha5

EDIT : If I don't use mosaico, test mails and mailing are working perfectly.

This is the log related to the error :

```
[info] $Fatal Error Details = Array
(
[callback] => Array
    (
        [0] => CRM_Core_Error
        [1] => exceptionHandler
    )

[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => INSERT INTO civicrm_mailing_event_queue (job_id , email_id , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_mailing_event_queue (job_id , email_id , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO civicrm_mailing_event_queue (job_id , email_id , contact_id , hash ) VALUES ( 14 ,  97 ,  97 , 'beba286cbb5ec019' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`database`.`civicrm_mailing_event_queue`, CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE)]"]
)

```

# Answer
> 0 votes
I found out when I uninstall nz.co.fuzion.transactional plugin it is working.

I can't reinstall it to be sure it's the real cause because the plugin setup want to create an exiting DB ! If some developers used to work with Fuzion can help on that it could be great.

---
Tags: mailing, mosaico, testing
---


title: Mail merge export issue

text:
# Question
Title: Mail merge export issue
I've had a good search and not seen anyone asking a similar question - I'm testing out the mail merge function to see if it will work for our next mailing. I'm able to export labels as a PDF from an advanced search without any issues. However, any tests I do trying to export a .pdf, .odt, or .docx mail merged document produces a corrupted file - PDF readers all say the document is "damaged" and .docx and .odt produces a file with an awful lot of nonsense in it!

Anyone faced anything similar and found a solution?

Edit

After a bit of googling and messing around, I managed to get it to export the text I wanted in a HTML format. .docx and .odt documents are corrupted, pdfs won't open. At the top of the HTML and .docx documents there is a message saying "Notice: No file uploaded in Unknown on line 0". If I work it out I'll post here, but I can't find any others with similar problems. I've tried on multiple browsers and machines.

I've also tried to export contact data as a .csv file, again without luck. The file is corrupted with just a huge quantity of unintelligible symbols.

Edit 2!

We are running version 5.5.1

# Answer
Based on the "Notice" in the comment you posted above, it sounds like the issue is one of headers already being sent.

When you generate a .pdf/.docx/.odt file, the web server sends the exact set of bits and bytes necessary to generate that file. However, it assumes that *no other data is being sent*. If, before the document is generated, additional data is sent, you'll get a corrupt document. It looks like that's what you're experiencing.

Check out the answer here: Error when printing PDF letter or mailing label from search results list. It gives links that explain how to suppress notices on your live site, which should resolve this issue.
> 1 votes

---
Tags: search, pdf
---


# Question
Title: Drupal Block on Specific CiviEvent Page (How to?)
I can use this with PHP visibility feature to get a block to show on the Event Page.

```
<?php
$match = FALSE;
if (current_path() == 'civicrm/event/register' && isset($_GET['id']) && $_GET['id'] == 74) { $match = TRUE; }
return $match;
?>

```

However, if they submit the first page and there is a validation error, they get sent back to the URL of: /civicrm/event/register and the visibility setting no longer works.

Does anyone have a way to fix this?

Drupal 7.x CiviCRM 5.5

# Answer
> 1 votes
One option is to use .extra.tpl files to load the data you wish to display, rather than the block. An explanation of the technique is here. This avoids having to worry about whether something that's in scope for CiviCRM isn't in scope for the PHP visibility block.

Another is to check the value of the `$_REQUEST` or `$_POST` supervariables for some element that is specific to this page (e.g. I'm guessing the page ID is in there somewhere). If so, you could test for the presence of that value.

---
Tags: civievent
---


# Question
Title: Is it possible to reassign a contribution linked to a membership?
I had a member sign up for an annual membership while their current membership was still active, but they used a slightly different address and so it created a duplicate contact with a new membership. I merged the two contacts and so now I have one contact record with two memberships. I want to keep the older membership and delete the newer one, so I manually renewed the older one. However, deleting the newer one will delete the contribute record associated with that membership.

How can I reassign that contribution, or at least remove the link between the contribution and the newer membership, so that I can delete that membership?

Thanks!

# Answer
> 3 votes
Through UI its bit difficult(impossible). If its a matter of single record then i would suggest you to use API explorer to do it.

Navigate to CiviCRM \>\> Support \>\> Developer \>\> API Explorer

1. Create Membership payment for old membership (23 is old membership id(without contribution) and 45 is contribution id)
2. Delete new membership.

> Note: Backup db before performing any api actions

# Answer
> 3 votes
Pradeep's answer is good if this is a one-off situation. If you think you might encounter this on an ongoing basis, the Link Membership to Contributions extension is designed precisely for this. CiviCoop produced several useful extensions for administering membership payments including this one.

---
Tags: civimember, contributions
---


# Question
Title: Shoreditch theme breaks CKeditor Link dialog box
When composing an email activity, when Shoreditch is installed (even though CiviCRM admin theme is Garland) if I want to put a link into the email, the dialog box breaks. See attached screenshot. The Link Type and Protocol dropdowns get detached from the dialog box.

Have tested on two sites both running latest versions of extension and CiviCRM.

Changing the admin theme does not fix the issue. Disabling the Shoreditch theme fixes the issue.

Would be nice to fix as the Shoreditch theme is needed for the Mosaico extension.

# Answer
I just tested with Shoreditch activated as CiviCRM custom css, with seven as admin theme and CK Editor worked just fine.

I also tried to replicate your setup, using Drupal 7, Shoreditch 0.1-alpha25, Civi 5.5.3, Garland as CiviCRM admin theme, and custom CSS URL as other instead of shoreditch and I was unable to replicate your issue.

It seems that you are not actually using shoreditch as your civicrm theme. What is listed as your theme when you look at Administer - System Settings - Resource URLs - Custom CSS URL? Do you typically use Garland as an Admin theme? I found that the most compatible theme with shoreditch (when used as Custom CSS) is Seven, as I ran into trouble with other admin themes such as adminimal.
> 3 votes

---
Tags: shoreditch
---


# Question
Title: Problem to view forms registration for anonymous user
I'm using WordPress and Civicrm. I can see user registration when I am logged in but not when I am an anonymous visitor.

Thank you, I'm a French user.

# Answer
> 0 votes
you need to provide access to the guest user/visitor and you can find all the permission in WordPress Access Control

CiviCRM » Administer CiviCRM » Access Control

For more reference please give a read https://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/

I guess this helps !!!

# Answer
> 0 votes
This error indicates that the `Config.IDS.ini` file is malformed. That file should get recreated if it doesn't exist - so go ahead and make a backup, then delete the file.

# Answer
> -1 votes
two screens * URL for the one : localhost/wordpress\_sauv/index.php?smartyDebug=1 * URl for the two : localhost/wordpress\_sauv/2016/06/10/bonjour-tout-le-monde/?page=CiviCRM&q=civicrm/admin/setting/updateConfigBackend&reset=1

---
Tags: forms, user-interface
---


# Question
Title: How to debug the API Action process_mailing?
Drupal Version:7.59
CiviCRM Version:5.3.1
I am facing an error of incorrect Links in Emails sent via scheduled mailings.
The HTML is

```
<a href="https://example.com/sites/example2.com/files/abc.pdf">Test</a>

```

1) When mail is sent manually by selecting **Execute Now**

the links for the pdf works perfectly

2) When it runs via cron the link generated is this /usr/share/nginx/abc/sites/all/modules/civicrm/extern/url.php?u=2937&qid=34399

I need to debug on both #1 and #2, what can be the appropriate files to debug and what can be the process to debug?

I am having a **symlink** so in
Settings - Upload Directories
\[cms.root\]
/usr/share/nginx/abc
\[civicrm.root\]
/usr/share/nginx/abc/sites/all/modules/civicrm
\[civicrm.files\]
/usr/share/nginx/abc/sites/default/files/civicrm

Resource URL
\[cms.root\]
https://example.com/
\[civicrm.root\]
https://example.com/sites/all/modules/civicrm/
\[civicrm.files\]
https://example.com/sites/example2.com/files/civicrm/

# Answer
Harshal,

Check the resource url is set properly. Navigate to CiviCRM \>\> Administer \>\> System Settings \>\> Resource URLS. Click on '?' to see if all the variables have correct values and are pointing to right directories. If not then you may need to update the civicrm.settings.php file for $civicrm\_root variable until the you get th variables right in resource url.

HTH

Pradeep
> 2 votes

---
Tags: scheduled-job
---


# Question
Title: Problem with Aggregating Households Extension after upgrade to 5.3.1
I had this problem after another upgrade and can't figure out how I solved it! (Posted as an issue at github as well.)

Extension installed, Enabled | ver 1.2 and at /home/MYSITEDIR/public\_html/sites/all/civiextensions/me.twomice.civicrm.aggregatehouseholdcontributions

All existing reports error out with:

Fatal error: require\_once(): Failed opening required 'CRM/Aggregatehouseholdcontributions/Report/Form/Contribute/AggregatedHouseholds.php' (include\_path='/home/MYSITEDIR/public\_html/sites/all/civiextensions/com.iatspayments.civicrm/:/home/MYSITEDIR/public\_html/sites/all/civiextensions/de.systopia.householdmerge-1.1.beta/:/home/MYSITEDIR/public\_html/sites/all/civiextensions/com.pogstone.fancytokens/:/home/MYSITEDIR/public\_html/sites/all/civiextensions/nz.co.fuzion.cssinline/:.:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm/packages:.:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm/packages:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm/vendor/tecnickcom:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm/vendor/phpseclib/phpseclib/phpseclib:/home/MYSITEDIR/public\_html/sites/all/modules/civicrm/vendor/pear/pear\_exception:/home/MYSITEDIR/public\_html/ in /home/MYSITEDIR/public\_html/sites/all/modules/civicrm/CRM/Core/Controller.php on line 451

A file by that name is at: /home/MYSITEDIR/public\_html/sites/default/files/civicrm/custom/customphp/CRM/Report/Form/Contribute/AggregatedHouseholds.php

Copying it to: /home/MYSITEDIR/public\_html/sites/default/files/civicrm/custom/customphp/CRM/Aggregatehouseholdcontributions/Report/Form/Contribute/AggregatedHouseholds.php does NOT fix it.

The code referenced is require\_once str\_replace('', DIRECTORY\_SEPARATOR, $className) . '.php'; in the snippet below

$ext = CRM\_Extension\_System::singleton()-\>getMapper(); if ($ext-\>isExtensionClass($className)) { require\_once $ext-\>classToPath($className); } else { require\_once str\_replace('\_', DIRECTORY\_SEPARATOR, $className) . '.php'; }

# Answer
> 0 votes
Its not a good idea to add manually in CiviCRM module folder. The system should pick the file from custom php or extension. Looking initially at the debug you provided looks like the custom php path or extension path is not included. Here are few things i would try before making it work in a unusual way

1. Check directory path is set correctly.
2. Clean up CiviCRM caches
3. Uninstall/disbale and install/enable extension. (Note: If the extension is responsible to store data and uninstall would cause data loss than try disabling-enabling extension)
4. Check if existing extensions is conflicting any problem by disabling the extension and trying.

---
Tags: extension, upgrade, reports, households
---


# Question
Title: Way to sync CiviCRM memberships to Drupal group
The organization I work for wants to create a subscription that provides access to certain parts of our Drupal site using the CiviCRM membership subscription process, wherein they would subscribe to become a member of one of the memberships (there would be a couple dozen of such memberships and special access sections, one per membership type). I haven't figured out a good way to limit access to those parts of the site in Drupal and want to see if groups will do the trick. I am wondering if there is a way to sync memberships in CiviCRM with organic groups in Drupal?

Drupal 7.56 CiviCRM 4.7.27

# Answer
This question gives an answer to a very similar question that you can apply to your situation: Reverse sync CiviCRM groups to Drupal organic groups

However, even with a couple dozen membership types, I still think it might be better to use regular CiviMember-Role sync and use a "limit content access by role" module. I think Content Access is the popular one.

Try both approaches and see what works for you!
> 1 votes

# Answer
Thank you for all the suggestions. I wanted to go ahead and post my solution. We ended up installing organic groups and then using the CiviCRM OG Sync module to sync the Drupal organic groups to CiviCRM groups. The key here is that users sign up on the Drupal end *first* and then get synced to the CiviCRM back end.

The membership types ended up needing a lot of CMS type functionality, rather than CiviCRM membership functionality, so this worked out for us.
> 0 votes

---
Tags: drupal, civimember, groups, roles
---


title: Tags not saving in Profiles

text:
# Question
Title: Tags not saving in Profiles
USAGE: I've created a Profile that includes the global Tagset. I'm using it to designate a Region Tag for all Contacts as we roll out a directory. The Tags have values such as "Northeast", "Northwest", etc.

PROBLEM: When a user saves their information using the Profile, the Tags selected are not saved in CiviCRM and thus the Tags selected are not shown also in their confirmation.

BACKGROUND

1. I have tested that I can save Tags to a Contact within CiviCRM
through the backend. All other fields are being saved correctly.
2. Using CiviCRM 4.7.30, WordPress 4.9.4
3. I have reviewed my WordPress permissions regarding 'tags', but willing to recheck or check others.

# Answer
> 0 votes
I was able to create a Tag set as a Custom Field for Contacts. I was then able to save the selections made by a user through a Profile. This solution is sufficient for my application.

# Answer
> 0 votes
This use case may be better suited to setting up contact classifications using groups rather than tags for a few reasons https://docs.civicrm.org/user/en/latest/organising-your-data/groups-and-tags/#groups-vs-tags

---
Tags: profile, permissions, tags
---


# Question
Title: Selecting all checkboxes for field reverts to one value
On Wordpress 4.9.8 and Civi 5.4.0.

It shows multiple values as long as you do not select all of the options. If you select them all, then it reverts back to just one (petitioning in this case) for some reason. Exporting data only shows the one value as well.

I tried to reproduce on a demo but it was on 5.0 version. Is this a bug?

# Answer
The issue is that the alphabetized option to sort the field labels creates the error. I was able to replicate this on wpmaster.demo.civicrm.org.

To solve, I just put the field values in order e.g. 1,2,3 etc. Now it works.

It's a bug, I'll report.
> 1 votes

---
Tags: custom-fields
---


title: Civicase Report?

text:
# Question
Title: Civicase Report?
> I am very new to Civicrm, and have gotten a lot figured out and some fixes applied on my own.
>
> I am trying to figure out the report features... and maybe very basic \- but.
>
> I am looking to create a report from CIVICASE that lists all the notes for a Case. If there is a tutorial i am very happy to explore that as well, just at a loss for where to look.

Ok I had some time to read more of the forums - and the numerous posts on reporting with Civicase and Civicrm - and i looked at your responses below, but they did not help with my question (made a little more sense, but didn't get what i was looking for)

So I am going to clarify what i am looking for:

1. I need to print an individual report for a Single Case.
2. I need to be able to format the Header of the Report to include: Name of Client, Address, Phone Case Manager, (any other assigned roles to that case)
3. The report information would be a list of dates (for the NOTES activity) Date Person who wrote Note and the "details" of that note. All sorted by Date.

I have looked at Views - but i found that even more confusing. Any direction would be great.

# Answer
If you mean just for a given single case, then there is the Print Report button on the "third row" of the Manage Case screen.

If you want to edit the layout look at CRM/Case/XMLProcessor/Report.php and templates/CRM/Case/XMLProcessor/Report.tpl.

If you mean from some subset of cases then I don't think there is one specifically to search on case parameters and output the notes, but you could start with the activity detail report and on the columns tab check activity details (I assume that's what you mean by "notes" - the details fields on the activities), and on the filters tab choose Include Case Activities, and then possibly filter the date ranges and contacts.

Also the output of Find Cases contains a small triangle in the leftmost column of the result table. Clicking on that triangle shows the activities, although not the details field of the activities.
> 1 votes

---
Tags: civicase, custom-reports
---


# Question
Title: How to add relationship at the time of new user creation in drupal?
I want to add relationship (civicrm) at the time of creation of new user using drupal user. (individual -\> Household).

# Answer
> 1 votes
You could create a Drupal rule to achieve this provided you have that functionality turned on.

Could use the 'Civicrm contact has been created' event.

Checkout the Drupal 7 rules module: https://www.drupal.org/project/rules Civicrm comes with Civicrm rule intergration module which you can enabled (although you may not need to enable this).

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


# Question
Title: Fatal error: Call to undefined method CRM_Contribute_Task::taskTitles()
Civicrm 4.7.31 on Wordpress I get this error when attempting to edit a Membership. Initially, I get a blank pop-up with the message "Network Error. Unable to reach the server. Please refresh this page in your browser and try again." I then right clciked on the link and opened it in a new tab and I get the error "Fatal error: Call to undefined method CRM\_Contribute\_Task::taskTitles() in .../www/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Task.php on line 163"

At the moment, we are unable to view or edit any memberships so that we can edit them and update details or change the status if members cancel. How do we resolve this issue?

# Answer
Sudesh,

I am not sure if you are using right CiviCRM version. As I can see on 4.7.31 the function does exists and the line number you pointed in your question i.e 163 is showing me different code.

Please make sure your code base is using 4.7.31 version and since you are using older version of CiviCRM, I would recommend you to upgrade atleast to 5.3.1 because of security issues.
> 1 votes

---
Tags: wordpress, civimember, error
---


# Question
Title: Activitiy's email content - how is it generated and can it be changed?
When assigning an activity in CiviCRM to a contact using the field "Assigned to". Unless deactivated those contacts get send an email.

My question is, how this email is generated - is there a template somewhere? Or any other way teh email could be changed?

# Answer
> 3 votes
I think the template you're looking for can be found at `Administer -> CiviMail -> Message Templates`, i.e, navigate to `civicrm/admin/messageTemplates?reset=1` and click on `System Workflow Messages`.

The template name is `Cases - Send Copy of an Activity`. Note that you don't need to enable CiviCase component to view this template. It is displayed by default and used to send emails to assignees(both case and normal activities).

Also, if you want to disable the sending of email to assignee for some activity types, there is a new configuration setting added at `civicrm/admin/setting/preferences/display?reset=1`.

The setting is only displayed when the above checkbox of `Notify Activity Assignee` is enabled.

---
Tags: email, activities, core
---


# Question
Title: Competing CiviDiscount Automatic Discounts
We have a standard 10% discount on all of our events for members. On this specific event - we want to have a $5 flat discount for members. The automatic 10% discount is still the only discount working.

Wordpress/Civi - Latest.

# Answer
When using a standard discount - as in this example - all members get an automatic 10% discount towards any event - if you want to provide a different discount for a particular event to override the 10% discount - the following criteria must be met:

1. The other discount must be a percentage if the "standard" discount is a percentage. It must be a fixed discount if the standard discount is fixed.
2. The discount must be greater than the other discount. CiviDiscount will always choose the bigger discount.

Another approach is to not have a standard 10% discount on "any event", and instead manually add the events to the 10% discount code. This is an added step we don't want to deal with. A feature I will request is that CiviDiscount provide an exclusion field, so we can select "Any Event" except:
> 1 votes

# Answer
I would suspect that CiviDiscount is taking the first available discount applicable for the specific event and ignoring the second (since only one can be used). Have you tried removing this particular event from the list of allowed events for the 10% discount to see whether the $5 discount gets applied?
> 2 votes

---
Tags: civievent, cividiscount
---


# Question
Title: What could trigger a transaction rollback on contact save?
I have a few contacts in CiviCRM 4.7.27 for which changes in the "edit contact" form are not saving. The update queries are being sent to MySQL correctly, but they're in a transaction which is being being ended by a ROLLBACK statement, which obviously undoes the changes.

For all other contacts, changes save just fine, with no ROLLBACK.

Example queries from a single "Save" form submission:

```
UPDATE  civicrm_contact  SET contact_type = 'Individual' , contact_sub_type = NULL , sort_name = 'jones, jennifer' , display_name = 'jennifer jones' , first_name = 'jennifer'   WHERE (  civicrm_contact.id = 3198 );
UPDATE  civicrm_uf_match  SET domain_id = 1 , uf_id = 6839 , uf_name = 'jnphillips_22@msn.com' , contact_id = 3198   WHERE (  civicrm_uf_match.id = 2754 );
UPDATE civicrm_group g SET    cache_date = NULL, refresh_date = NULL WHERE  g.cache_date <= '20180503151700';
UPDATE civicrm_setting SET value = 'LnnjD1Un' WHERE name='navigation' AND contact_id IS NOT NULL;
UPDATE civicrm_contact SET  email_greeting_custom = NULL , email_greeting_display = 'Dear jennifer', postal_greeting_custom = NULL , postal_greeting_display = 'Dear jennifer', addressee_custom = NULL , addressee_display = 'jennifer jones' WHERE id = 3198;
... (and lots of delete/insert on civicrm cache tables.)

```

How can I track down the source and cause of this ROLLBACK statement?

# Answer
Here's how I found what was causing the rollback:

1. Grepped the codebase to find that CRM\_Core\_Transaction::rollback() is where a transaction is marked for rollback; there may be any number of good reasons to do this, for example, when using the api parameter 'force\_rollback'
2. Used xdebug with my IDE (netbeans) to get the execution backtrace from this point in the code, trying to find where and why it was called.
3. Following that backtrace, I finally noticed that on this Joomla site, the Joomla plugin CiviCRM Group Sync was what made the api call for which this transaction was marked for rollback.

Other notes:

* I'm not 100% confident this is a bug in the "CiviCRM Group Sync" plugin, because I've been unable to create reproduction steps, e.g., I could not create a contact and cause it to have this bad behavior.
* The workaround was to temporarily disable the plugin, then make any change to the contact, then re-enable the plugin. Users can now make edits to this contact as usual, without this bad behavior.
> 0 votes

# Answer
No errors of any kind, it's just when you get back to contact summary, the data hasn't changed? Strange if that's the case, you'd expect an exception to be thrown.

Are those queries you posted the full list? Have you done a side by side comparison of all queries?

It looks like there are several methods in /CRM/Core/Transaction.php that execute a rollback.

Those may be places that you could run var\_dump(debug\_backtrace()) and look for differences, write it to a file if you have to.

Another thing to try would be to copy all the sql statements, and run them outside of civi, like in mysql directly, or a mysql client, and see if you get an error message from that.

Your not getting anything about database locks in a log are you? https://dev.mysql.com/doc/refman/5.7/en/innodb-deadlock-detection.html
> 0 votes

---
Tags: mysql, debugging, sql
---


title: Link Price sets to imported members

text:
# Question
Title: Link Price sets to imported members
How to link price set to already imported members ? So that when a member login, they can see their membership fee overdue

Jaisal

# Answer
As Pradeep responded to your original question, there is a contact dashboard that will display information about a person's activity (e.g. contributions, memberships, etc.).

Syntax is important when asking questions - a price set is an entity that is used in conjunction with contributions and the contributions will have a given status. You specifically mention the "Overdue" status which is used with pledges, not with contributions - in your original question it sounds like what you want to use are contributions for membership payments (you can use either pledges or contributions, but not both).

You could create a custom membership status rule called "Overdue" and have that be the status assigned to memberships that would otherwise be in "Grace" or "Expired" status, but on the contact dashboard, it will still be listed as "Expired / Inactive Memberships" (at the bottom of the first screenshot below) unless you have word replacement in place. Before word replacement, the contact dashboard would look like this:

Using word replacement to replace the original text of "Expired / Inactive" with "Overdue", the dashboard will look like this:

If this was not the response you were looking for, please try to elaborate further.
> 1 votes

---
Tags: civimember
---


title: Trouble adding custom CiviRule action

text:
# Question
Title: Trouble adding custom CiviRule action
I'm running into some trouble adding my own CiviRule action. I've been able to add the action to the civirule\_action table and confirmed it's showing up in the list of actions in the UI. Whenever I try to save the action in a rule I get the error, "Not a valid action, action class is missing".

I'm not sure if I have placed my php class file in the right location or if something else needs to be done. I'm running Wordpress 4.9.7, CiviCRM 5.2.2, and CiviRules 2.1. The php file is placed in /wp-content/plugins/files/civicrm/org.civicoop.civirules/CRM/CivirulesActions/

What could I be missing?

# Answer
In Create your own action you find a description for extending CiviRules with a custom action. The example action *SoftDelete* has the class `CRM_CivirulesActions_Contact_SoftDelete` should be placed in the file `../ext/org.civicoop.civirules/CRM/CivirulesActions/Contact/SoftDelete.php`

It is also possible to add a custom action to your own extension. An example of such an extension can be found at https://github.com/CiviCooP/org.civicoop.wpcivirules . (But be aware old versions of CiviRules worked with managed entities (`*.mgd.php`) files. This still works but the latest version works with direct sql statements).
> 1 votes

# Answer
The class name relates directly to the path where that class should be found. Placing the file containing your class directly into `CRM/CivirulesActions` won't work.

Your class name in the gist you posted is `CRM_CivirulesActions_EA_Membership_Add`, which means Civi expects to find the class in this location:

```
CRM/CivirulesActions/EA/Membership/Add.php

```
> 0 votes

---
Tags: civirules
---


# Question
Title: Civicrm Development (Coding) Environment Virtual Machine
Is there a VM available for quickly and painlessly getting started with CiviCRM extension development (Wordpress) on Windows? Something that has buildkit installed. I just want to be able to get into learning extension development, on an existing environment that is read-to-go.

# Answer
There's docker, there's vagrant but there isn't a pre-built VM setup.

I can probably knock something up next week if there's a demand for it (we have a local Ubuntu 18.04 BuildKit VM which we have templated for re-use.

https://docs.civicrm.org/dev/en/latest/tools/buildkit/

We're also continually testing BuildKit on Windows Subsystem for Linux and this is so close to working with one issue remaining on the WSL platform which is preventing full functionality.
> 2 votes

---
Tags: extension
---


# Question
Title: How do I use import and export php classes with aegir?
How do I use export.php and import.php to work with multiple sites run with Aegir.

All of them share the same files (php classes) and when I specify the site with -s mysite.org I get nothing (literally the command executes without error it just doesn't output anything).

When I run without spcifying mysite

```
php export.php -e Contact

```

> PHP Warning: include\_once(/var/aegir/platforms/beta/sites/all/modules/civicrm/../../../default/civicrm.settings.php): failed to open stream: No such file or directory in /var/aegir/platforms/beta/sites/all/modules/civicrm/civicrm.config.php on line 118 PHP Warning: include\_once(): Failed opening '/var/aegir/platforms/beta/sites/all/modules/civicrm/../../../default/civicrm.settings.php' for inclusion (include\_path='.:/usr/share/php') in /var/aegir/platforms/beta/sites/all/modules/civicrm/civicrm.config.php on line 118

# Answer
What finally made it work was this:

First I needed to set the `CIVICRM_SETTINGS` env variable to the civicrm.settings.php file for my subsite

```
 export CIVICRM_SETTINGS=/var/aegir/platforms/example/sites/my.site.org/civicrm.settings.php

```

Only then could I execute the php file export.php, not with src but with php-script

```
drush php-script  /var/aegir/platforms/example/sites/all/civicrm/bin/csv/export.php -e Contact

```
> 1 votes

# Answer
To execute a PHP script in the context of a selected site, use `drush php-script` or `drush scr`.

In your question you specified the site using `-s example.org`, and I suspect you may be looking for `-l` (`--uri`) rather than `-s` (`--simulate`) to determine which site to load. See the first section of `drush help` output for these flags.

If `-l` doesn't do it, you can also use aliases which Aegir automatically creates for each site - you should find that `drush @example.org vget site_name` works and returns the name of the expected site, because there will be alias files in eg `/var/aegir/.drush/EXAMPLE.ORG.alias.drushrc.php` for each site.

So, you probably want something like: `drush -l example.org scr /path/to/export.php`

* If `drush vget site_name` returns the name of the expected site, you've confirmed Drush can connect to Drupal.
* If `drush cvapi Contact.get` returns contacts from your site, you've confirmed that CiviCRM works when called via Drush.
* If `drush scr import.php` or `drush scr export.php` still don't work, that sounds like those scripts don't bootstrap "normally" for CiviCRM and there may be work to do to get them to behave.

I don't actually know how `import.php`/`export.php` are expected to behave - so I might have led you astray. Looking at them, I'd expect `export.php` probably works via Drush, but I see `import.php` is looking for `$_GET['file']` which Id' expect to require special treatment for Drush use (but I see this SE answer says it works using `--file=blah.csv`, and that you should call them via `php import.php` not `drush`).
> 1 votes

---
Tags: import, civicrm.settings.php, core, multisite, drupal-multi-site
---


# Question
Title: Cannot update membership status (No drop down)
After upgrading to Civicrm 5.21 (it's now on 5.5.3) there is no longer a drop down for changing membership when Status override is enabled.

This was working on 4.7 but sadly after the upgrade it seems to be just static.

Here is the example from the documentation

Any help much appreciated!

Update: So I fixed a JS error (maybe something with git, was in there as lower case). **No fix for the drop down issue yet though..**

# Answer
When upgrading check all customised files include all the correct changes for your current version.

I was missing a section of code in the membership template.
> 1 votes

---
Tags: civimember
---


# Question
Title: External URL for CIVIMail on localhost installation
I have a locally installed civicrm. Sending mass mails works fine, but as images are stored locally on the server, recipients cannot see the images nor do click-through-URLs work (as they go over localhost).

Is there any possibility to change the image storage folder to another URL outside the standard civicrm structure (e.g. a website)?

Thanks!

# Answer
> 1 votes
This is only a partial answer, but the main challenge will be getting files to save to the remote server. Retrieving them will mainly involve adjustments on *Administer \> System Settings \> Resource URLs*.

If you can get a local folder to sync to a remote file host, that might work well. Long run, a nice feature would be to have an option to save files directly to S3 or something.

# Answer
> 1 votes
To make images visible you can use images that are not on your local server. Add the url of the image in the image properties.

I've not tried using an external server on the Image Upload URL (Administer \> System Settings \> Resource URLS), but you could try that too.

# Answer
> 0 votes
That's how I solved it for the moment: 1) Changed the image folder in Administer \> System Settings \> Resource URLs to a web server address. 2) I made a template with images named 1.jpg, 2.jpg etc. with the URL pointing to the folder on the webserver. When the user wants to insert new images for a mailing, he has to upload the new images named 1.jpg, 2.jpg etc. via ftp to the web server. Not yet very satisfying but at least it works and the user doesn't have to change html code.

Would be great if I could make civicrm upload files via ftp to a webserver. Also still struggling to find a solution for click-through links when on a local server to get some more statistics.

# Answer
> 0 votes
For image, you can use Amazon S3 (payment require) or other Web Server where you can upload image and get an url to embed
For URL, simply disable Tracking each time you send CIVIMAIL

# Answer
> 0 votes
You can install CiviProxy on another server - a free or low-cost VPS should be more than enough. CiviProxy will cache the images. It will also ensure that unsubscribe requests, etc. are taken care of. CiviProxy has a setting to rewrite the URLs of the images to the proxy server.

---
Tags: civimail
---


title: Is there any civicrm api for android?

text:
# Question
Title: Is there any civicrm api for android?
Please share the link for civicrm android API for android. Any git site. And also send some tutorial regarding to API.

# Answer
You can just interact with the CiviCRM API from your android app.

https://docs.civicrm.org/dev/en/latest/api/

Android documentation is very good has all the information you need for the Android side of things.
> 4 votes

---
Tags: api
---


# Question
Title: Could not create database trigger (AWS, RDS)
How can I fix this issue about database trigger. I attached the screenshot for the info. Thanks so much for the help\]

# Answer
> 1 votes
You will need to grant access for mysql user to create triggers. You can run below command in mysql using super privilege user(root)

```
GRANT TRIGGER ON <db_name>.* TO '<db_user>'@'localhost';

```

HTH

Pradeep

---
Tags: database, aws
---


# Question
Title: Upgrading from 4.7.25 to 5.6.0 breaks CiviCRM
When attempting to upgrade CiviCRM version 4.7.25 to 5.6.0 I ran into a number of issues. To rule out this is caused by something specifically from 5.6.0 I also tried 5.4.0. Unfortunately, this did not make any difference.

I get the following error when viewing the 'System status' screen:

Warning: Declaration of CRM\_Volunteer\_Permission::check($permissions) should be compatible with CRM\_Core\_Permission::check($permissions, $contactId = NULL) in /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/Permission.php on line 151

The screen stays empty for the rest. After clearing the cache, I also get the following error:

Fatal error: Uncaught Error: Call to undefined method CRM\_Core\_BAO\_Address::isSupportedParsingLocale() in /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/AddressParsing.php:45 Stack trace: #0 /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php(54): CRM\_Utils\_Check\_Component\_AddressParsing::checkLocaleSupportsAddressParsing() #1 /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(209): CRM\_Utils\_Check\_Component-\>checkAll() #2 /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(93): CRM\_Utils\_Check::checkAll() #3 /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php(218): CRM\_Utils\_Check-\>showPeriodicAlerts() #4 /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/Civi/Angular/Page/Main.php(70): CRM\_Core\_Page-\>run() #5 /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugin in /var/www/html/civicrm\_viva\_las\_vegas\_nl/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/AddressParsing.php on line 45

The upgrade process itself seems to run very smoothly, it does not give any errors.

What could cause the above errors?

# Answer
> 4 votes
Jack,

There seems to be problem with the extensions you have installed. Try upgrading CiviCRM after disabling all the extensions. Some extension might not be compatible with latest version of CiviCRM. As a best practice we disable all the extension or plugin of CiviCRM and then perform CiviCRM upgrade. Once finished with upgrade we turn on extension or plugin one by one.

HTH

Pradeep

---
Tags: upgrade
---


# Question
Title: why does dashboard membership number not match list of members?
my membership dashboard shows 901 current members.

when i click the clickable '901' I get a list of 902 members!

i cannot figure out why :/

what is the difference please between the query that generates the total membership number in the dashboard and the query that runs when you click on the number?!

# Answer
> 5 votes
The dashboard is programmed to show memberships that have a start date, whereas the search is not including that filter. If you are getting a different number in the search than in the dashboard, click on the Start date column to sort in descending order to find the record that is missing a start date - once you update that record, the numbers should be one and the same on the dashboard and on the search.

Hope this helps!

Editing to include screenshot regarding my last comment:

---
Tags: civimember
---


# Question
Title: How do I call the Fatal Error Handler for extern/url.php?
I noticed my Fatal Error Handler wasn't being called when CiviCRM had problems processing trackable URLs in a CiviMail.

My answer will tell you how to do this.

# Answer
When extern/url.php is invoked, the CMS is not bootstrapped and extern/url.php require\_once's all the code it needs to run. So if you specify a Fatal Error Handler (CiviCRM \> Administer \> System settings \> Debugging and Error Handling) it won't be found.

To resolve this, edit extern/url.php to add a require\_once statement which names the file containing your handler. (Be careful this file doesn't execute code that will impact on extern/url.php - mine only has function definitions.)
> 1 votes

---
Tags: civimail, errorhandling
---


# Question
Title: Which directories in an extension get scanned by CiviStrings
CiviStrings is a cli tool that scans an extension for translatable strings and generates a .pot file. According to the readme,

> It scans PHP, Smarty, JS, and partial HTML files for references to the ts() function -- and generates a list of strings using gettext's POT file format.

I'd like to know which directories it scans in an extension. I know it will scan files in the `/ang` directory, but what if I place an html file somewhere else, like `/foo/bar.html` \- will that file also get scanned?

# Answer
The `civistrings` command doesn't have a prescribed list of directories. It takes a list of paths (files or directories) as an input. For example, here's an excerpt of running it against the `api4` extension:

```
[nix-shell:~/bknix/build/dmaster/sites/all/modules/civicrm/ext/api4]$ civistrings $PWD
#: CRM/Api4/Upgrader/Base.php
msgid "Upgrade %1 to revision %2"
msgstr ""

#: Civi/Api4/Service/Spec/Provider/CustomValueSpecProvider.php tests/phpunit/Action/CustomValueTest.php
msgid "Custom Table Unique ID"
msgstr ""

#: Civi/Api4/Service/Spec/Provider/CustomValueSpecProvider.php tests/phpunit/Action/CustomValueTest.php
msgid "Entity ID"
msgstr ""

#: ang/api4/Explorer.html
msgid "CiviCRM API v4"
msgstr ""

```

At time of writing, the scanner will look for `ts()` expressions in any files which match the following:

* File-name ending with `.js` (parsed as Javascript code)
* File-name ending with `.html` (parsed as HTML with embedded Javascript)
* File-name ending with `.setting.php` (parsed as a Civi settings file)
* File-name ending with `.tpl` or `.hlp` (parsed as a Smarty file)
* File-name ending with `.php` or file-content starting with a PHP signifier in the first line (parsed as PHP code)

This arrangement allows you to keep-it-simple in the typical case of a single extension (i.e. "just scan the entire extension and put all strings in one file"). This also allows you to deal with more complicated arrangements (e.g. `civicrm-core` is large and includes several components split among various subfolders). `civistrings` is focused on the technical mechanics of scanning for `ts()` -- and tries to be agnostic about the directory-structure.
> 3 votes

---
Tags: extension, i18n
---


title: Custom PHP not being picked up

text:
# Question
Title: Custom PHP not being picked up
I've been pulling my hair out trying to get this working. There is a file in core that throws up errors using the SagePay extension from Circle. I can edit the core .php file and fix the problem. Obviously each time I update it is overwritten. So I have created the same directory structure under civicrm\_custom\_php and added the edited file. Directory paths are correct, but the file in custom isn't being picked up. Any hints or tips really appreciated on getting this working. I am running CiviCRM 5.6.0 on Drupal 7.

Thanks

# Answer
> 5 votes
The SagePay extension from Circle is outdated and is not supported for 5.x version. Mattwire has integrated sagepay payment processor in Eileen's CiviCRM OmniPay Multiprocessor extension. The simplest, easy and recommended solution would be to install the omnipay extension from Matt's git repository(sagepay branch). Move old payment processor from all Contribution and event pages to new sagepay payment processor either by running sql or updating manually.

HTH

Pradeep

---
Tags: php
---


# Question
Title: How can I set custom field date field for default date to be today's date?
The threads I have seen are from 2009...

Is there a solution for this in 2018?

Something that would dynamically set current date as default?

# Answer
> 2 votes
I am not sure if this is possible through UI configuration. The form only allows you to enter valid date but not now(), CURRENT\_DATE() etc. However it is definitely possible by adding a small code in a extension.

1. Create and enable a new CiviCRM extension
2. Implement the hook\_civicrm\_buildForm in your extension

For the appropriate variable do:

```
function ext_civicrm_buildForm($formName, &$form) {
  if ($formName == 'REPLACE_WITH_FORMNAME') {
    $defaultDate = [];
    CRM_Utils_Date::getAllDefaultValues($defaultDate);
    $defaults['custom_XXX'] = $defaultDate;
    $form->setDefaults($defaults);
  }
}

```

---
Tags: dates
---