# Question
Title: How can I show groups in membership report columns?
I've got the request to display (certain) groups in the membership detail report. A lot has been written over time about customizing reports, and I'm not sure what info is up-to-date. This looks good: https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/

I think roughly, I would need to

* set up the paths for custom templates and php files at setting/path
* create a custom template with just a single {include file="CRM/Report/Form.tpl"}
* create a custom php file copied from CRM/Report/Form/Member/Detail.php
* register both using Administer –\> CiviReport –\> Manage Templates
* in the php file, append stuff to \_columns and from()

is that correct ? Has anyone already done something like this for groups .. ?

# Answer
> 4 votes
The current correct way to create a custom report is to use an extension, rather than the manual process linked to in the question.

Updated documentation for creating a report extension is found here:

https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report

The link in Donald Lobo's answer is now broken, but an old version of the document is still available here:

https://wiki.civicrm.org/confluence/display/CRMDOC46/Create+a+Report-Template+Extension

# Answer
> 3 votes
A better approach might be to use an extension rather than the above. Documentation for report extensions here:

http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Report-Template+Extension

You might be able to borrow some code from other reports which show the groups a contact belongs to (not sure if any report does so)

---
Tags: civireport, groups, custom-templates
---


# Question
Title: How to create a Drupal View with multiple CiviCRM relationships?
I would like to create a Drupal View showing an organization and several individuals who are related to the organization in different relationships. The wording on the CiviCRM Drupal relationships options is ambiguous, and I am struggling to find clear documentation describing CiviCRM relationships in Drupal Views.

How do I create a View showing several related entities linked to a common entity by distinct relationship types?

# Answer
You can use the relationship section of a view for this. A relationship in a view is a relationship between entities don't confuse it with the relationship you have between contacts.

So you could set up a view relationship starting from contact a (the a side of the civicrm relationship), or from contact b (the b side of the civicrm relationship). This a link to the civicrm relationship entity. When you add this relationship to the view you can define which civicrm relationship type.

The next step is to make a view relationship between the civicrm relationship entity and the contact. This relationship is called CiviCRM Contact, the Contact B, or CiviCRM Contact the Contact A.

Then in the fields section of the view you can add fields based on the entity. You can then say for example I want to use display name of Contact B.

If you are familiar with SQL. A view relationship could be described as a join.
> 9 votes

# Answer
I am not sure from the question whether each relationships is connected to the original contact, or if some might be daisy chained eg Parent to Student to School etc. In case it is the latter, here is a snip from an old forum post which might help

CONNECT A to B

Add DV relationship 1 of type "Connects a contact (as contact A) to a relationship." (eg employer of)

Add DV relationship 2 of type "The contact B" use DV 1 as the 'Relationship'

So you have now connected person X to Org Y

CONNECT B to C

Add DV relationship 3 of type "Connects a contact (as contact A) to a relationship." (eg Primary Contact of) - use DV 2 as the 'Relationship'

Add DV relationship 4 of type "The contact B" use DV 3 as the 'Relationship'

OUTCOME

So now you should have connected person X to Org Y and then Org Y to person Z.

etc

ANOTHER EXAMPLE might be if you want to show grandchildren where you have multiple parent-child relationships including some 2 level situations.

so Person A is Parent of Person B, and Person B is Parent of Person C

Hence Person A is 'grandparent' of Person C
> 5 votes

# Answer
This is an update to the answer given by petednz - fuzion. In my case I needed to create a view which showed a list of all employees of the organisation employing the currently logged in employee. In other words if a contact is logged into the website (Drupal), they can see the details for their organisation and all the employees of their organisation.

I followed the steps given in the answer by petednz, but this didn't work for me. I needed to adjust his section when connecting B to C to get it to work. The steps I followed were:

1. Create user view
2. Create relationship from user to CiviCRM contact (to create link from current Drupal user to their Civi contact details)
3. Add Current User to filters (to only show information for logged in user)
4. Create relationship for CiviCRM Relationship (starting from contact A)
5. Create relationship: CiviCRM Relationships: Contact ID B (4 & 5 connects currently logged in user to organisation)
6. Create relationship: CiviCRM Relationship (starting from Contact B)
7. Create relationship: CiviCRM Relationships: Contact ID A (6 & 7 now shows all employees connected to the organisation shown in step 5)

To show fields relating to the currently logged in user use the relationship defined in step 2.

To show fields relating to the organisation, use the relationship defined in step 5.

To show fields relating to the employees of the organisation, use the relationship defined in step 7.

The difference between my answer and petednz's answer is that when he is connecting B to C, he creates the CiviCRM Relationship (starting from Contact A), and I use the CiviCRM Relationship (starting from Contact B), and then he creates the CiviCRM Relationships: Contact ID B, and I create the CiviCRM Relationships: Contact ID A.

I have created an export of my view which demonstrates the answer.

It should then be possible to create one part of the view to show the organisation details and then an attachment view to show the employees to tidy things up.
> 5 votes

---
Tags: drupal, relationships, drupal-views, drupal-7
---


title: BaseURL change problem

text:
# Question
Title: BaseURL change problem
I installed my Civicrm with the IP address of the server which turns out to be a "Bad Idea" (TM). Now when trying to enter various posts, such as membership details or new events I keep getting "logged out" (clicking save redirects to a login page for the IP-address).

I tried changing BASEURL in the civicrm.settings.php file, then clear all caches - but I still get this behaviour. Which is extremely annoying. How do I fix this?

# Answer
Go to `Administer > System Settings > Directories` and `Administer > System Settings > Resource URLs` and make sure those show the new values. Depending on your CMS, you may need to make changes to its configuration as well.
> 1 votes

---
Tags: default-settings
---


title: Does CiviRules work with smart groups?

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

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

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

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

---
Tags: smartgroups, civirules
---


# Question
Title: Removing Carriage returns after a blank address field?
We have an address block on some pdf templates in CiviCRM some contacts have address2 or address3 lines while other do not.

Using the normal tokens we end up getting blank lines and the address block looks messy.

Has anyone found a way of conditionally formatting the address block to not create these blank lines?

I was looking for some IF(Token not NULL THEN add Token and carriage return ELSE nothing) but can't find any solution online.

Thanks,

Dave

# Answer
> 3 votes
Try to use as below which does the job

```
<div>{contact.addressee}</div>
<div>{contact.street_address}</div>
<div>{contact.supplemental_address_1}</div>
<div>{contact.supplemental_address_2}</div>
<div>{contact.city}</div>
<div>{contact.postal_code}</div>

```

OR

I am not sure about replacing the in-build token using IF statement

But you can create an Address block token on your own where you can remove blank lines - and you can use address block token in the PDF

http://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens

I guess this help - if you need more details please let me know - thanks

# Answer
> 0 votes
Aha - worked out how to do this. You need to use smarty for conditional logic. See https://docs.civicrm.org/sysadmin/en/latest/config/message-templates/ to see how to turn on smarty for mail/pdf templates. I also used https://www.smarty.net/docs/en/language.function.capture.tpl to work out how to do it.

Then in the template you need something like:
{capture assign=temp}{contact.supplemental\_address\_1}{/capture}
{if $temp ne ""}
{$temp} XXX
{/if}

But where I have XXX above there is line break HTML markup (Can't work out how to get that through the markup for stack exchange. Hope that makes sense!

---
Tags: tokens, pdf, message-templates
---


title: Address line blank in pdf letter

text:
# Question
Title: Address line blank in pdf letter
When adding all of the address fields in a PDF letter i am getting a blank line for supplemental address line 1 if that user does not have that field populated. Is there any way to avoid having a blank line? i am doing a large mail merge using this and it does not look professional to have a blank line in the address block. Here is how i have the tokens setup.

{contact.display\_name} {contact.current\_employer} {contact.street\_address} {contact.supplemental\_address\_1} {contact.city}, {contact.state\_province} {contact.postal\_code}

# Answer
> 4 votes
The issue isn't 100% clear because your formatting doesn't allow me to perfectly understand which tokens have a line break after them and which have a space - but I'm pretty sure I know what's going on. By default, if a token evaluates to NULL and there is NOTHING else on that line, the line will be omitted entirely when producing address labels.

However, from your token listing, it seems that you have a space after `{contact.supplemental_address_1}`. That's going to cause a space on the line, even if there's no supplemental address value.

If for formatting reasons you need a space there if there IS a supplemental address, there's a trick. Let's look at the default mailing address format:

```
{contact.addressee}
{contact.current_employer}
{contact.street_address}
{contact.supplemental_address_1}
{contact.supplemental_address_2}
{contact.city}{, }{contact.state_province}{ }{contact.postal_code}

```

Note the `{, }` after the city and the `{ }` after the state/province. It's not well-documented, but that means, "include a ', ' after the city if a city exists" and "include a space after the state/province if a state/province exists".

# Answer
> 2 votes
Check your template html and ensure you are using `<p>` not `<BR>` tags to end the lines

# Answer
> 0 votes
I'm a bit confused by some of the comments above which refer to labels which seem to be a different mechanism. I think that my answer to Removing Carriage returns after a blank address field? solves the problem.

I found removing the space before BR markup didn't solve the problem and that using P markup instead of BR markup mean the lines were spaced too far apart

I also appreciate the problem of formatting answers particularly when there is markup in it. I could not make this look right!

---
Tags: tokens, pdf, address-labels
---


# Question
Title: Any way to avoid "deprecated function" messages in the Drupal dblog?
I am getting a LOT of entries in the Drupal dblog (watchdog) about a deprecated PHP function, as described here - Debug PseudoConstant

I'm trying to debug a different issue and the presence of these (hundreds) of messages is making it very difficult.

Is there a way of turning down the logging level so that deprecated function messages are not shown? It seems odd to include them, because admins cannot even do anything about it, it's just for developers.

(I know I can filter the log by component and by severity; however, the messages I am interested in are also marked "civicrm" and "debug", so that doesn't help. And in any case, the Drupal UI only shows recent messages, so when there are hundreds of irrelevant ones, it doesn't have room for many of the ones I want to see.)

# Answer
The types of PHP errors and warnings being logged to Drupal Watchdog typically reflect the level of error reporting set for the webserver. If you can edit your vhost config or .htaccess, you could change the error reporting level. Refer to http://php.net/manual/en/errorfunc.constants.php for the different error levels.

Based on your request, you probably want to disable/exclude error reporting for the following level:

* 8192 E\_DEPRECATED

In .htaccess, you'd add `php_admin_value error_reporting 22527` to disable just E\_DEPRECATED.

---

Should you find that you're still getting other deprecated warnings after applying the change (and possibly restarting server if change was made in vhost), you may want to also exclude the following error level/type:

* 16384 E\_USER\_DEPRECATED

See https://stackoverflow.com/questions/5628148/disable-e-deprecated-in-php-error-log for more background on how you can get the bitwise value (error level) for a custom combination of error types.
> 1 votes

---
Tags: drupal, error, php, logging
---


# Question
Title: Webform: recommended permissions handling when using existing contact feature
I'm wondering how other developers configure permissioning for webforms where related contacts are shown. Here's the setup:

* webform is configured to display two contacts -- the logged in user and a related org
* the "existing contact" element is used for both contacts. the issue arises for the related org contact
* we are using the static widget and the option to use contact id from url

However, when cid2=# is passed in the URL, it doesn't load the organization contact *unless* the logged in user has the "edit all contacts" permission. I understand I could flag the relationship as permissioned and use the relationship ACL extension, but I don't really want to universally grant the user the ability to edit the related contact -- just grant access in this webform. And I definitely don't want to grant the edit all contacts permission.

Any suggestions on ways to handle this? Should I just modify permissions via hooks on this form? It seems like this would be a common use case so I'm wondering if there's something in the webform integration that I'm missing.

# Answer
> 1 votes
Not that I'm aware of. Permissions in CiviCRM typically follow the logic "you either have permission to access this contact, or you don't." There isn't really a concept of having permission to access a contact on one form but not in other contexts.

A different approach would be to disable permission checks for the org field on that form, but only allow trusted users to access the form (who are not likely to abuse it by hacking other cids into the url).

---
Tags: webform-civicrm
---


# Question
Title: Not sure what to do with these errors on User Dashboard
I have wordpress redirect users that login to their User Dashboard. When I login as an administrator I always get the following error:

```
Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/VersionCheck.php on line 429

Warning: file_get_contents(https://latest.civicrm.org/stable.php?format=json): failed to open stream: no suitable wrapper could be found in /home/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/VersionCheck.php on line 429

```

Any idea what this is about?

# Answer
> 1 votes
This line:

```
 https:// wrapper is disabled in the server configuration by allow_url_fopen=0

```

suggests to change **allow\_url\_fopen = 1** in **php.ini** file on your hosting server.

---
Tags: user-dashboard, version
---


title: Manually uninstall an extension

text:
# Question
Title: Manually uninstall an extension
I installed the i10n extension on 4.7.24 and it totally FUBARed parts of the admin interface, I only get a blank screen. How can I manually remove the extension (Extension menu is FUBARed too).

# Answer
Not quite an answer to the question, but if you didn't know, there is civicrm\_extension table and you can at least set it to not active

otherwise if you have cli (and eg are on Drupal) you can use

* drush ceui

other such commands are listed here
> 2 votes

---
Tags: extension
---


# Question
Title: membership tokens not showing for mail in CiviMail
Using CiviCRM 4.7.24 and WordPress 4.8.2.

I'm trying to send an email with membership information in it. It works fine with a Print to PDF, but not with an email. I am using Find Membership to get the contacts (thanks to Add Membership Token to PDF Template Joomla) for pointing this out. So why is it different for emails?

# Answer
some tokens are only available when sending from 'that context'. Fuzion made an extension some time ago to get around this and hopefully you will find it provides what you need.

You can check it out here
> 1 votes

---
Tags: civimail, tokens
---


title: Notes - searching

text:
# Question
Title: Notes - searching
How do I find a list of the notes I have added. I input a number of notes last week but neglected to grant permissions. how do I locate a list of those notes?

# Answer
If you want to find all the users with Notes, you could use Advanced Search, expand the Notes section and enter '%' in the Notes text box (don't type in the quotes, just %) % means 'match anything' but there must be a note there to match against.

If you want to limit that to those changed last week you can expand the Change Log section and set the Modified Between date to something suitable. Note that this will give you those who have a Note and were modified last week - but it does not necessarily mean the Note was modified last week.
> 2 votes

# Answer
A similar approach to Aidan's would be to use Search Builder for this. You hit the same issue that you will only pick up the date of the Contact record have some sort of modification made, but the benefit of Search Builder is you get to see the Note (Subject and/or Body) in the results table, eg the below (hmm though that seems to show that the Body actually didn't return the body and the Modified Date has slipped across one column. But hopefully it gives you the idea and that you can proceed without using the Body Only field
> 1 votes

# Answer
If you have mysql access to the database, then in civicrm\_note table you have the following columns so could use a sql query to get the required
> 0 votes

---
Tags: database, activity
---


# Question
Title: CiviCRM - Contribution page profiles JavaScript error
before you send me to check already solved similar questions, this is not the same case.

Common problem is conflict with installed plugins -\> disable/enabled them all, none, different order = nothing (I dont have jetpack, google dashboard, wp cards)

Another cause is template -\> changed template, no difference but if I add Civi into blank Wordpress instalation it works.

Does anyone have same experience that it cannot be fixed with the "common" way ? And if yes did you manage to fix it ?

# Answer
> 1 votes
Try using one of the basic WordPress Themes like Twenty Seventeen or Twenty Sixteen. If it works with one of these themes, pick a new theme that you like.

You probably have to pick a theme from another company altogether. The theme designer probably has a base package that he/she uses and the problem will follow from theme to theme in their suite.

---
Tags: wordpress, civicontribute, backbone
---


# Question
Title: SQL error trying to delete activities following CRM-20958
Now that Civi version 4.7.25 has introduced creation\_date for activities, I am having SQL errors when I try to create a new activity or delete a recent activity, which results in fatal errors:

> Unknown column 'created\_date' in 'field list'

I can't replicate this in the CiviCRM sandbox (http://dmaster.demo.civicrm.org/civicrm/), although that is running Civi 4.7.28.

If I run the SQL command in phpmyadmin, then it gives the same error, so I guess there's some problem with the table civicrm\_activity since updating to 4.7.25

Any ideas?

# Answer
> 2 votes
Start by checking that the `civicrm_activity` table does have a `created_date` column. If not, maybe something went wrong with the upgrade process - which is a bigger issue.

If it does exist, do you have logging enabled? When you change `civicrm_activity`, a trigger will update the related `log_civicrm_activity` table and if that does not have `created_date` then the original action will fail. If that is case, you can disable and then re-enable logging at `Administer > System Settings > Misc` which should fix the problem.

---
Tags: activities
---


# Question
Title: How can I get Civi CRM to display the currency in reports and so on
We have an organisation that can accept money from all around the world. It's usually cash or cheque when that happens. We can record the currency type in the contribution form when entering values. And also on import.

But it's almost impossible to then see what currency a value actually is.

It doesn't show in any of the reports. In fact, when I try to create a custom report, it's not even available as a field to select.

The only way I've found to see it is to drill down to the full details of the contribution, which is really slow and in-efficient.

Can I add it back somewhere?

# Answer
> 2 votes
Oh it's defintively available in a report - let me get to my desk and show you an example;

Install: Extended Report Extension: Got to your Adminster -\> System -\> Settings -\> Manage Extensions -\> Add New -\> ExtendedReport (nz.co.fuzion.extendedreport)

After you've installed it -\> go Administer -\> CiviReport -\> Create New Report from Template and select e.g. Extended Report - Contributions with Price Set data

Voila - there is your Currency -\> I've checked it to show you where it lives:

---
Tags: civicontribute
---


# Question
Title: Civivolunteer won't show link unless logged in as admin
We are using Civi 4.7.22 on Wordpress 4.8.22. We recently installed the updated version of civivolunteer 4.7.21-2.2.2

After setting up civivolunteer and adding it to an event, the volunteer link does not show up for anyone who is signing up for the event unless they are logged onto Wordpress as an Administrator role. Even being logged in as a Subscriber will not show the Volunteer opportunities link, even when I copy and paste the actual link.

Am I missing something or is this a known issue?

Thank you.

# Answer
Solved, Be sure to set permissions in Administer \> Users and Permissions. Check all roles you want to access volunteer opportunities at CiviVolunteer: register to volunteer and CiviCRM: access AJAX API
> 1 votes

---
Tags: civivolunteer
---


# Question
Title: CiviCRM uses mail server account address as sender
I log in as a user of CiviCRM. I then go to a contact and send an email as activity. Even if my mail address is shown as sender in the mail, when the mail is recieved - the sender is the account used to log in to the mail server (GMail). It seemingly does not use "By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. "

How do I keep my CiviCRM user mailaddress as the sender on the recieving end?

# Answer
> 2 votes
As Martin said, this would appear to be a gmail thing.

I know that gmail accounts can be configured to send email on behalf of other accounts. If you were able to set that up gmail settings, it might allow you to send on behalf of that person.

---
Tags: email
---


title: How do I get the genuine error message

text:
# Question
Title: How do I get the genuine error message
I am trying to reinstall the volunteers extension and am getting an error that isn't clear. Is this my version of PHP or missing PEAR packages that is causing the lack of clarity?

```
Use of undefined constant PEAR_ERROR_CALLBACK
- assumed \'PEAR_ERROR_CALLBACK\'\";s:9:\"%function\";s:38:\"CRM_Core_TemporaryErrorScope::create()

```

CiviCRM 4.7.25 PHP 5.5.38

# Answer
> 4 votes
A look at the only code which references `PEAR_ERROR_CALLBACK` in CiviCRM core is telling - the file comment starts with *This is an evil, evil workaround ...*.

So you've probably uncovered a legit unexpected bug or misbehaviour here. Something about the site setup or the volunteers extension seems to be upsetting things, but in a way that might not be experienced by the majority of sites.

Your PHP version is OK if not great, and your installed PEAR libraries should not interact with CiviCRM (which bundles its own copies of PEAR libs). So I don't think those should be your problem.

In your situation, I'd first check the Debugging and Error Handling settings (see `civicrm/admin/setting/debug` in your CiviCRM install) and make sure there aren't any unexpected "error callback" settings. Also check out what other extensions (especially debug related) are present in your install; try disabling those if present.

Next steps to debug would be to find backtraces in the CiviCRM debug log, and understand what code path is leading to this error.

---

*More thoughts ...* Assuming `CRM_Core_TemporaryErrorScope::create()` works the rest of the time, then we know `PEAR_ERROR_CALLBACK` is defined the rest of the time. This means that when you hit this error, you're hitting that method when PEAR hasn't been loaded at all.

The constant ought to be defined when PEAR is loaded during CiviCRM bootstrap; CiviCRM isn't going to get much done without PEAR, since it relies on that for essentials like DB access. This suggests CiviCRM has not been fully bootstrapped - we see similar issues also when the CMS is not bootstrapped, so Drupal / Joomla / whatever functions or constants are not available.

The above could mean that the means of installing CiviVolunteer is being incorrectly applied, or that CiviVolunteer installation is broken. I don't know which; if you expand your question to **describe the steps you're taking to install CiviVolunteer**, that could improve the quality of answer you can get.

# Answer
> 2 votes
The genuine error message you're looking for is likely buried in the stack trace that CiviCRM will have written to the CiviCRM log file, and will likely require some sleuthing.

As per Chris' notes, it probably indicates an unhandled exception in CiviVolunteer, and helping them handle it better would be very nice.

Shameless plug: you can use this extension to make it easy to view/parse that log file.

---
Tags: extension, error
---


# Question
Title: How to empty the trash? (permanently delete)
I know you can permanently delete a deleted contact from the contact's screen, but **how can you en-masse delete all the deleted contacts** or "Empty Trash"?

Ideally delete all things trashed over 30 days ago would be fab.

It's especially needed for my client because deleted contacts still show up in Constituent Summary and other reports

# Answer
Go to Advanced Search, tick the box, 'search in trash'. hit 'enter/search' - that should give you all those in Trash (and ONLY those in Trash) and from Actions you can then choose 'permanently delete'

EDIT - can also be done via API Explorer: Permanently delete more than 100k trashed records
> 2 votes

---
Tags: 4.7, delete
---


# Question
Title: Want to display in a profile that a particular contact is part of a smart group related to their membership type
We have created a member dashboard in Drupal which displays a civicrm profile with civicrm membership details. Since I could not display membership type in the profile, I created a smart group which automatically adds a contact to a particular group related to their membership type.

However,when the contact views their profile, it is not showing that they are part of a particular group even though the field is publicly listed. I saw a post here https://forum.civicrm.org/index.php?topic=34060.0 which says its not possible. If so , is there any other way that I can display that the contact membership type in a profile listing?

# Answer
> 0 votes
If you are using Drupal, why not make a Views Block showing membership status/type and put this somewhere eg /user?

I understand I am not answering the OP of 'how to show a Smart Group in a profile' but am trying to answer a more generic question "how can i show a user their membership type"

You may find a downloadable view that already does this in our Treasure Trove eg this one

---
Tags: civimember, profile, smartgroups
---


# Question
Title: Enable Volunteer Opportunity Listing with Wordpress
I am using CiviVolunteer with wordpress and I am trying to enable the volunteer Opportunity Listing. I tried the following link the http://address-to-your-site/civicrm/vol/#/volunteer/opportunities link with my domain and I am not able to see it. I have angular profiles enabled, and I granted access to AJAX API and CiviVolunteer: register to volunteer to anonymous users, but I am still not able to see this list publicly. Is there something else wordpress users need to do to view the volunteer opportunity listing?

# Answer
> 3 votes
If your wordpress install will not show volunteer opportunities, this is what worked for me:

/civicrm/?page=CiviCRM&q=civicrm/vol/#/volunteer/opportunities

instead of: /civicrm/vol/#/volunteer/opportunities

# Answer
> 0 votes
It has comes to my attention that the http://address-to-your-site/civicrm/vol/#/volunteer/opportunities URL is for CiviVolunteer setup on Drupal, which is the developer's preferred platform. The URL Christophe gave you is the correct URL for Wordpress.

---
Tags: wordpress, civivolunteer
---


title: Limit file size for "image url" field

text:
# Question
Title: Limit file size for "image url" field
We use the "image URL" field via profile to allow members to upload their organization logo. We would like to limit the file size a user can upload. Are there any options for us? Thank you!

# Answer
> 1 votes
You should be able to implement a hook via PHP to validate the profile when it is submitted: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_processProfile/.

Someone else may want to chime in. I'm not sure if you can use form hooks with profiles. Otherwise you may check this: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_validateForm/

You can then use PHP to validate the file size: Check this thread (https://stackoverflow.com/questions/9153224/how-to-limit-file-upload-type-file-size-in-php).

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


# Question
Title: Using Export Contacts from Search Builder w/ Field Mapping, mapped field's columns not exported
Website is running 4.7.25 over Drupal. I was able to replicate this on this demo site, which is running at version 4.7.28, as well: http://dmaster.demo.civicrm.org/civicrm

Here are the steps to take to replicate the issue:

1. Selected Search Builder
2. Set extensive search criteria (like 12 of them)
3. Set Select Records: to 'all'
4. Select Export Contacts Action
5. Search Builder Export Options (Step 2 of 3):
6. Select Fields to Export checked
7. Used Saved Field Mapping (note that I get the same problem regardless of my choice here)-- there were 17 fields in my map
8. All other left at their default
9. Clicked Continue
10. Select Fields to Export (Step 3 of 3)
11. Left at defaults
12. Clicked Export
13. Opened resulting downloaded csv.
14. Columns were NOT as mapped; they seemed to be the fields shown on the search results, rather than what I had in field map.

I have several screen shots, but (sorry) cannot see how to post them here.

My workaround will be to select Primary Fields (80 fields) in the Export dialog, and just use the 17 columns I want in the resulting .csv. But, it would be cleaner/simpler for using in any automated processes if this worked correctly, so I thought I'd submit it if it's truly a bug. Unless someone here can point me to what I'm doing wrong?

Thanks!

# Answer
> 1 votes
There is a JIRA issue for this 'oversight' and has been assigned to one of the Fuzion team to work on as part of a community 'pay-back/investment/pay-forward'.

---
Tags: export, search-builder, field-mapping
---


# Question
Title: Contact created from relationship tab is automatically tagged
When I create a new user from another contact's profile, in the relationship tab, the new contact automatically gets one of my tags... I have no idea where to look to solve this one. Any clues?

Using civicrm 4.6.25

# Answer
> 1 votes
If you haven't found the cause by looking around, you can write an extension that uses `hook_civicrm_pre` on the Tag entity to call `CRM_Core_Error::backtrace()`. That should show you what's calling the tag creation code.

# Answer
> -1 votes
Go the Contact (the one you want to edit) \> Tags. The Tag tab is toward the right side of the Contact categories.

---
Tags: relationships
---


# Question
Title: MembershipEndDate not exposed in Search Builder
I had hoped to use Search Builder to find memberships where Membership End Date was between certain ranges, but in 4.7.25, this field isn't available, although Membership Start Date is.

Am I missing something? Is there a reason that Membership End Date isn't available?

# Answer
It's present, but for who-knows-what-reason, it's labeled "Membership Expiration Date" in Search Builder.

However, before you go celebrating, in 4.7.25 there's a bug CRM-19998, which says, "Membership start / end date have no effect in Search Builder".

The GOOD news is that a fix was written for this. It was merged yesterday. The bug tracker says it's in Civi 4.7.27 - but next month is going to have a slightly unusual version release, so I suspect this is actually coming in 4.7.28, on December 6, 2017. If you need it today you can manually apply the fix.
> 1 votes

---
Tags: search
---


title: How cleanup civicrm database

text:
# Question
Title: How cleanup civicrm database
I've got a civicrm database of 1.4 Go (information available in PhpMyAdmin) 1Go is used by civicrm\_activity table I would like to know if have to clean, purge the database to reduce its size, cache or others maintenance actions.

I find some actions on documentation for cache files but nothing about database

Thanks for advices

# Answer
`civicrm_activity` is a legitimate table with legitimate data. You can use the API to mass-delete activities - but only you (and/or your users) can determine what represents data that is reasonable to delete.

If it's that large, I suspect it's quite likely that you're sending frequent mailings to large groups of people - the mailing history might be reasonable thing to delete.
> 2 votes

---
Tags: activities, database, cache
---


title: Conditional relationships?

text:
# Question
Title: Conditional relationships?
Our food co-op site uses relationships, e.g. Household Member. We have a custom relationship type: **Proxy Shopper**. We're interested in making Proxy Shopper conditional so that no individual can get Proxy Shopper status **unless** both individuals are Members of the same Household.

> *Example:*
>
> Jerry and Willow are Members of the Ortega Household. Willow owns a co-op membership with which she can shop at our store, and Jerry does not own such a membership. However, Willow has designated Jerry as a Proxy Shopper so he'll be able to shop on her behalf.
>
> Willow's mother Sabrina, however, is a member of the Sturm household (not Ortega), so Sabrina should not be a proxy shopper for Willow, even though Willow wants to send her mother to the co-op.

In short, **we're looking for a way (possibly through an extension) to condition the Proxy Shopper relationship type upon membership in the same Household**.

Worth noting that while belonging to the same Household should be required for setting a Proxy Shopper relationship, Household membership should not predict a Proxy Shopper relationship. In other words, no Household Member should become a Proxy Shopper unless someone sets that relationship via the admin interface.

What's the best way to do this -- beyond just telling backend users that they shouldn't make anyone a Proxy Shopper unless that individual belongs to the same Household as the second individual?

# Answer
Another approach worth considering is the use of custom fields on the Relationship. You can add a Custom Field for Proxy Shopper, on to the Household Member relationship, and if Willow lets you know that Jerry is 'safe' to be a Proxy Shopper then you have that information without need for potential code and complexity
> 3 votes

# Answer
To handle this, you would have to write an extension. I would use `hook_civicrm_pre` on the Relationship entity (operation is "create", maybe "edit" too if households tend to shift?).

Do two API calls to the Relationship API to get the Household(s) of both contacts. Compare to make sure at least one value is identical in both; if not, cancel the save.

For a better UX, I'd call the same function from `hook_civicrm_validateForm`. The form validation can give a friendly message to the backend users - but the `pre` hook will ensure that you also can't create the relationship via the API or some other way.
> 3 votes

---
Tags: civimember, relationships, condition
---


title: How to reset the headless test db?

text:
# Question
Title: How to reset the headless test db?
I'm using headless phpunit tests. I noticed that the first time I do this it pauses and says about installing schema for xxxx - a test database.

If you break stuff enough, you can end up with a corrupted/no-good test CRM database. How do you get a fresh one back?

I tried dropping the test database, but that just caused errors.

Thanks.

# Answer
ah-ha!

In your test class edit the `setUpHeadless()` method which might look at first like this:

```
  public function setUpHeadless() {
    // Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile().
    // See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md
    return \Civi\Test::headless()
      ->installMe(__DIR__)
      ->apply();

```

But pass `TRUE` to `apply()`, ie

```
  public function setUpHeadless() {
    // Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile().
    // See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md
    return \Civi\Test::headless()
      ->installMe(__DIR__)
      ->apply(TRUE);

```

Ta-daa! And now your tests will run super slow as the schema will be reinstalled every time. But helps you out of a spot, and you can of course remove that param.
> 6 votes

# Answer
It's also worth noting that if you're using `civicrm-buildkit` to create your test sites (highly recommended) you can also rebuild a site with `civibuild reinstall`.
> 1 votes

---
Tags: developer, civix, testing, cv
---


title: Create programmatically a ACL logic

text:
# Question
Title: Create programmatically a ACL logic
I have a need to create programmatically (from a csv) a complete ACL structure. In detail for each csv line i need to create

1. the CMS user (Joomla) with a specific role
2. the connected contact
3. the connected group
4. all the 3 ACL record (ACL, Roles and User assignments)

I'm using CiviCRM 4.7.24 and Joomla, I'm thiking to utilize API.

Questions:

* is the API the right approach or it's better to write directtly into DB?
* which APIs to use for each of the archives above?

Thank's

# Answer
Yes, the API is definitely the correct approach. Writing via SQL may work for now, but isn't guaranteed to in the future.

For the first item (creating the Joomla) user, I can't offer help, since that's not CiviCRM. There are plenty of pages that indicate how to create a Joomla user programmatically.

Don't forget about the API Explorer (**Support menu » Developer » API Explorer**) to help with determining how to implement your solution.

Also consider the CSV API Import tool, which may provide a no-coding (or low-coding alternative.

Create the contact (step 2) with the "Contact" API. Connect it to the group (step 3) with the "GroupContact" API. Use the "Group" API if the groups don't currently exist.

Step 4 needs the `OptionValue` API to create the role (set "Option Group ID" to `acl_role`). Use the `Acl` and `AclRole` API to set the rest.
> 3 votes

---
Tags: api, acl
---


# Question
Title: Set value of one field based on another field
I've seen a couple of answers to similar questions (e.g. How do I set the value of external\_id to be the same as a custom field? and Membership fee based on custom field).

What I want to do is change the content of a field from www.fubar.com/id= to www.fubar.com/id=\[CONTENT OF FIELD\] I thought this was doable with CiviRules, but it appears there is no option to change the contents of a field based on the value of another field change (I can do other things based on a field value change).

Is this an area where I need to look into custom development? Or am I missing the bleeding obvious?

# Answer
> 1 votes
You could create your own action for CiviRules to update the field you want. You can find guidelines on creating CiviRules actions here

---
Tags: civirules, fields
---


# Question
Title: Create a Drupal View of current event participant numbers
We use CiviCRM to sell event tickets and I was wondering if it's possible to pull the list of current events and confirmed participant number in to a simple Drupal View restricted to logged in users so we can keep track of ticket sales more easily?

I've looked at the built in options for creating the views but can't see a way of pulling that data across.

If there's an easier way of doing this directly in Civi then all ears for that as well but we're finding it a bit clunky to have to find each individual event each time and check the registered participant number and just want an overview.

# Answer
Yes you can do this in a Drupal View but it will require some config (both to tell Drupal about your CiviCRM tables as well as the Views config itself);

The goto solution for this within CiviCRM itself is:

Install: Extended Report Extension: Got to your Adminster -\> System -\> Settings -\> Manage Extensions -\> Add New -\> ExtendedReport (nz.co.fuzion.extendedreport)

After you've installed it -\> go Administer -\> CiviReport -\> Create New Report from Template and select e.g. Extended Report - Contributions with Price Set data
> 1 votes

---
Tags: civievent, drupal, drupal-views
---


# Question
Title: How to store emergency contact phones related to a contact without creating new contacts?
We need to store contact phones for a contact, to have a list of people to phone in case of emergency. For example, we have children contacts and we want to store the phones of their parents and grandparents without having to create a CiviCRM contact for each of these phones.

We expect to do this on phone section but seems it's not possible to do so without pervert the expected functionality of these fields.

There is a way to do this? If not, what would be the best way to make it possible? Through an extension? Adding it to core? I imagine a "Note" field on a phone row next to "Phone, ext. Phone location, Phone type" to allow attaching a comment like "mother's phone".

# Answer
I can see a few options:

* create phone types (or perhaps even location types if it is more than a phone for an emergency) like 'parents phone'. This is what I have done myself for a youth choir
* create a custom data set 'emergency phones' for individuals. If you set it to allow multiple records you can have a group with a label field and a number field
* you could indeed use notes but I would not recommend that as it is unstructured data
* an extension seems like overkill to me in this case
> 2 votes

# Answer
Right now we are collecting this data using the same phone or extension fields. But we understand that it is not the best way and that it can give us problems for example if we want to use a validator of phone numbers.

See the following images as examples:
> 1 votes

---
Tags: contacts, phone
---


# Question
Title: Randomize display of results from a Proxmity Search
We are using civiCRM 4.7.25 with Joomla 3.8.1

We have a proximity search to allow people to find nearby members of an national association.

The proximity search returns matching members alphabetically....

But we want the members to have "equal" opportunity to appear towards the top of the results list -- so we'd like to have the results of the proximity search return results randomly, instead of alphabetically.

Is there a way to do this?

# Answer
Take a look at https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/Form/Search/Custom/RandomSegment.php

It's a little tricky because if there's multiple pages of results you don't want the second page to repeat anything on the first, so it creates the full random-ordered list first and draws from that.

If you don't really care, or know there's only one page, you could override addSortOffset() in CRM/Contact/Form/Search/Custom/Proximity.php to do something similar to what the Base does in CRM/Contact/Form/Search/Custom/Base.php, and instead of "ORDER BY $sort", make it say "ORDER BY RAND()", e.g.

```
public function addSortOffset(&$sql, $offset, $rowcount, $sort) {
    $sql .= " ORDER BY RAND() ";

    if ($rowcount > 0 && $offset >= 0) {
      $offset = CRM_Utils_Type::escape($offset, 'Int');
      $rowcount = CRM_Utils_Type::escape($rowcount, 'Int');

      $sql .= " LIMIT $offset, $rowcount ";
    }
  }

```
> 1 votes

---
Tags: profile, joomla, search
---


# Question
Title: How can I import Volunteer information from a spreadsheet
CiviCRM 4.7.24 Wordpress 4.8.x CiviVolunteer

I have installed CiviVolunteer. I have created a project which I need in order to import some basic volunteer data from a spreadsheet.

I have imported the contacts already, and have a unique ID to match them back with the rest of the data.

Now I need to import the volunteer data. There's not really too much.

From what I can glean from the pretty sparse documentation, you have to import the volunteer information as an activity. But there's no indication of what fields in the import list correspond to.

Do some of them correspond to the project I created above? Or are they their own thing?

I haven't seen any documentation about projects joining to activities and how they all link up.

Is this something i might be able to find in the CiviCRM API Explorer?

Thanks!

# Answer
> 1 votes
Take a look at Fuzion's API import extension if you need an import option that goes beyond the standard Import options. It may not help directly with the volunteer data that goes in the civicrm\_volunteer\_ tables, but could help with other stuff, like Activities and Relationships.

---
Tags: civivolunteer
---


# Question
Title: Does CiviVolunteer expose fields to webforms?
Currently working with CiviVolunteer, and some of the functionality is very useful for our project. We are going to sign volunteers in to our events using a webform. But no CiviVolunteer fields seem to be exposed to webforms - for example, volunteer role. I am beginning to realise this extension is rather 'stand alone' and not really integrated with Civi - or have I missed something? I know that I can add custom fields to the Volunteer contact type, but I want to access the basic volunteer fields (like role) in a webform. Can I do this?

# Answer
> 1 votes
Sorry - the answer is 'no' there is indeed no CiviVolunteer - Webform Civicrm integration yet and much of our current efforts on the Webform CiviCRM project are directed towards a prototype version for D8;

---
Tags: webform-civicrm, 4.7, civivolunteer
---


# Question
Title: How can I speed up a slow upgrade to 4.7?
Upgrades to 4.7 for big CiviCRM databases can take many many hours.

What is the best way to speed them up?

# Answer
The slowest part of upgrading on a large installation is usually the `civicrm_mailing_event_*` tables. That data is also often stale, so consider deleting it if you don't need to keep historical information about past civimailouts.
> 6 votes

# Answer
For the specific case of upgrading to 4.7, here's a useful tip from Dave Jenkins : https://issues.civicrm.org/jira/browse/CRM-18526#comment-106825

In short: upgrading to 4.7 involves multiple changes (4 or 5?) to foreign keys on two tables that are often very large. In order to do this, mysql makes copies of those tables for each change, which can take a very long time. The strategy below shortens that process by only making the copy one time.

And here's a translation into a step by step. Warning, this will still take a while, but should be about 4x faster than the default method if you have a lot of data in your mailing tables.

1. Take your site off-line and do a full database backup.
2. Dump the two tables: `civicrm_mailing_recipients civicrm_mailing_event_queue` data-only into a file. You can do that for example with drush, using a variant of this:

```
drush sql-dump --result-file=savebigtables.sql --data-only --tables-list=civicrm_mailing_recipients,civicrm_mailing_event_queue --database=civicrm
```

The last argument would only be necessary if you've got civi in a separate database. The key is to dump without the table create commands, you only want the data.

3. Truncate those two tables after setting foreign key checks to 0. From a mysql command line, you'd use

```
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE civicrm_mailing_recipients;
TRUNCATE civicrm_mailing_event_queue;
SET FOREIGN_KEY_CHECKS=1;
```
4. Now run the upgrade normally.
5. Optional: check the civicrm status page. If you're going to do any modifications to the indices or modify the datetime fields to timestamps, then it's a good idea to do that now.
6. Reload the data in those two tables, e.g. with drush via

```
drush sqlq --file=savebigtables.sql --database=civicrm
```

This last step will take the longest time, but probably shorter than the upgrade would have if you didn't do this.

Definitely try this on a test first, and make backups before you start.

FWIW, I have recently successfully used this method on a site with about 10,000,000 rows in each of those two tables.
> 4 votes

# Answer
Consider moving your MySQL folder to a RAM disk. This is NOT recommended for a production upgrade, but could speed a dev/test site upgrade! See here for a script. Folks often report a 50x speedup - but I suspect that's vs. a spinning disk. I get roughly 2.5x speedup compared to SSD.
> 3 votes

---
Tags: upgrade, 4.7, performance
---


# Question
Title: How do you add a static option to a webform?
I am trying to update our webform to add an upcoming event to our registration page (static options) I don't want to save over the past events because I believe that will override the existing data (and I can't seem to figure out how to save over it in any case)

For example, we've had a series of events every month this year and I am trying to add the event for next month without saving over the past several events.

Any help is much appreciated!

# Answer
> 1 votes
Welcome to SE!

The way to do this is to add an Event for each Event in your CiviCRM - and then to select the current one on your say October Event Webform;

You can use node clone module to clone the webform to say November Event Webform;

---
Tags: webform-civicrm
---


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

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

Any advice is appreciated!

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

---
Tags: activities, best-practice, multi-record, organization
---


# Question
Title: Use Case Difference between CiviCRM and Croudfunding Sites?
Several people (who know little about CiviCRM) when looking at CiviCRM claim that it's no different than a Crowdfunding site, but I look at it as you don't own a Crowdfunding site, and thus they can impose rules on you, while charging you, and non of that will apply if you own the platform you're running it on. Of course your host can do that as well, but not to the extent that a business that works to specifically do crowdfunding can.

I've never actually tried a crowdfunding site, and so I was wondering what the differences are...I would imagine that the data on the crowdfunding site is what they give you, and that there's no way to add additional information or query it in different ways. The project still exists, and is still active, so there must be some advantage to it over a crowdfunding site.

# Answer
> 2 votes
Hard to really know where to start with this. Generally a crowdfunding site does that and only that, people can donate to a specific project with various 'bonuses' on offer.

CiviCRM can also provide

* event registration
* membership systems
* case management systems
* volunteer management process for events

and a lot more, and I suggest you do some further background reading on what CiviCRM offers and then perhaps come back with more specific questions when you have them.

I realise I may be missing some nuance in what you have asked.

# Answer
> 3 votes
I totally agree with Pete. To put it more bluntly, to me it sounds as if you are saying that a pushbike is the same as a car as they can both be used for transport :-) Or that a calculator and a spreadsheet are the same type of software as you can do sums with them :-)

CiviCRM is a full blown CRM that offers functionality for fundraising, event management, membership management, relationship management, case management, some automated workflow. A crowdfunding site supports fundraising with crowdfunding, full stop.

---
Tags: evaluating-civicrm
---


# Question
Title: Making a simple contribution page template
I am using CiviCRM 4.7.24 on Drupal 7.56.

I want to embed in a different website an iframe that shows a simple contribution form of CiviContribute, and styles it according to the website.

I would like to create a simple, blank, template that only shows the donation amount and email address, and submit button. Without any Civi styles like the header, the navigation, etc. And I can't find which template is the right one to edit.

The page I would like to edit is: *domain*/en/civicrm/contribute/transact?reset=1&id=2

How can I locate the relevant template? Is there already a clean blank contribution template I could use?

# Answer
> 1 votes
The template would not have anything to do with the styling to make it look like the rest of your website. Styling is in the CSS files. If you do not want to see the header, etc. just use display:none in your CSS file.

But... Are you talking about not seeing the embedded website header, nav, etc? If so, that has nothing to do with Civi templates. If this is case, the simple fix is also CSS display:none

# Answer
> 1 votes
Got it. In the Contribution page \> Title tab -\> Introductory Message I added in the source view a 'link' tag to my custom css. This way it is only loaded from this specific contribution page.

---
Tags: civicontribute
---


title: Error message when merging contacts

text:
# Question
Title: Error message when merging contacts
Using Drupal 7.53 and civicrm 4.7.15.

Attempting to merge two contacts and get this message:

"Sorry but we are not able to provide this at the moment. Expected one RuleGroup but found 0" Return to home page.

Thanks.

# Answer
> 5 votes
This happened to us, and it turned out that we didn't have a "supervised" dedupe rule defined for individuals. You can have at most one "supervised" and one "unsupervised" dedupe rule. Our supervised rule had disappeared (though I haven't worked out how). I recreated it and the error disappeared. There's some relevant documentation here: https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/#dedupe-rules

---
Tags: duplicate-contacts
---


title: Directories mess

text:
# Question
Title: Directories mess
Should the content of the admin page Diretories be, litteraly:

```
    CiviCRM » Administer CiviCRM
Settings - Upload Directories

You may configure these upload directories using absolute paths or path variables. Path Variables
[cms.root]

```

On a otherwise white basic html-page, whith plain html navigation? If so, why? If not, how do I fix this eye sore?

# Answer
> 3 votes
If you don't know what a page should look like, you can compare against one of the demo sites - eg http://dmaster.demo.civicrm.org/civicrm/admin/setting/path?reset=1

It should look something like this:

Is that just that one page showing wrongly, or others too?

---
Tags: administer
---


# Question
Title: Custom membership status is not being updated
We always used a customized 'Membership Status', named 'geldig lid' (means: valid member). I don't know why this was done in the past, cause it actually corresponds to the built in status 'Current', but since we have quite some mailing lists connected to 'geldig lid', I'd like to continue using that one. Now, for some reason, the customized status 'geldig' lid, doesn't work as it should. And In order to investigate what goes wrong, I changed the order of the assigned statuses to 'Current' first and 'geldig lid' second. But the settings for both statuses are exactly the same. See attachment:

When I look for the members with status 'geldig lid', I find 19527 contacts, which is not correct cause in a lot of cases 'membership end date' is already in the past. Doing the same with 'current', I find 5824 contacts (which is correct). See attachment:

Can somebody explain what is happening here?

# Answer
A membership has a single status determined by the status rules. If the date rules mean that more than one status applies, the ordering of the rules determines the result.

From the user guide :

> To decide on which status should be applied, CiviCRM looks to see if the membership has a status override. If it does, it applies that status. If not, it looks at each status in turn starting at the top of the Status Rules page until it finds one that is valid. That is to say, it looks to see if today's date is between the start and end date for the membership status at the top of the list. If it is, it applies that status, if not it moves to the next status and repeats this process until it finds a status that matches.

Since you have changed the order, 'Current' will be used in preference to 'geldig lid' although the rules for both are the same.

When you say that the status "doesn't work as it should", I think you mean that memberships past their end date are still showing as 'geldig lid'. Membership statuses are updated either by saving a change to the membership or by the scheduled job "Update Membership Statuses". From your screenshots it seems the scheduled job is not running / not working.

You can have a Label for the Membership Status that is different to its Name, so you could use the standard Current but change the label to 'geldig lid'.

However, if you want to continue with the current setup, change the ordering back so that 'geldig lid' appears before 'Current'. Before running the scheduled job, you might want to see how many are past their end date and how far past they are as to whether you want to notify anyone or take action etc. Then enable/fix the scheduled job - that should change Current memberships to 'geldig lid' and change those past their end date to Grace or Expired.
> 2 votes

# Answer
@Aidan I'm writing an answer myself since I can't add atatchments to comments.

I found the scheduled jobs and I see this for Update Membership Status:

Are these settings correct?
> 0 votes

# Answer
@ErikH-CiviCooP I'm afraid I need some help here. So what I want to do is remove the special status and make sure that the normal 'Current' status is applied for all valid memberships, otherwise 'expired'. What I DID is: \- I've put 'Current' in the first place (with the exact same settins as the special one) --\> result: the special one was still applicable for some members \- I've disabled the special one --\> result: still the same \- Now I thought about deleting the special one completely. But I get the warning: WARNING: Deleting this option will result in the loss of all membership records of this status. This may mean the loss of a substantial amount of data, and the action cannot be undone. Do you want to continue? I don't wanna lose membership RECORDS, I just want to get rid of the status.

You mean that I have to manually change the membership status for the ones that are incorrect. The problem is that the special status 'geldig lid' both is applicable for VALID as for EXPIRED memberships. So that will be a complicated job. + I have no idea how I would have to do that :).

Do you think I can first try to delete the special status or will I lose important membership information then?

I might be asking silly things, sorry for that, I'm not so experienced with the technical part of CiviCRM.
> 0 votes

---
Tags: civimember
---


# Question
Title: How can we run a report that doesn't split records into multiple entries?
We want to run a report on the enquiries/feedback and the outcomes and signposting that result from each one. However, when we run a report it splits each record entered into individual records for 'Enquiries/Feedback', 'Outcome', 'Signposting' etc so they are not joined up and therefore we cannot see what the outcome was of an enquiry or where it was signposted to. How can we do this? Many thanks

# Answer
> 1 votes
I'm going to guess that these fields containing "enquiries/feedback and the outcomes and signposting" are either custom contact fields with multiple entries or activities. In either case, you probably want to use the report grouping feature to group by contact (e.g. by contact id), that would likely get you closer to what you want. If you sort by id or date of these other things, then you might get a nice chronological display per contact.

If you want a fancier display, you'll likely have to write a custom report.

---
Tags: civireport
---


# Question
Title: My ACL Role is now showing selected contact groups
I tried digging through other questions before I posed my own. So, I'm asking for a solution here.

**What I want to do:** I want to give a group of contacts ability to 1. Create and edit events based on templates 2. See Event participants 3. See a select group of contacts that have custom fields, custom profiles and some with custom activities.

**What I have done so far:** I have created a Role in Drupal and given a select number of Civi access including CiviEvents. I turned off *See All Civi* Contacts.

Then I created an ACL Role, Permission and ACL access The ACL access includes most view activities related to contacts in the select group I want them to see. I also want them to see custom profiles and custom fields.

**Problem** When I log into the website as an end user (member of the group) I can see the CiviCRM Menu, Add and Event, etc. But I am not able to see any contacts even though my ACL Role indicates I should be able to see this set of contacts and it is turned off in Drupal permission.

I also tried turning on the **See All Contacts** in Drupal and it showed me far more than I should be seeing with this user role.

I checked the ACL Roles against the Drupal ones and I am still running into problems. Any advice?

*I am using Drupal 7 and the Civi 4.7.24.*

# Answer
> 0 votes
Without jumping in and working through the whole scenario, have you considered adding all their Participants to a Smart Group and giving your users an ACL that accesses just that Group of contacts

---
Tags: drupal, permissions, acl
---


# Question
Title: Does CivicCRM let you manage members as companies rather than individuals?
I run a Brewers Guild and the companies are the members, not the employees. I need to have the Brewery as the member and then have different employees listed as different positions (marketing, primary, accounting, etc.) and associated with that brewery. So I can send an e-mail to everyone at a specific brewery or all "marketing" employees across all brewery members. Is this possible out of the box with CiviCRM?

# Answer
> 3 votes
Yes, this is very possible out of the box. Civi has 3 contact types, Individual, Household, and Organization. You can Use Organization Type for Breweries and Individual Type for Employees. Then with Contacts \> Relationships you can list the the Employee Contact as an employee of the Brewery Contact. You can use Contact \>Tags to give employees Job Titles such as "Marketing" so you can sort by all marketing employees for a Brewery or all Breweries.

# Answer
> 3 votes
Other options that can finesse the answer by Iowa Boy

* create custom Relationship Types
* add custom fields (eg for Department the employee works in) on to the Relatonship Type = Employee/Employer

You can also use Permissioned Relationships so eg a Primary Contact for Company A can used their Dashboard to see and edit Company details

If you use 'second degree relationships' you can then let the Primary Contact see details of other employees of the Company

If you are using Drupal then you can really knit a nice sweater and let the Primary Contact easily do all sorts of stuff (if you want them to) such as letting you know someone stopped working there (by ending the Relationship)

For some of the above the Permissioned Relationship extension by Fuzion is required so you can daisy chain permissions without having to battle with civicrm's own ACL approach.

But fundamentally, the answer to your question is "yes and lots more besides" ;-)

---
Tags: civimail, civimember, contacts
---


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

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

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

NOTE: recent blog about above extension here.

---
Tags: message-templates
---


title: Schedule Jobs Page on Multisite

text:
# Question
Title: Schedule Jobs Page on Multisite
I have a WordPress multisite with CiviCRM 4.7.24 also in multisite mode. The main site Scheduled Jobs page (civicrm/admin/job&reset=1) looks and works fine, but that page on other sites looks like this:

If I click "Add New Scheduled Job" I get this:

which is not what I want. :(

Can anyone clarify why the additional sites don't have the regular Scheduled Jobs interface?

# Answer
> 2 votes
This is actually the correct interface. I believe you're trying to compare the "List Scheduled Jobs" interface with the "Edit a single Scheduled Job" interface. If you press "Edit" next to any scheduled job on your "main" site, it should look more or less identical to what you've posted above.

Crucially - when configuring Scheduled Jobs for multi-site, most jobs do NOT need to be run twice. E.g. "Update Membership Status" works once across all contacts. You DO need to replicate the "Send Mailings" scheduled job on each multi-site instance; you can copy the settings from the main site's "Send Mailings" interface. I think you may need to change the name to something unique.

In my experience, the only site-specific scheduled jobs I create are "Send Mailings" and "Process Incoming Mail" - the latter because newly-created contacts won't be created as belonging to the correct "master group" for the domain otherwise. IIRC even bounce processing is just done once for everyone.

---
Tags: cron, scheduled-job
---


# Question
Title: CiviMail won't send mailings; start/completed date is "0th, 0 12:00 AM"
CiviMail is no longer sending out mailings after a recent upgrade. The start and completed dates, instead of being blank, are "0th, 0 12:00 AM". How do I fix this?

# Answer
> 1 votes
I'm not sure what causes this - but an upgrade on a site of mine (MySQL 5.5, Debian 8.9) caused my `civicrm_mailing_job` database table to not allow `NULL` values for `start_date` and `end_date`. Since a `NULL` start date is a condition for sending emails, this causes CiviMail to fail.

To fix this, you need to run the following SQL commands:

```
ALTER TABLE civicrm_mailing_job MODIFY start_date timestamp null;
ALTER TABLE civicrm_mailing_job MODIFY end_date timestamp null;

```

---
Tags: civimail
---


# Question
Title: How can we access only one of multiple financial types in a single contribution?
For some of our contributions, we have two different financial types, and that money needs to be treated differently. For instance, donors can make a donation and choose to add 3% to cover the processing fees. The donation is a "Donation" type, and the fee is a non-deductible "Processor Fees" type. The default Financial Type of the Contribution is "Donation". See image.

So, I can see the two different financial types within the Contribution, but when we are printing donor letters or running reports or searching for Contributions, we can only treat it as a "Donation" type (the default type of the Price Set).

We want to be able to print thank you letters with only the donation portion of the contribution ("Thank you for your $10 gift" in this case, not "$10.30"). And, we want to be able to run reports showing how much people have contributed through paying their own processing fees (or whatever the secondary type is).

* How is this information stored in the database?
* Is there (could there be) a token available to get only the "Donation" amount?
* Why doesn't the Processor Fee amount (which is configured as "Not Deductible") show up in the "non-deductible amount" field for the Contribution?
* Has anyone else come up with a solution or work-around for this issue?

# Answer
> 2 votes
Check out Extended Reports Extension https://civicrm.org/extensions/extended-reports/24

Here is a quick rundown of how Civi handles Financial Types. The Civi Core native reports will only pull reports for Financial Types connected with your Price Set Default Financial Type. Which is stored in table civicrm\_contribution.financial\_type\_id.
The Price Field Financial Type is actually called Line Items in the background. You have to use Extended Reports to be able to pull reports based on Line Item (civicrm\_line\_item.financial\_type\_id).

When creating a Message Template use tokens for the civicrm\_line\_item table Ie.{$lineitem.label} {$lineitem.financial\_type\_id}

You might have/want to create another Financial Type similar to Donation (maybe Contribution). Then use Donation for the Price Set Default Financial Type and Contribution for the Price Field Financial Type. The just helps you know which one you are seeing in reports and when Pulling Reports, you are sure not to get mixed data (Donations and Processing Fees) like you are seeing now.

---
Tags: civicontribute, price-sets, financial-types
---


# Question
Title: CKEditor - add left, right, centre, justify buttons
In 4.7 - in my 4.7.24 as well as the demo - these buttons are no longer present in the CKEditor wysiwyg button toolbar.

# Answer
It turns out this has a simple fix: add the 'Justify' plugin to Civicrm.

Go to the CKEditor config screen: Administer \> Customise data and screens \> Display preferences \> CKEditor config

Then add the Justify plugin.

A new toolbar group will appear in the 'paragraph' section, which you can then move around as you'd like.

Then save your settings...

In my installation, for some reason something is hampering the UI from working properly. If that's the case, you can still call the plugin by directly editing the config file: (in our drupal 7.56 installation) sites/default/files/civicrm/persist/crm-ckeditor-default.js

and ensure you add the justify plugin to lines like:

```
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph', 'justify' ] },

```

and

```
config.extraPlugins = "justify,showblocks";

```

If you're editing this file directly you have to be very aware that it will be over-written if anyone saves the CKEditor settings using the UI as above.

Hope this is helpful to others out there mystified by the lack of these buttons!
> 5 votes

---
Tags: ckeditor
---


# Question
Title: CKEditor with well-formatted html source code
In my 4.7.24 as well as the demo site, CKEditor doesn't attractively format the source code. No indents or spaces. It's very hard to read.

# Answer
However, I found a solution. Hopefully it's not too far from good practice - I'm not a real coder so I've just done the best I could!

Adding the following code to CKEditor's config file seems to do the trick. So, go to (on Drupal 7.56) sites/default/files/civicrm/persist/crm-ckeditor-default.js.

It's important to know that you probably have to clear your browser's cached files each time you make a change to this file.

This file is created by the CKEditor UI at civicrm/admin/ckeditor?reset=1, and will be overwritten if ever that page is saved. But if you can keep everyone away from it, you're safe to edit the file directly.

Place the following code somewhere well outside all of the CKEDITOR.editorConfig function:

```
CKEDITOR.on( 'instanceReady', function( ev ) {
    // Sets indentation of source code
    ev.editor.dataProcessor.writer.setRules( 'div', {
                indent: true,
                breakBeforeOpen: true,
                breakAfterOpen: false,
                breakBeforeClose: false,
                breakAfterClose: true
            });
});

```

This is from: https://docs.ckeditor.com/ckeditor4/docs/#!/guide/dev\_output\_format

I'm sure there's a better way, and probably better code than this, and if so I'd be glad to know what would be a 'best practice' solution.

Thanks!
> 1 votes

---
Tags: ckeditor
---


# Question
Title: How to disable possibility to enter past date in activities?
I have a custom field of type Date used for activities, even though i have set years prior to current date to 0, it still allows users to select past day and month of the current year.

Is there any quick fix for this, can anyone give me a hint?

CiviCRM 4.6.33

# Answer
> 2 votes
I think you'll need an extension for this. Use the `hook_civicrm_validateForm` if you just need to prevent prior dates from being entered on the back-end activity form. If you need to block ALL forms of adding a prior date, you may want to use the `hook_civicrm_pre` hook (this will block Webform-CiviCRM, API, etc.).

You may want to set exclusions for administrators if you do this!

---
Tags: custom-fields, activities, dates
---


# Question
Title: I have everything done and still this red no go
Language and Region Settings

CiviCRM has been translated to many languages, thanks to its community of translators. By selecting another language, the installer may be available in that language. The initial configuration of the basic data will also be set to that language (ex: individual prefixes, suffixes, activity types, etc.). Learn more about using CiviCRM in other languages.

I just don't get it. Im in FTP the files are all there. Is this saying to load them again??

# Answer
So I'm no tech, this is going to me layman's terms.

The issue fixed by going into FTP to the plugins file and adding a file named "files" and then dropping the civicrm folder into that file named files.
> 1 votes

---
Tags: wordpress, localisation
---


# Question
Title: Allowing multiple fianancial types for same price set single contribution page
Price sets and Contribution pages allow for donations to a "Financial Type" (and corresponding Financial Account) This is great for managing different types of donations.

It is possible to generate **contribution page** and profile for that **maps to a single financial type**. It is **also possible within a single price set** to specify an associate price set that **maps to a financial type** (I assume this will override the contribution page financial type. **But there is no way to dynamically select a price set.** (btw - this would be a great feature!)

**This means replicating the same values for multiple price sets and writing some code to show on a single page.** I'm looking at 10 different "Funds / Financial Types"

For example: Select from ($100, $500 and $1000 donation) to **either** the General fund **or** the Scholarship fund **on a single page**

I'm looking for something in wordpress, but webform-civicrm doesn't seem to allow this either.

Some approaches I've considered:

* Create a massive price set with all potential Financial Types and use some javascript to dynamically show/hide. This seems really ugly and hard to maintain.
* Create a parent page with some javascript to dynamically load and select from several contribution page URLS. A bit cleaner, but IMO hackish.
* Set to a dummy financial type and then write a script to re-assign to the correct one based on a value in a profile. I have not looked at the API to do this yet, but assume it would make fewer assumptions than javascript ....

BTW - I'm posting here as **I think a common use case is a single page that dynamically sets the financial type based on a donor selection.** Please comment if I'm right/wrong.

# Answer
You can have multiple Financial Types in one Price Set and all on the same contribution page. The simple way to do it is to set the Price of the Price Field at $1.00 and just have one Price Field for each Fund. You can give each Price Field in a Price Set different Financial Types. Then donors would enter the amount they want to give. But, you could set it up as you describe above. The first Price Field for General Fund, you would use Pre-Field Help to Display your Section Title "General Fund". Then you would set this one up as General Fund $100 with the Price at $100, Financial Type "General Fund". Create another General Fund $500 with a Price of $500, Financial Type "General Fund". Etc. Repeat this pattern for "Scholarship" but give these a Financial Type "Scholarship". Then the donors would enter a 1 (or any number 2x$100) for the amount they want to give. *Just make sure that the Default Financial Type for the Price Set is **NOT** any you are using in the Price Fields within it. Otherwise it will get confusing when you are pulling reports and you likely will get mixed data. Use Contribution or something for the Price Set Default Financial Type*

Here is a quick rundown of how Civi handles Financial Types. When you create a Price Set and enter a value in the Default Financial Type. It is stored in table civicrm\_contribution.financial\_type\_id. This is the Financial Type that is used in CiviReports.

The Price Field Financial Type is actually called Line Items in the background. You can have each Price Field have a different Financial Type. You have to use Extended Reports Extension to be able to pull reports based on Line Item. These Financial Types are stored in table civicrm\_line\_item.financial\_type\_id.

When creating a Message Template use tokens for the civicrm\_line\_item table Ie.{$lineitem.label} {$lineitem.financial\_type\_id}

Below is a screenshot of our contribution page. Donors have the option to give to the Fund(s) of their choice and each one is a different Financial Type (Line Item) in the backend.
> 1 votes

---
Tags: contributions, contribution-page, financial-types
---


title: Blank page in mailings with notice

text:
# Question
Title: Blank page in mailings with notice
I'm using locally Civicrm 4.7.25 on Joomla 3.8.1 and starting from 4.7.22 (although I am not sure it's a consequence of an update) whenever I try to access a "New mailing" menu I get a blank page: http://awesomescreenshot.com/0706dy7a64 and this notice: Notice: Undefined offset: 0 in /share/CACHEDEV1\_DATA/Web/civi917/administrator/components/com\_civicrm/civicrm/CRM/Mailing/Info.php on line 82 Now I don't know how to solve this issue, anyone can help me please?

Other useful info: phpversion: 5.6.31 dbversion: 5.5.57-MariaDB server: Apache on linux

# Answer
> 0 votes
While I'm not sure what exactly cause an "Undefined offset" PHP notice (need to go deeper), yet temporary fast emergency fix for "New Mailing" screen to appear would be PHP Notices disable via Joomla configuration

```
 /administrator/index.php?option=com_config
 Server > Error Reporting > put it None (or Simple)

```

It seems printed notices interfere to Angular2 which tries to read page content but fails at first
tag of the Notice text.

Would be nice to tell Angular to pass PHP Notices texts somehow and try to figure out what happens at **Mailing/Info.php on line 82** though.

# Answer
> 0 votes
This 'sounds' like the angular issue hitting your site and you are likely to find similar tickets if you search Tags = Angular

---
Tags: joomla, mailing
---


# Question
Title: Why do I get security warning & how to remove?
User just got 3 security warnings about access to sites/default/files/civicrm/custom & sites/default/files/civicrm/upload & sites/default/files/civicrm/ConfigAndLog.

I changed the access of all to 555 but still get the message for the last one (ConfigAndLog). In this folder there is an .htaccess file - below. Release is 4.6.29, Drupal 7. I'm puzzled why this has happened today - 4.6.29 has been there for months. So-

1. Why have these messages popped up now? I guess this is something timed to appear today as I also get it on a 4.7 system
2. How do I fix the ConfigAndLog message which is still appearing?

# Answer
> 1 votes
So as he why you get security warnings: because civi has found your configuration insecure, ie. you have files that shouldn't be accessible on the web but are.

As how you fix it (and get rid of the warnings), it depends on the web server you use and how it's configured.

The .htaccess rules only work for apache, and only if it's configured to read them. If you use nginx or another webserver, you will need to implement the rules denying access to these forbidden folders differently.

---
Tags: error, 4.6, security
---


title: Switching from same-db to separate-db?

text:
# Question
Title: Switching from same-db to separate-db?
I'm using latest drupal 7 and civicrm.

I have an existing drupal/civi install which uses the same database, and i'd like to switch to having separate databases - is that possible?

The civi side is the important part fwiw.

Thanks!

# Answer
> 1 votes
Do you mean separating the Drupal and CiviCRM database on an active installation? If possible the easiest would be to re-install with separate databases.

---
Tags: database
---


# Question
Title: Why is my membership contribution page not generating a contribution or transaction?
Using CiviCRM 4.6.31 with Drupal 7, I have a contribution page that uses membership price sets, and for one of the options, no contribution or membership is created, no credit card transaction occurs, and yet a receipt is generated and no error appears for the visitor who fills out the form with their credit card.

# Answer
> 1 votes
The symptom was caused by a misconfigured membership priceset. Specifically, it had a price field with an assigned membership type that had been disabled.

If you want to check your database for a similar issue, you can use this sql:

```
select pf.label,fv.id,fv.price_field_id,fv.is_active,fv.label,mtype.name,mtype.is_active from civicrm_price_field_value fv left join civicrm_membership_type mtype on fv.membership_type_id = mtype.id left join civicrm_price_field pf on pf.id = fv.price_field_id where fv.membership_type_id > 0 and fv.is_active = 1 and mtype.is_active != 1;
```

If that sql returns any rows, you probably want to disable the corresponding price field values in the price field labelled by the first column of the results.

---
Tags: civicontribute, civimember
---


title: Multiple Status on a Membership?

text:
# Question
Title: Multiple Status on a Membership?
I know that there can be overlapping status' for a membership, and that the order can be set to determine which status takes precedence.

I'm curious if it's possible to have both status' display. For example our non-profit categorizes members who are paid up on dues as in 'good standing' but we have a period of 2 months they could miss dues and still be in good standing before falling into 'bad standing.' We would like to have a status for 'good standing', 'good standing 1 month behind on dues', and 'good standing 2 months behind on dues' so that we could better follow up with members who are behind on dues.

I know we could probably just do a status for each month behind, but we had previously set up 'good', 'bad', and 'inactive' standings, and have various smart-groups and permissions set up around that. So it would be easier if we could add other status' on top of the memberships' main status.

Any ideas?

# Answer
> 1 votes
The membership status ID field on a membership record is a single-value field - so this isn't doable without adding the new membership statuses. I'd recommend either a) adding the new statuses and updating your smart groups, or b) creating reports based on membership end dates to use those to follow up with members.

---
Tags: civimember, status
---


# Question
Title: child groups do not display in manage groups list
I just installed 4.7.6 and have imported contacts into groups. When I go to manage groups, child groups do not display. When I go to send a new mailing, child groups are listed but don't seem to be connected to parent groups.

# Answer
> 1 votes
My experience on 4.4 and 4.6 is that when I first go to Manage Groups the child groups are hidden under the parent group. I need to click on the arrow to the left of the parent group name to see the child groups.

Is it different on 4.7.6?

# Answer
> 1 votes
This is a known issue which had not been resolved as of October 24, 2017.

---
Tags: contacts, groups
---


# Question
Title: What settings are required to display detailed change logging?
I've got a site using CiviCRM 4.5.8

I've tried to enable detailed change logging in Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)

But the change log tab still shows the basic changed by person x on date y details.

On other sites I've worked with (4.5 and 4.6) enabling detailed logging changes the log view automatically.

Is there a related setting I've overlooked?

Should I just bite the bullet and upgrade the site?

Cheers

Craig

# Answer
> 4 votes
I had the same problem - we run four different civi instances. Two had detailed change logs, two did not.

Across all instances users had same privileges and all four instances had logging enabled. The difference other than civi versions was that two had change log report. So the change log tab runs off reports. Steps to fix:

1) check logging enabled in Misc (Undelete, PDFs, Limits, Logging, Captcha, etc)

2) in Admin \> CiviReport \> Manage Templates.. check the summary and detailed contact logging templates are enabled (as default they were disabled on ours)

3) The MISSING bit... create an actual Contact Logging Report (Summary) from the template.

and that did the trick.

Note: when creating the report clicking 'refresh results' the report failed to load the results - i guess its too large. But save the report anyway and the detailed changes are displayed on the contact record.

Also it does not seem to need the detailed contact change report created only the summary.

Here the documentation that pointed us in the direction of reports to fix the problem https://docs.civicrm.org/sysadmin/en/latest/setup/logging/

The above worked against: v4.6.22 v4.6.4 v4.6.8 v4.7.20

# Answer
> 1 votes
It sounds like you may not have the proper MySQL privileges. I'll admit I'm a little hazy on exactly what privileges are necessary with which SQL version - but having the SUPER and CREATE TRIGGER permissions together works on any Civi-supported version of MySQL. You may be able to skip SUPER in later versions (MySQL 5.5+?).

If you're not sure, log into MySQL as the Civi user and run `SHOW GRANTS` and report back with that, plus the version of MySQL.

---
Tags: logs, logging
---


# Question
Title: How can I get $params into my own scheduled job?
Looking for some help on getting $params to be passed on from the scheduled job -\> GUI page -\> into my scheduled job; so:

```
function civicrm_api3_job_ecocalculate($params) {

```

I'd like to be able to pass in e.g.

But when I try this I just get `$params = null` in my function;

What am I missing?

# Answer
> 2 votes
This is what I have:

(I know you can read it :-)

And in my code:

```
function civicrm_api3_note_Migrate($params) {
  // param migrate_type determines what will be selected, defaulted to contact
  $validTypes = array('contact', 'contribution', 'participant', 'relationship');
  if (!isset($params['migrate_type'])) {
    $entityTable = 'civicrm_contact';
  } else {
    if (in_array($params['migrate_type'], $validTypes)) {
      $entityTable = 'civicrm_'.$params['migrate_type'];
    } else {
      $entityTable = 'civicrm_contact';
    }
  }
}

```

But I am not sure if that is what you mean?

---
Tags: extension, developer, scheduled-job
---


# Question
Title: Why can't I record backend contributions without using a priceset?
Using Drupal 7 and CiviCRM 4.7.22, I am unable to record any contributions unless I use a priceset, i.e. if I use this form: /civicrm/contact/view/contribution?reset=1&action=add&cid=mycid&context=contribution and put in any amount without using a priceset, then the contribution is stored as $0 without showing any errors.

# Answer
> 1 votes
The cause of this symptom was a mis-configured, hidden price set. There is a hidden price set and field (both of id = 1, at least on this site) that are used for non-price-set contributions. On this site, the price set had no financial type configured and the price field was disabled, a fact that was alerted on the System Status page. Setting a valid financial type and enabling the price field was actually kind of tricky (a combination of hacking urls and sql), but it fixed the problem.

I don't know how we ended up with that mis-configuration, an error in the executing code would have been nice.

---
Tags: civicontribute
---


# Question
Title: How to remove 'Volunteers' menu option where it's not appropriate?
I want users who have no access to CiviVolunteer functions to **not** have this menu option available to them. However the 'Volunteers' menu doesn't appear in the 'Navigation Menu' in the 'Administer' option, so can't be modified. Is there some other way of achieving this? Civi 4.7.24 and CiviVolunteer 2.2.2

# Answer
> 1 votes
Not entirely sure, yet if menu comes from CiviVolunteer 2.2.2 extension, perhaps an extra permission check should be added here: https://github.com/civicrm/org.civicrm.volunteer/blob/59534288f37c96202434c57adc73d2fa5dc7ba55/volunteer.php#L46

---
Tags: 4.7, civivolunteer
---


# Question
Title: The iATS payments "modify your payments" links fail in receipts to donors. Is there a workaround?
Using CiviCRM 4.7.22 and iATS Payments 1.6.1. Auto receipts from Civi advise recurring donors that "You can cancel future contributions by visiting this web page" and "You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page" with links. The links fail to display in any browser we've tried. We get only code.

Help! Should we modify the default receipt to eliminate reference to the links or is something misconfigured somewhere?

# Answer
I am on Civi 4.7.25 and iATS Payments 1.6.1 I just tested our receipt links and they work so it must be a settings issue.

I am just taking some guesses here at some possible settings

1. Administer \> CiviContribute \> iATS Payments Look for Enable self updates to recurring ... Is this checked? If not check it and test.
2. **I would check with iATS, Allen or Karin before changing this** Administer \> CiviContribute \> Payment Processors Click edit to the left of your ACH or CC processor. Find the Site Url and Recurring Payments URL. What do you have there? I have https://www.iatspayments.com/NetGate/ProcessLink.asmx?WSDL There is another url https://www.iatspayments.com/NetGate/ProcessLinkv2.asmx?WSDL but again, I would check with iATS, Allen or Karin before changing this. You can change it and test it. If it works great, if not, just change it back.

But if both 1 & 2 match my settings, then we need to look for something else.
> 2 votes

# Answer
The links have been fixed in CiviCRM Core - they work fine w/ 4.7.25 - I've verified that they work in our recent test matrix (ahead of the 1.6.1 release);

If you decide you'd rather not give your donors the ability to make edits / cancel -\> then you can go into the message template \[find the right one\] -\> and then strip out the relevant lines related to these URLs.
> 2 votes

---
Tags: civicontribute, receipts, iats
---


title: Staging and Production with WordPress

text:
# Question
Title: Staging and Production with WordPress
I'm setting up a new CiviCRM and web site on WordPress. I'm used to working on dev/staging sites and pushing changes to production after they are tested and approved. What's the best way to do this with CiviCRM on WordPress? Here's what I would do without any advice:

## Setup

1. Install WordPress and CiviCRM fresh on the production site.
2. Make a complete copy of the filesystem and database to create a staging site
3. Globally replace domain names in WP and CiviCRM files and DB tables, using guidance from the docs and this answer.

## Deployment

At this point, should staff use CiviCRM in production, or on staging? I think WordPress changes should be made on staging, and pushed to production. Maybe CiviCRM changes should be made in production and synced to staging? Should everything be done on staging, and then deployed by reversing the Setup steps?

# Answer
Staff changes should happen on the live server. This is doubly true if you have any public-facing pages, which will mean the database on the live server is updated by members of the public.

Traditionally, *code* travels from dev to staging to prod. *Data* travels from live to dev/staging.

I prefer referring to "dev/test/live" server, since this better illustrates the flow, and is less jargon-y to non-tech staff.

Some changes don't flow well this way - for instance, you may want to create a contribution page on your test server, then transfer it to live. In practice, this should be relatively infrequent, and you can redo your work on the live server.
> 0 votes

# Answer
Key is configuration...

I do a straight file copy (can use git as well to deploy with a CI if you want...).

Important files are configuration... you can set your location dependent settings in

```
/Library/WebServer/Documents/ccfrdev2/wp-content/plugins/civicrm/civicrm.settings.php

```

Wordpress is wordpress... so moving the wordpress part is pretty well documented. The database side is straight forward with Civi... just copy the database (re-import) ... the settings are in the settings file.

I save the settings file, copy the entire site, replace the settings file... then manage the URLs ... then bob's your uncle... You could automate it somewhat with git and a CI if you prefer, but it is so simple I just hack at it at the command line...

Hope this helps.
> 0 votes

---
Tags: wordpress, deployment
---


title: Why can't I edit iATS Settings?

text:
# Question
Title: Why can't I edit iATS Settings?
I am running Civi 4.7.22 and iatspayments ext 1.6.1. When I try to edit the settings (Admin\>Civicontribute\>iATS Payment Settings) my edits won't stick. For instance, I try to edit the email address for notification on failed recurring transactions and submit, but when refreshed the page reverts to previous email settings. Same thing with editing the "Never" to "Always" for receipts.

Anyone with same problem, suggested solutions or troubleshooting thoughts?

# Answer
> 1 votes
Look at your User Role and Access Permissions. Do you have access to CiviCRM: administer payment processors Add, Update, or Disable Payment Processors ???

# Answer
> 1 votes
I just confirmed all is well in 4.7.25 -\> I can edit/save the civicrm/admin/contribute/iatssettings form and all is there on refresh.

I generally recommend updating to 4.7.25 - from a payment processing point of view our test-matrix transactions grid has never been that green;

---
Tags: civicontribute, iats
---


title: Scheduled FTP data import

text:
# Question
Title: Scheduled FTP data import
In my extension, I can now import some data (contact and membership) from a csv file through a specific download form.

I need now to create a scheduled import, that search, once a day, a folder for the csv presence. The php with the internal routed URL is now ready but I don't know how to periodically call it:

* calling the routed page URL, ask me for credentials before executing
* create a scheduled job, needs, from what I understand, a specific API

How can I do?

Thanks

# Answer
> 1 votes
You can create an API with `civix generate:api`. More information can be found under *Add an API function* in the Civix page of the Developer Guide.

---
Tags: cron-job, scheduling
---