# Question
Title: civiCase emails don't use case tokens?? Print/merge does? What am I doing wrong?
I have templates that use a range of tokens from the contact and the case, including standard case tokens and custom fields. i.e.

{contact.display\_name} {case.id} {case.subject} {case.custom\_154}

The case tokens are not processed when sending an email (via email activity)

They are processed on print/merge document. (via print/merge document activity)

Is this by design?

# Answer
> 2 votes
When sending email via email activity only contact tokens are supported. If you have Civicase token extension installed and enabled than you can pass `caseid=34` (where 34 is case id) in activity email url

```
eg http://example.org/civicrm/activity/email/add?atype=3&action=add&reset=1&context=standalone&caseid=34

```

# Answer
> 1 votes
They work if you use the email icon in the roles section on manage case to initiate the email. They don't work if you use Contacts -\> New Email from the general menu since it won't know what case it is.

# Answer
> 0 votes
OK, I'm really not sure why this has not been done. It was a handful of lines changed in 2 files to make this work.

It was so easy I'm concerned I'm missing something about why it was not setup in the first place.

the main change is in CRM/activity/BAO/activity.php which needs an extra argument to pass the case ID and then a few extra lines to for replaceCaseTokens(). Case\_ID needs passing from messagetemplate.

If anyone needs this they can DM me for the details, its in test now.

---
Tags: email, civicase
---


# Question
Title: How do I create a new Webform in Drupal 8?
I have enabled webform and webform civicrm, but I don't see an option to add a webform under content (like in Drupal 7).

# Answer
Right! In D8 -\> look under Structure -\> Webforms

```
/admin/structure/webform

```
> 3 votes

---
Tags: webform-civicrm
---


# Question
Title: What is the difference between Tag or Group
Liebes Civi-Team,

was ist der Unterschied zwischen den Tags und den Gruppen? Wie wäre es ratsam, diese einzusetzen?

Viele Grüße

Kerstin Krupp

Dear Civi-Team,

what is the differencer between tags and groups?

Best, Kerstin Krupp

# Answer
> 6 votes
both tags and groups are ways to segment contacts. There are a few differences:

**Tags** \- can be used for contacts, activities, cases and attachments \- quick to add, easy to use and find \- you can not extends tags with custom fields AFAIK \- easy to spot on the contact summary (if you do not use too many) \- can not be used to create a segment of contacts for a bulk mailing

**Groups**

You can read a little more on https://docs.civicrm.org/user/en/latest/organising-your-data/groups-and-tags/ and I would recommend you play a little with both to discover what would be the best alternative for your specific need.

And a little remark at the end: although there is a CiviCRM Core Team most of the posts on this forum are answered by community members :-) I get the impression from the "Civi-Team" you are expecting a big team of people employed by CiviCRM answering these questions :-)

# Answer
> 2 votes
TAGS:

* You can not create Tags for use with specific types of contacts (i.e. you can't create tags that are ONLY for use with Individual contacts)
* When you export Tags, all Tags assigned to a record are exported in a single "cell" as a list (e.g. "Teacher, Volunteer")
* Tags allow multiple selections - so they may not be appropriate for mutually exclusive characteristics (e.g. "Democrat", "Republican", "Green Party")
* You cannot selectively hide or permission Tags on built-in or Profile create and edit forms (you get ALL Tags ALL THE TIME on edit forms)

GROUPS:

* All existing Groups are listed under Manage Groups and in the search forms. - This may cause group "overload" if your organization winds up with "too many" Groups.
* Groups used for short-term projects should be "purged" when they're no longer needed
* When exporting contact records, all the Groups a contact belongs to are exported as a single comma-separate list (e.g. "Administrators,Newsletter Subscribers")

# Answer
> 0 votes
Groups are mini objects Tags are mini fields

Instead of creating an object called locals, or major donors, you can make a group or smartgroup with those people.

Instead of creating a "yes" or "no" custom field field to mark whether a person lives in a gated community, you could just create a tag called gated community, and then you don't need the custom field.

---
Tags: webform-civicrm
---


# Question
Title: email activity - any solution to being able to preview like print/merge document?
When using the single email activity (not civimail) is there a way of previewing the email - with the tokens replaced - like in print/merge document?

I had a quick fiddle with coding a button for it, but the handling of the email activity seems to be quite a bit different to the regular forms. Doesn't seem to use the post form hook for example.

I have the same issue on both contact and case email activities

# Answer
There isn't such a feature currently.

This is related, but not exactly the same as what you're asking, but if implemented might help facilitate a preview: https://lab.civicrm.org/dev/core/-/issues/1750
> 0 votes

---
Tags: email, civicase, activity
---


title: Why does CiviCRM cause a cURL error 28?

text:
# Question
Title: Why does CiviCRM cause a cURL error 28?
Site Health in WordPress is showing a few cURL error 28 errors when we have CiviCRM installed and activated. Deactivate CiviCRM, the problem disappears. Activate it, the problem is back.

I've seen the WordPress Site Health contains critical errors unless CiviCRM is disabled question, but my research has found no justification for the top response that the health checks are inaccurate. So I need to dig deeper to try to solve this.

During a long chat session with tech support for the hosting company (SiteGround), they could find no reason for the error on their end. Server memory is maxed out, phpinfo shows everything is current and up to date (and shows server memory as 768M). So far, all of the diagnostic things I've found online have been dead ends.

With Query Monitor installed, I can see that the offending call is Health\_Check\_Site\_Status-\>get\_test\_rest\_availability(), which uses the URL

```
https://[URL]/wp-json/wp/v2/types/post?context=edit

```

That health check works fine with CiviCRM disabled, but chokes with it activated, giving the cURL error 28.

What is CiviCRM doing that causes that call to fail?

# Answer
> 5 votes
When I looked at this I found that SiteHealth does not account for sessions and CiviCRM depnds on them. See the discussion at https://lab.civicrm.org/dev/wordpress/-/issues/32

---
Tags: wordpress, error
---


# Question
Title: How to limit access to manage/create contacts by type via user roles?
Have a small franchise type non-profit organization in which multiple level users within the org need access to tools within civi, however, we do not want base level users that are managing their individual school sites to be able to add higher up organizational type contacts (like other school or club locations or regional type centers). We just want them to work on their individual members only, and to limit the availability of specific management/access of contact types based on their specific roles. We are using the Relationship extension to manage permissions on their own members down the chain of command, but we need to cutoff the chain of possible contact types they have access to and also hide those possibilities in the nav menu. Any help is much appreciated!!! \*using civi 5.2.2 and drupal 7

# Answer
> 1 votes
This may not be the answer you hope for, but the way we have approached this for other multi-level sites is to keep the 'lower level' users completely out of civicrm and give them everything they need via Views and Webforms.

# Answer
> 0 votes
We have done this by creating groups in OG, synching them and adding ACL's for each group. This way, they are able to view and edit their own contacts. Furthermore, we created some super-roles which are allowed to view and/or edit all. Doing so we are even able to have one contact which may be a member of two groups.

---
Tags: permissions, contact-types
---


# Question
Title: "Missing parameters" error in unsubscribe confirmation, and on some admin pages
Running CiviCRM 5.3.2 on the latest Wordpress. I recently migrated the site from an older version of Civi on another server.

Unsubscribe links from mailings load the confirmation page correctly, with the correct partially obscured test\****@domain.org. But when I fill in the email address and click Unsubscribe, it displays:

> Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. Missing Parameters
>
> Return to home page.

I turned debugging on, and it shows it failing on line 574 of CRM/Core/Form.php

That line is calling preProcess(), which is defined in Utils/Request.php. The "Missing Parameters" exception is thrown there when jid, qid, or h can't be found.

I wrote the $this object to a log file, and it does show the correct jid, qid, and h in \_submitValues -\> entryURL. But jid, qid, and h aren't extracted and stored one by one anywhere.

That's as far as I can think to go. I'm not sure how those are supposed to be extracted and made available for preProcess to retrieve(), so I'm not sure what to look at next. Thoughts?

Also, on some of the backend pages, I sometimes get a popup in the upper right with the same "Missing Parameters" error. The pages seem to work normally though, and it hasn't happened enough for me to intuit a pattern.

I did try disabling all Wordpress plugins except CiviCRM, but that didn't change the behavior.

Maybe relevant: when I migrated, and ran the database upgrade after unpacking the latest CiviCRM files, the upgrade timed out twice(?) in the middle of running. (I believe php-fpm timeout was set to the default 30 seconds.) I reloaded the upgrade page and it seemed to resume the upgrade just fine, with no errors. But maybe that caused a problem?

Thanks for any pointers!

# Answer
> 1 votes
I just updated CiviCRM to 5.26.1, and unsubscribe links seem to work now.

---
Tags: civimail, unsubscribe
---


# Question
Title: How to fix "Database In Unexpected Version"
I am starting to use CiviCRM under Drupal 7 and feel myself still as a newbie.

I made a backup with the Backup and Migrate module of Drupal (site + DB). As a good practice, I tried immediately after the backup to restore the backup, just to learn how to do in case of trouble.

I better did not because I got the error message:

```
Your database is marked with an unexpected version number: 5.22.0.
The v5.20.2 codebase may not be compatible with your database state.
You will need to determine the correct version corresponding to your current database state.
You may want to revert to the codebase you were using until you resolve this problem.

```

The menus of CiviCRM are now at the bottom of the screen with an ugly layout.

So backing up and restoring with the module Backup and Migrate seems to be a perfect instrument of (hopefully partial) self-destruction of Drupal or CiviCRM.

I have no idea on how to "revert to the codebase you were using until you resolve this problem". Any help will be appreciated.

# Answer
> 1 votes
Your database is running on CiviCRM 5.22.0. scheme Your plugin in /sites/all/modules/civicrm is CiviCRM v5.20.2 You need to download and follow upgrading docs from Civicrm to upgrade your plugin folder to CiviCRM 5.22.0 or above, then do the database upgrade to make Civicrm plugin and the running database scheme run on the same version.

# Answer
> 0 votes
It means the CiviCRM database and code are at different versions - but you say that you copied both site & DB, so unless the process failed somewhere you should have the same code and DB as your original site.

Was your backup site empty or did have a previous install of CiviCRM?

Your comment above "Is it possible that the error was already present before the backup/restore operation without showing up, due to a failed attempt to upgrade a week ago?". That doesn't fully explain it since you would upgrade the files first and then run the db updates, so when it fails the files version is *newer* than the db version and you are reporting the other way round. But if you upgraded then reverted the files, that would explain it.

Much depends on why the upgrade failed and what you did after that. If you missed schema updates despite it reporting 5.22.0 then you could hit problems later. For a test/dev box, upgrading to 5.26.0 should be ok. For a production box, I'd check further but that depends on the details of the failure and the subsequent actions.

---
Tags: drupal, backups
---


# Question
Title: CiviReport - Error when registering new Report
I've generated a new report in my extension, but when I try to register it with CiviReport, I'm getting the following DB error: Database Error Code: Field of view 'sporti62\_wp4.civicrm\_option\_value\_en\_CA' underlying table doesn't have a default value, 1423 Additional Details: Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => INSERT INTO civicrm_option_value_en_CA (option_group_id , label , value , name , filter , is_default , weight , description , is_optgroup , is_active , component_id ) VALUES ( 41 , 'Dog Registry with Contacts' , 'dogregistry/contacts' , 'CRM_Dogregistry_Form_Report_Dog_Contact_Summary' ,  0 ,  0 ,  90 , 'Dog Registry with Contacts' ,  0 ,  1 ,  NULL )  [nativecode=1423 ** Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_option_value_en_CA (option_group_id , label , value , name , filter , is_default , weight , description , is_optgroup , is_active , component_id ) VALUES ( 41 , 'Dog Registry with Contacts' , 'dogregistry/contacts' , 'CRM_Dogregistry_Form_Report_Dog_Contact_Summary' ,  0 ,  0 ,  90 , 'Dog Registry with Contacts' ,  0 ,  1 ,  NULL )  [nativecode=1423 ** Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_option_value_en_CA (option_group_id , label , value , name , filter , is_default , weight , description , is_optgroup , is_active , component_id ) VALUES ( 41 , 'Dog Registry with Contacts' , 'dogregistry/contacts' , 'CRM_Dogregistry_Form_Report_Dog_Contact_Summary' ,  0 ,  0 ,  90 , 'Dog Registry with Contacts' ,  0 ,  1 ,  NULL )  [nativecode=1423 ** Field of view 'sporti62_wp4.civicrm_option_value_en_CA' underlying table doesn't have a default value]"]

```

)

I know it is likely related wp\_globus plugin? I do have two languages on my site - english and french.

# Answer
Ok, again solved my own problem after doing more research. This apparently is a known issue with mySql and MariaDB where strict mode seems to be default. Adding sql\_mode="" to your /etc/my.cnf file will resolve the issue.
> 2 votes

# Answer
For anyone happening upon this - the proposed solution is not correct. CiviCRM should function with STRICT mode enabled, which is enabled to ensure data integrity - turning it off is just ignoring the unlaying problem. If you come across an error like this one it should be reported so it can be fixed.
> 1 votes

---
Tags: civireport, developer
---


title: Where to add tax credit values

text:
# Question
Title: Where to add tax credit values
I am first time user of CiviCRM and have a specific question.

Where I can add/edit values for Tax Credit? Previous Admin has left and I have to update the Tax Credit values for current year.

# Answer
> 2 votes
What jurisdiction are you in? Countries typically have their own requirements for issuing Tax Receipts for Eligible Donations.

In CiviCRM the Financial Type determines whether a Contribution of that Financial Type is deductible for income tax purposes or not. A contribution with multiple financial types can then become partially Tax Receiptable -\> e.g. Meal$ (not eligible) + Donation$ (eligible).

The non-deductible amount field (hit Edit Contribution to find it) -\> is handy if you need to make manual adjustments.

Of course it still depends on the Code you use to generate the Tax Receipts how exactly it processes the line-items and the non-deductible amount field. We do that in our Canadian CDN Tax Receipts Extension.

Hope that helps you along.

---
Tags: taxes
---


# Question
Title: CiviEvent URL Aliases being munged in Drupal 7
When I set up a url path alias in Drupal for a civievent (eg. pubquiz rather than civicrm/event/info&reset=1&id=33) and try to access the alias I get the message 'Access denied You are not authorized to access this page' when I try to access it. This only affects the alias, not the raw civevent path offered by Civi and used in the alias setup.

This approach has worked perfectly in the past, but hasn't been used for six months or so. Other aliases for native drupal paths work perfectly.

When I look at the list of url links in Drupal, I see that for Civievents the 'alias' link looks fine but the 'system' link is munged. It displays as 'civicrm/event/info&reset=1&id=33' but the actual link is https://XXXX.org/?q=civicrm/event/info%26reset%3D1%26id%3D33

A recent change in Drupal 7 ?

I can work a round this in Webforms, but this way was easier for simple events.

Drupal 7.7.1/Civi 5.24.3

# Answer
> 1 votes
This is still working for me using redirects

admin/config/search/redirect

sends

/join

to

/civicrm/contribute/transact?reset=1&id=3

---
Tags: civievent, drupal
---


# Question
Title: Menu Problem with CiviCRM 5.26.0 in Drupal
My CiviCRM menu bar doesn't appear at the right place on the page and its stylesheet is not loading.

I have the same symptoms as in question Menu Problem with CiviCRM 5.13.2 but the solutions they offer there do not solve my issue.

Since the picture of the heading at `http://***.be/sites/default/files/ocsr.png` doesn't show up, I discovered that the files under the directory `<drupal_root>/sites/default/files` are not served anymore by `apache` when requested by the browser.

There is a `.htaccess` file in that directory containing:

```
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>

# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
  Deny from all
</IfModule>

# Turn off all options we don't need.
Options None
Options +FollowSymLinks

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>
<IfModule mod_php7.c>
  php_flag engine off
</IfModule>

```

My knowledge of `apache` is too poor to understand if this file is the guilty, but in the logs of `apache`, I see entries as:

```
[Tue Jun 09 14:18:54.299253 2020] [authz_core:error] [pid 30658] [client 127.0.0.1:42982] AH01630: client denied by server configuration: /usr/share/drupal/sites/default/files/civicrm/persist/contribute/dyn/crm-menubar.4153687684a8323812edc1dc3cdbefbd.css
[Tue Jun 09 14:38:46.732818 2020] [authz_core:error] [pid 22455] [client 127.0.0.1:43090] AH01630: client denied by server configuration: /usr/share/drupal/sites/default/files/ocsr.png

```

that seem to be connected directly with my issue.

Since I am a newbie with CiviCRM, I don't have any clue about how to solve this.

Perhaps another useful information: I didn't have time to upgrade to the last version of Drupal 7 up to now. I don't know if the problem is coming from that delay and I don't know what is better: first solve the issue and then upgrade, or the contrary.

# Answer
> 1 votes
Your `.htaccess` file is incorrect.

It should contain the following content:

```

# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

```

The remaining lines are added ONLY for private file storage, namely these lines:

```
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>
# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
  Deny from all
</IfModule>

```

**You should check your Drupal configuration, to ensure that you have a separate folder configured for private file storage, this should be outside your web root.**

You should check your configuration against the Drupal documentation here: https://www.drupal.org/docs/7/install/setting-up-the-files-directory

---
Tags: drupal
---


# Question
Title: Error Upgrading DB to 5.15.alpha1 on Drupal 7: SQL error
When I am trying to Upgrade the DB to 5.15.alpha1, some SQL error is occurring. How can I fix the error as given below:

> $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> exceptionHandler ) \[code\] =\> -1 \[message\] =\> DB Error: unknown error \[mode\] =\> 16 \[debug\_info\] =\> INSERT INTO `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `weight`, `is_reserved`, `is_active`, `is_default`) SELECT @option\_group\_id\_ps as option\_group\_id, label, value, ov.name, weight, ov.is\_reserved, ov.is\_active, is\_default FROM civicrm\_option\_value ov INNER JOIN civicrm\_option\_group og ON og.id = ov.option\_group\_id AND og.name = 'contribution\_status' \[nativecode=1052 * Column 'label' in field list is ambiguous\] \[type\] =\> DB\_Error \[user\_info\] =\> INSERT INTO `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `weight`, `is_reserved`, `is_active`, `is_default`) SELECT @option\_group\_id\_ps as option\_group\_id, label, value, ov.name, weight, ov.is\_reserved, ov.is\_active, is\_default FROM civicrm\_option\_value ov INNER JOIN civicrm\_option\_group og ON og.id = ov.option\_group\_id AND og.name = 'contribution\_status' \[nativecode=1052 * Column 'label' in field list is ambiguous\] \[to\_string\] =\> \[db\_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM\_Core\_Error::exceptionHandler prefix="" info="INSERT INTO `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `weight`, `is_reserved`, `is_active`, `is_default`) SELECT @option\_group\_id\_ps as option\_group\_id, label, value, ov.name, weight, ov.is\_reserved, ov.is\_active, is\_default FROM civicrm\_option\_value ov INNER JOIN civicrm\_option\_group og ON og.id = ov.option\_group\_id AND og.name = 'contribution\_status' \[nativecode=1052 \** Column 'label' in field list is ambiguous\]"\] )

Please advice.

# Answer
What you can try is in line 8 in CRM/Upgrade/Incremental/sql/5.15.alpha1.mysql.tpl you can change it from

```
SELECT @option_group_id_ps as option_group_id, {localize field='label'}`label`{/localize}, value, ov.name, weight, ov.is_reserved, ov.is_active, is_default

```

to

```
SELECT @option_group_id_ps as option_group_id, ov.{localize field='label'}`label`{/localize}, ov.value, ov.name, ov.weight, ov.is_reserved, ov.is_active, ov.is_default

```
> 1 votes

---
Tags: drupal, upgrade, evaluating-civicrm
---


# Question
Title: Configure CiviMember / CiviContribute for livery company quarterage fees
Can anyone advise me on the best way to manage CiviCRM payments for a City of London livery company? I have tried various permutations using CiviMember and CiviContribute, but I haven't cracked it yet.

This is the basic scenario:

* Livery company members are effectively members for life.
* They don't renew their membership annually as such, but they pay annual 'quarterage' fees.
* There are other payments, such as one-off 'fines' when they become Freemen or Liverymen.
* Even if they are late to pay their quarterage, they remain fully functional members.
* There are 3 or 4 quarterage price points, including gratis. The actual rate varies from year to year.
* Invoices for the coming year (from July 1) need to be bulk emailed to all members in June, customised to show the correct amount owed.
* Payments may be full or partial and they are recorded manually by the administrator.
* There is also a rollover date in the middle of the year.
* The administrator needs to get quarterage reports showing individual records with amounts paid and amounts outstanding. Potentially a member could still owe one amount for the period just ended and another for the new period.

# Answer
> 1 votes
I'd suggest this setup:

1. Auto-renewed annual memberships (different membership types for each amount).
2. Fixed renewal dates (July 1).
3. Adjust the Membership Status rules to allow "Grace" status to extend several years (or whenever it is that you're ready to say good by to non-engaging members).

Memberships are often tricky because of language - if some of the default language needs to be altered, you can do that with the string replacement features.

1 + 3 will effectively mean your members don't really expire, since "Grace" status is considered 'current' (normally), but you'll have the renewal mechanisms for reporting and payments and notifications.

---
Tags: civicontribute, civimember, renewals
---


# Question
Title: CiviCase: How to handle confidential cases
I have the following use-case: employees usually have access to all cases in CiviCRM, but occasionally there can be a sensitive case that must only be visible to users with a higher permission level.

I looked at CiviCRM ACLs, but they do not seem to apply to Cases. I also found an old make-it-happen campaign but I don't think it happened.

I'm tempted to create an extension that adds a "confidentiality" custom field to cases, which would restrict access to the case itself, as well as to the case activities. I might not be able to alter the queries for listings (search cases, search activities), but if the subject itself is not confidential, it would be an acceptable compromise (and eventually we can introduce hooks in those listings, if necessary).

Has anyone ever done this? Any other solutions?

# Answer
> 1 votes
You can do it in reverse if regular users have only "access my cases" permission. If they need access to cases that aren't theirs they can be added as any role to that case which will let them see it. But it sounds like you want the default to be to allow at the start, so then at that point you're into some kind of coding anyway. But then rather than access hooks, your postprocess hook on a new case would add in all the other staff as a role unless the custom field says don't.

If you want to generalize it, the custom field could be a multiselect list of groups, with the default being an "all staff" group.

# Answer
> 1 votes
I have an extension called CiviCase ACL which works similar to Activity ACL, but need to rewrite to support it for latest version of Civi. It does what it needs that is CRUD for specific user role based on case type with combination of Activity ACL to restrict activities. It does need a few hours of rewrite.

I did ask for adding a hook to alter(selectwhereclause) query for filtering the case on case dashboard but was told either to replace the whole dashboard or rewrite the core code to use the API instead of query. Rewriting using the API is a huge work and I don't have much time since there is much going on in those queries and I doubt API3 or API4 will support such complex join queries and also don't want to integrate results by doing multiple API calls. So I may rewrite the dashboard or do some hack to filter the case.

# Answer
> 0 votes
I have used the related permissions module for that. you can use the relationship client - case manager to give access to the contact and with this also to the cases.

---
Tags: civicase
---


# Question
Title: CiviCase dashboard shows cases for invisible contacts
iam using CiviCRM 5.25 and Drupal 7.71. I have a bunch of acls running to limit the access to contacts, so with using CiviCase it controls the limited access for case managers to contacts, or more specific: to clients. therefore related permissions module is also running. Normally the limited access is working fine, even on the search pages (!).

But the CiviCase dashboard `civicrm/case?reset=1` is not working this way. The CiviCase dashboard show too much cases. As well the overview table as the activites results shows cases the case managers should not see, because the manager is not allowed to see many of this contacts (clients). If i hit a contact name, i get the permission issue and i can't access the contact, this is expected behaviour.

So, the permission on this page is set to "`access all cases and activites`", which should mean "**... for visible contacts**", but "**for visible contacts**" is not working. Is anyone who can confirm that?

# Answer
You're correct that the case dashboard permission is a bit hardcoded to just "all" or "my" cases, e.g. https://github.com/civicrm/civicrm-core/blob/8036d43973a5d42b0722cc45cba3a9f88e9ce182/CRM/Case/BAO/Case.php#L695
> 0 votes

---
Tags: civicase, permissions, dashboard
---


# Question
Title: Event Scheduled Reminders set for *Before* start dates won't send to participants registering *After* the start date
I'm hoping to confirm that I understand the following correctly, based on this description:

1. I have an event with a scheduled reminder set to go at a certain time *before* the event. A contact who registers after that time, and before the event starts, will get the scheduled reminder. A contact who registers at *any* time *after* the event will *not* get the scheduled reminder. Is this correct?
2. After that, if I set up a scheduled reminder to go at a certain time *after* the event, then *all* event participants will get that email once that time has passed. Is that also correct?
3. Further, point 2 is true even if I set up the scheduled reminder *after that time has passed*. Is this also correct?

Thanks for your help! (Civi 5.24.4, Drupal 7.70)

PS - apologies if I've missed something in the documentation that answers this level of detail. I looked here without success.

# Answer
> 1 votes
1) Yes. If you have a reminder 2 weeks before saying "Just 2 weeks before our fabulous event ..." then you don't want that being sent to your last-minute registrants.

2) Yes. Your before and after reminders are independent.

3) Not sure, but I doubt it. If you set it *before* the sending time then it would be sent. ie if it is now one week after the event and you configure something to go out 2 weeks after the event it should work.

Small updates to the docs are easy so if you can add useful information there, please do.

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


# Question
Title: How do i add a new checkbox in message template
I want to display a checkbox when the user clicks upload documents in message template. How should i do it?

# Answer
You'll need to create an extension - see https://docs.civicrm.org/dev/en/latest/extensions/ to get started, and then you'll want to look at https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_buildForm/ to add the checkbox and then https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_postProcess/ to actually do something with it when the form is saved.

But also because the upload documents section is in a hidden section until you click the radio, if you want to add the checkbox in the same section you'll also need to look at https://docs.civicrm.org/dev/en/latest/framework/region/#region-reference to put it in the right place, or maybe insert some javascript there that also hides/shows your checkbox when the radio is clicked.
> 0 votes

---
Tags: message-templates
---


title: 500 Error When Migrating To Drupal 8

text:
# Question
Title: 500 Error When Migrating To Drupal 8
I have followed the great instructions on the question *Can I upgrade a drupal 7 + civi site to drupal 8?* but I am running into a road block. The first time I loaded Civi it loaded without my database but I fixed the config file and now I can tell from cv that it is loading my database but in the browser I get a 500 error.

I am seeing these two errors in the logs and I have verified there is more than enough memory allocated.

```
[Tue Jun 09 22:58:19.026852 2020] [php7:error] [pid 20039:tid 140003429107456] [client 73.95.227.117:53058] PHP Fatal error:  Allowed memory size of 1317011456 bytes exhausted (tried to allocate 803225600 bytes) in /var/www/vendor/civicrm/civicrm-core/CRM/Core/Error.php on line 520

[Tue Jun 09 22:58:19.027004 2020] [php7:error] [pid 20039:tid 140003429107456] [client 73.95.227.117:53058] PHP Fatal error:  Allowed memory size of 1317011456 bytes exhausted (tried to allocate 803209216 bytes) in Unknown on line 0

```

Any help is greatly appreciated.

# Answer
For the out of memory problem see https://lab.civicrm.org/dev/drupal/-/issues/119 and the workarounds in there, which should then allow logging the actual problem.

Also that stackexchange article is old and a bit out of date, although the gist of it is right. But you might want to use this method instead of roundearth, and the civicrm.settings.php entries are a little different from the roundearth one. The other method should set the civicrm.settings.php settings for you.
> 0 votes

---
Tags: upgrade, drupal-8
---


title: Edit 'existing locations' for events

text:
# Question
Title: Edit 'existing locations' for events
I would like to edit my list of existing locations for events. We have several locations with the same name that we don't longer use so it gets confusing. Is there a way I can remove these from the list of existing locations?

Thanks.

# Answer
> 2 votes
I don't think there is way to do this through the UI, although it does seem like something admins might need to do occasionally.

However, as the dropdown list of event locations seems to contain all the address fields, I am surprised that it is confusing. Even if they have the same name I would have thought there were enough other details to make picking the correct one easy.

If you are wanting to do a one-off cleanup of obsolete addresses than as a UI work around you could edit the old events that contain those obsolete locations and set the first address line to DO NOT USE or NO LONGER IN USE or similar.

I don't really know about good and bad practices for using the API, so what I am about to suggest could be a really bad idea. If those old events no longer exist then a different approach might be to use the API to find the address ID, email ID and phone ID of the event location you want to delete, then use the API again to delete the location block associated with those values.

If that is a really bad idea, a more knowledgeable person should feel to edit my answer and remove that part.

# Answer
> 1 votes
This is from the CiviCRM forums from 2010, but it still works:

```
Currently you need to select the location that you want to delete,
then manually clear all fields on the form and hit Save.

```

Hat tip to Kurund!

---
Tags: civievent, location
---


title: CiviCRM, SMTP and Office 365?

text:
# Question
Title: CiviCRM, SMTP and Office 365?
We use Office 365 Exchange Online for our emails. Whilst you can configure CiviCRM outbound mail to use it, you can't actually send mail using it. I have done some investigation, and the reason is that packages/Mail/smtp.php replaces the From address with the Return-Path. CiviCRM adds a VERP component, so Exchange Online rejects the email because the From address is invalid. Exchange overwrites the Return-Path with the From address anyway, so VERP doesn't work.

Any comments or thoughts? I assume someone will say that we should use another Mail Transport Agent.

# Answer
See the 'Support for Plus Addressing in Office 365' roadmap item for Exchange Online... due July 2020

"Plus Addressing is a great way to quickly create custom (or disposable) email addresses based off your standard email address, by simply adding a "+" suffix string to an existing email address in Office 365. For example, a plus address for kimakers@contoso.com could be something like kimakers+northwind@contoso.com that she could use to sign up for the newsletter at the Northwind web site. Then when Northwind sends a newsletter to kimakers+northwind@contoso.com it will route directly to kimakers@contoso.com. Kim could create an Inbox rule that then moves messages sent to this + address into the "Northwind" folder. Plus addressing support in Office 365 is a great way to more easily manage your Inbox, and even track mail like marketing and sales campaigns.

Featured ID: 59441 Added to Roadmap: 12/6/2019 Last Modified: 6/2/2020

https://www.microsoft.com/en-US/microsoft-365/roadmap?featureid=59441
> 2 votes

# Answer
ah, yes, Exchange. That mail server that behaves almost like the others, but not quite.

You have 3 paths out of that:

1) use a separate "normal" email server, eg postfix for sending your emails and set up a catch all email address on 365 to handle the bounces

2) use a mail provider for your mass mailing (sendgrid, mailjet, amazon aws...). They probably all need you to install a civicrm extension to handle the bounce events

3) contribute a feature to civicrm so it doesn't need VERP. This isn't that far away, the data of the VERP is already added as an extra line in the mail header and for what I've seen, most of the bounce emails copy it.

So the "only" things you'd need: prevent civi to rewrite the from email with a VERP and change the bounce processor to look at the extra header instead of the envelope email.

I'd suggest you 2, mostly because you are likely to have a better deliverability on your mass mailings than relying on exchange.
> 1 votes

---
Tags: email, smtp
---


title: How do I add debug lines?

text:
# Question
Title: How do I add debug lines?
Currently, I'm developing a civi extension in a Wordpress environment. I want to add some debug lines to make sure I'm receiving the intended result from variable/function.

I refer this guide it says the log files are saved in ConfigAndLog directory.but that directory is not available.

I want to know how to include debug lines in the code and from where I can view the results?

Thanks in advance!

# Answer
At the link you referenced it says you can use `Civi::log()->debug();` this section, so for example `Civi::log()->debug(var_export($my_variable, true));`

I'm not sure what you mean by the directory isn't available? This article says how to find it: Where are the "ConfigAndLog" and "templates\_c" directories?
> 4 votes

# Answer
Re "where can I view the results" - if you want to view the log via the GUI try the log viewer extension.
> 3 votes

---
Tags: wordpress, debugging
---


# Question
Title: How do you sync developments to a live site?
Live site, customer has 100,000's of records of data. Has been doing their own thing like editing message templates, users configuring dashboards, editing and adding reports and probably a whole bunch of things I don't know about.

In the meantime, I've been developing some new enhancements which include additional custom data, both in existing tables and add-on tables. Some more message templates, a new dashlet and editing/adding reports. Plus about 80 other items, some in code some in the database.

I happen to know where the dashboard table is, I know where the message template table is - but I don't know which version of each template to keep.

So the code part is easy, but how the hell are you supposed to synchronise the two databases? There is no timestamps or other identifies in the records. There is no way of identifying what changes have been made on the live site There is no way of identifying what changes have been made on the development site.

Seriously - how are you guys doing this in the real world?

Have I missed something?

# Answer
So a few things, if you turn on logging then you'll get a full timestamped history of changes to all tables in the database. If you had this on both environments then you would now be able to see all the changes.

However what your describing is a workflow issue, i.e. having changes happening in two environments without being clear on how changes will be released from Dev -\> Prod seems like an oversight and not one CiviCRM will solve (Sorry - not trying to be rude).

In our pre-prod implementations we always define where customers are doing their prod configurations, where we're doing our dev and which environment is for playing. This way we have a clear release process from Dev -\> Prod. We also introduce staging environments at the right time.

Hope that helps!
> 2 votes

# Answer
It sounds like you have quite a mission. There is no smooth path for synching between the two. We have tried building such a process but it was not robust enough to release.

Our general approach is that if anything is created on live then replicate it on dev, and do not create anything on dev without having first created it on live.

This is the only way we can ensure we keep the gid and field id and all the other entities which might then be applied in customisations, reports etc, in synch. In other words, before doing anything on dev, grab a copy of live. If you need a new field, or some new field options, or a new relationship type etc etc, then create it on both at same time.

If that can't be done, which is your case, then there are some sql inserts (eg relationship type) that are "safe" to do but the IDs may not be consistent and hence may mean that moving a customisation/custom report/etc from dev to live will mean having those IDs updated for it to work on live.

HTH. it isn't a nice situation to be in.
> 2 votes

# Answer
As with the others, I don't know of any great way to sort out the current situation easily, or an out of the box way to make it work super smoothly in the future although of course it does become somewhat smoother if you plan around this from the start when doing your changes.

As far as doing this again in the future or "what to do differently next time", as @Aidan says one way is to package changes in an extension, which allows management of changes to the db schema and data. Another way is to simply track those changes in whatever way you prefer so that you can replicate them in production. So script it, take notes, whatever it is... yes that's sort of dumb, but there you go. And as @Parvez Saleh says you can turn on logging as well if that helps with this (gives you a copy of every table, adding the log\_ prefix in the name and a few new fields in each including a timestamp).

In general here the approach is always that production is the master copy and that anything done in dev needs to them be merged into prod, not the other way around. That's what works best in my experience, at least.

As for the current situation:

As you said everything in the file system shouldn't be too bad. Hopefully you have some sort of revisioning (git?) and you can simply deal with the changes that way. But watch that you don't override some things on prod like user uploads and the main settings files, etc. In Drupal for example these are usually in sites/default but it depends how you're set up.

As for the db this is tougher of course. If you have logging turned on (as above) this helps somewhat. I'm going to assume you have a copy of the database from before you started the changes (i.e. from when you set up the dev site). I would probably start by creating a new database and loading the original data in there. Then you can progressively try exports from both using the same queries in both and diff those export files to start building up a record of the changes. If nothing else going through this should help to remind you / build up a list of what changes were made, even if doesn't give you exact db update queries that you can simply apply.

Once you know what has changed in the db you have a few ways to deploy this to prod. In many cases it may be smarter to simply recreate the steps there, i.e. go through the admin pages, for example re-adding your new custom fields. I would do this in many cases if the changes won't take very long. If something will take a long time, there are some bulk update tools available, depending on what you're doing, and there's also the API. And of course you can always run queries on the db directly, however this is the most error prone and requires the most understanding of Civi's data structure.
> 2 votes

# Answer
To address some of the specific concerns:

* First - check out `hook_civicrm_managed` and the `*.mgd.php` file format in the dev docs. A lot of changes made in the db can be made in code instead and easily moved between sites.
* Added/edited reports can be moved to an extension. A corresponding `.mgd.php` file will ensure the report is added to the db. See Extended Reports extension for an example.
* It sounds like you don't have advanced logging turned on; I would do it now. This will give you your timestamped entries.
* Custom fields, message templates, dashlets - all candidates for managed entities.
* Unique field names are available at the DAO layer, so are available via API - but not via SQL.

I understand your frustration with Civi - you have some good points. Unfortunately, Civi was designed for deployment on least-common-denominator shared hosting, which makes a lot of better practices impossible. We don't have the benefit of assuming `composer`, `npm`, or even non-EOL versions of PHP/MySQL are available. However, I can assure you that some of the very largest NGOs in the world use it successfully.
> 2 votes

# Answer
As Pete & Parvez have already said, there is no general solution for syncing two systems as you describe.

It depends quite what changes you have been making but some of your difficulties can be eased by packaging your enhancements as extensions. There are plenty of examples of extensions creating and using custom fields, tables, reports etc in a portable way.

You will need to go through your dev instance, remember what changes you made and then bundle them into suitable extensions. That is tedious but you will end up with something more maintainable - and none of your options from this point are easy.
> 1 votes

# Answer
I have not tried this but https://lab.civicrm.org/extensions/configitems says

The extension can import the following types of items:

* ContactTypes
* MembershipTypes
* RelationshipTypes
* OptionGroups with OptionValues
* Groups
* Tags
* FinancialAccounts
* FinancialTypes
* EventTypes
* ActivityTypes
* LocationTypes
* CaseTypes
* CustomGroups with CustomFields
* CiviCRM Settings (system settings set through the Setting.API - be especially careful with that!)
> 1 votes

---
Tags: deployment
---


# Question
Title: How can CiviCRM manage and deploy configuration?
*Motivation: we're looking into building something in this space for a current project, so this question is intended to identify what approaches are already available / being utilised.*

For multi-developer and multi-branch workflows, it would be beneficial to "wrap up" site configuration and have it able to be merged into the site before deployment.

I see that there are some approaches to this already:

For comparison, in host-CMS space there are different approaches also:

My question here is: how are people managing and deploying configuration in CiviCRM today?

# Answer
> 3 votes
When I posted this question in 2015, we were looking at implementing something. The result, which is **not a complete solution** as of March 2017, was this extension.

Ultimately, we ended up doing something else on that project, which was exporting specific CiviCRM tables and copying them across from dev ➡ stage ➡ prod.

I've documented what did and didn't work over on the extension README, and happy to discuss further. Posting this to follow up and as a pointer for future searchers.

# Answer
> 3 votes
I have not tried this but https://lab.civicrm.org/extensions/configitems says

The extension can import the following types of items:

* ContactTypes
* MembershipTypes
* RelationshipTypes
* OptionGroups with OptionValues
* Groups
* Tags
* FinancialAccounts
* FinancialTypes
* EventTypes
* ActivityTypes
* LocationTypes
* CaseTypes
* CustomGroups with CustomFields
* CiviCRM Settings (system settings set through the Setting.API - be especially careful with that!)

# Answer
> 2 votes
CiviCRM Features looked like it had promise: https://www.drupal.org/project/features\_civicrm

I spoke to the former maintainer, Tim Mallezie, about this a while ago. He was very helpful. The module was proving hard to maintain, as each entity in CiviCRM required it's own handler (perhaps this is something CiviCRM Entity could help with); and the overhead was proving too much to be worth continuing development.

At the time Tim noted that:

> ...we now use the CiviCRM API in custom modules with update hooks to deploy CiviCRM configuration.

---
Tags: best-practice, configuration, deployment
---


# Question
Title: Restricted access to the WordPress page but still getting errors: 'Sorry, due to an error, we are unable to fulfill your request at the moment.'
I am setting up some member self-service pages, restricting access using the 'Members' plugin, to show (on separate pages):

* a profile to allow members to update their details via `[civicrm component="profile" mode="edit" gid="1"]` (different errors depending on view or edit modes)
* Dashboard so that invoices and event bookings are visible via `[civicrm component="user-dashboard"]`

But still getting the following error:

* Error with anonymous / not logged in user and viewing profile (if the mode="edit" then redirects to homepage)
* Error with anonymous / not logged in user and viewing Dashboard

'Members' plugin is working as expected and I can successfully set it up to restrict content and show custom messages. CiviCRM permissions appear to be correct / default.

I was not expecting to get any CiviCRM error messages as the content was restricted and not showing, though something is triggering the error messages / redirection.

I have checked with a clean install of both WordPress (5.4.1) and CiviCRM (5.25.0 and 5.26.0), and even used other plugins that do similar content restriction but all to the same end.

I am pretty new to CiviCRM so any suggestions as to fix this / or where to look would be much appreciated.

The back trace posted below for the view profile states 'Could not find the required contact id parameter (id=) for viewing a contact ...' which is understandable, though why it is trying to find contact id when the content is restricted is puzzling me.

backTrace

```
#0 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(337): CRM_Core_Error::backtrace()
#1 [...]/wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php(52): CRM_Core_Error::fatal("Could not find the required contact id parameter (id=) for viewing a contact ...")
#2 [...]/wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php(152): CRM_Profile_Page_View->preProcess()
#3 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(311): CRM_Profile_Page_View->run((Array:3), NULL)
#4 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13))
#5 [...]/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
#6 [...]/wp-content/plugins/civicrm/civicrm.php(1479): CRM_Core_Invoke::invoke((Array:3))
#7 [...]/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(328): CiviCRM_For_WordPress->invoke()
#8 [...]/wp-includes/shortcodes.php(343): CiviCRM_For_WordPress_Shortcodes->render_single((Array:3), "", "civicrm")
#9 [internal function](): do_shortcode_tag((Array:7))
#10 [...]/wp-includes/shortcodes.php(218): preg_replace_callback("/\[(\[?)(civicrm)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\...", "do_shortcode_tag", "[civicrm component=\"profile\" mode=\"view\" gid=\"1\"]")
#11 [...]/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(214): do_shortcode("[civicrm component=\"profile\" mode=\"view\" gid=\"1\"]")
#12 [...]/wp-includes/class-wp-hook.php(287): CiviCRM_For_WordPress_Shortcodes->prerender(Object(WP))
#13 [...]/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters("", (Array:1))
#14 [...]/wp-includes/plugin.php(544): WP_Hook->do_action((Array:1))
#15 [...]/wp-includes/class-wp.php(748): do_action_ref_array("wp", (Array:1))
#16 [...]/wp-includes/functions.php(1274): WP->main("")
#17 [...]/wp-blog-header.php(16): wp()
#18 [...]/index.php(17): require("[...]/wp-blog-header.php")
#19 {main}

```

# Answer
> 1 votes
I have found a partial solution...

To wrap the CiviCRM shortcode in a Members shortcode (which would have been the 'old' / pre-gutenberg block way to do it)

`[members_logged_in][civicrm component="user-dashboard"][/members_logged_in]`

The content is then restricted to logged in users (in this instance) and no visible errors are thrown, though while the form works it appears some Javascript/CSS is not loaded on the page when the shortcode is nested - which others have also come across here: Request login on edit mode profile form.

# Answer
> 0 votes
Digging a little deeper, I think I have discovered why the nesting of the shortcodes works.

* CiviCRM html header is not present (1), resulting in
* Uncaught ReferenceError: CRM is not defined (2)

So the page breaks at the point of validation meaning no errors are thrown. Resulting in an error solving an error.

Unfortunately I am at the limits of my knowledge to properly solve the original error, which looks like it is caused by either/and/or:

* Members plugin not restricting content fully - though as I get the same error with similar plugins doing the same thing as the restriction is only on page content rather than in the header so perhaps a fix is needed elsewhere if inclusions in the header cannot be restricted
* WordPress continuing to load content even though a plugin has restricted it - which it isn't as the scripts and styles are loaded in the header which the plugin does not restrict.

However fixing both of those would then result in CRM validation which would throw the original error...

Could the CiviCRM shortcode have parameters to either fail silently (which means the WordPress plugin / WordPress code could continue its business), or have similar restriction functionality baked in so that CiviCRM code can do all the hard work.

(1)

```
<!-- CiviCRM html header -->
<script type="text/javascript">
var CRM = {"config":{"isFrontend":true,"wysisygScriptLocation":"\/wordpress\/wp-content\/plugins\/civicrm\/civicrm\/js\/wysiwyg\/crm.ckeditor.js","CKEditorCustomConfig":{"default":"https:\/\/[...]\/uploads\/civicrm\/persist\/crm-ckeditor-default.js"}}};
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery/dist/jquery.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/jquery-ui.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/lodash-compat/lodash.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/select2/select2.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.form.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.timeentry.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.blockUI.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/datatables/media/js/jquery.dataTables.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-validation/dist/jquery.validate.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/Common.js?r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.datepicker.js?r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.ajax.js?r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/wysiwyg/crm.wysiwyg.js?r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/crm/ajax/l10n-js/en_GB/?cid=2&r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.tableHeader.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.notify.min.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.optionEdit.js?r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/ui/i18n/datepicker-en-GB.js">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.wordpress.js?r=pLAwt">
</script>
<link href="https://[...]/plugins/civicrm/civicrm/css/crm-i.css?r=pLAwt" rel="stylesheet" type="text/css"/>
<link href="https://[...]/plugins/civicrm/civicrm/bower_components/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<link href="https://[...]/plugins/civicrm/civicrm/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="https://[...]/plugins/civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
<link href="https://[...]/plugins/civicrm/civicrm/bower_components/select2/select2.min.css" rel="stylesheet" type="text/css"/>
<link href="https://[...]/plugins/civicrm/civicrm/css/searchForm.css?r=pLAwt" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/crm.searchForm.js?r=pLAwt">
</script>
<script type="text/javascript" src="https://[...]/plugins/civicrm/civicrm/js/noconflict.js?r=pLAwt">
</script>

```

(2)

```
  <script type="text/javascript">
    CRM.$(function($) {
      $("form.CRM_Contact_Form_GroupContact").crmValidate();
    });
  </script>

```

---
Tags: wordpress, profile, error, user-dashboard
---


title: How do I set up an email auto-reply?

text:
# Question
Title: How do I set up an email auto-reply?
I am running Civi on Joomla and want to set up an email auto-reply. How do I do this?

Thank you!

# Answer
how about using Civirules to send email when Inbound activity is recorded?
> 1 votes

---
Tags: email
---


title: Update capitalization of contact names

text:
# Question
Title: Update capitalization of contact names
I was hoping to find an extension that would correct the capitalization of first last names - for example, if someone entered a name in all lowercase or all uppercase, it would change the first letter of the name to uppercase.

It looks like the Capitalisation Corrector does just this. https://civicrm.org/extensions/capitalisation-corrector. But I can't find it as a scheduled job, or in the extension directory. I tried using the Normalise the Data extension but that does not work for my purposes.

I am currently using CiviCRM 5.18.2 with WordPress. Does the Capitalisation Corrector work with WordPress? Is there another way I can install it?

# Answer
> 1 votes
None of the extension you mentioned have schedule job or script to fix historical data, we had to write a script to update historical data when the extension was installed, and going forward extension managed to capitalize the name.

# Answer
> 1 votes
The Capitalisation Corrector is not available for download via the `Administer > System Settings > Extensions` interface so you need to get the extension files on to the system some other way.

There are multiple ways to do this depending on the access you have, but you need to get the files from the latest release (see Download link on the extension page) extracted into your extensions directory. If you don't know where your extensions directory is, check `Administer > System Settings > Directories`

Once you have done that, go to the Extensions page again, click Refresh and you should see the extension available for installation. Click Install.

When it has finished installing you will then find the scheduled job labelled "Call Contacts.CorrectNameCasesJob API (Daily)"

I have not tested on WP but I would expect it to work.

# Answer
> 0 votes
It's easy to script using mysql to correct first\_name field to "First" and last\_name field to "Lastname", but it's difficult though not to mess up last names like "McArthur" or hyphenated first names like "Mary-Beth".

# Answer
> 0 votes
This extension might be what you're looking for. I use it, works great!

---
Tags: wordpress, contacts
---


# Question
Title: How to add a drop down with option groups and option values?
I planning to add a drop down button with option groups and option values.

This is my code

```
$form->add('select', 'a', ts('a'),
            array(
              '1' => ts('value 1'),
              '2' => ts('value 2')
              )
            );

```

Is there any efficient method to do it? Also i want to capture the option value and save it to a variable in order to save it in the database. I have tried `$form->getvalue('a')`, but didn't work. Much appreciate if someone could help me to solve this.

# Answer
> 1 votes
If it's a setting for your extension, then take a look at the settings framework: https://docs.civicrm.org/dev/en/latest/framework/setting/#creating-a-new-setting-in-an-extension

If you're modifying a form, then you can get the value when the person submits the form using hook\_postProcess: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_postProcess. One way it to use `$form->_submitValues` which is an array.

---
Tags: profile
---


# Question
Title: Cases appear on my dashboard "My Cases" but no cases appear on CiviMobile App (android)
I can't see any Cases in the mobile app. Running Drupal core 7.69, CiviCRM 5.20.2, CiviMobileAPI 4.2.1. The account I'm using has administrative privileges.

When I login to my website a view cases I can see the following:

But when I view cases on the mobile app I don't have any cases.

Has anybody else seen this? Any tips on resolving? I am able to see case activities.

Thank you.

# Answer
Have you found a solution to this?

It appears that the only cases that populate the "Cases" page in the mobile app are those in which you are the client, rather than the case manager or any other case role...
> 0 votes

---
Tags: civimobile
---


title: CiviCRM and Caldera Forms

text:
# Question
Title: CiviCRM and Caldera Forms
I have a general question really.

I am working with a client who is using CiviCRM. He has a membership joining page, donation pages, main donation and sub donations ie. £4, £6, £10 as well as a contact form. We have had problems using the CRM forms on the website so I am looking at using contact form 7. I understand that contact form 7 has an integration with the CiviCRM.

Can I build the forms with contact form 7 which would include checkboxes, dropdowns, text fields and will all this data go to the CiviCRM, and will it still work if I make multiple forms, will they all send data to the CRM?

# Answer
> 1 votes
The Contact Form 7 integration basically takes all fields from the form and sends the data to CiviCRM. So basically you have 2 options when creating forms:

1. Use one of the standard CiviCRM API calls, and make sure the fields on your form are named as required by the API call
2. Develop an extension with your own API calls and use those (with the field names) on your form.

---
Tags: civicontribute, civimember, custom-fields, forms
---


# Question
Title: Why is the clear option missing on a custom field with radio options?
When a custom field with radio options is created it has sometimes a clear option (see below)..

And sometimes it's not available like the color field. The first thought is that the reason is that the color field is mandatory, so the clear option is not needed, but that's is not the case. It is also optional. The missing clear option is annoying because it's not possible to undo a wrong choice. The used CiviCRM version is 5.28.

# Answer
> 4 votes
The difference is in the definition. The color field has the *Options Per Line* set. This has as a side-effect that it disables the clear box (and the change options wrench). Clearing this field makes the clear option return.

# Answer
> 0 votes
The answer posted by Kainuk sounds like a bug in civicrm. After it is fixed and still the "clear" option is not visible, make sure the custom field is not set to "Required".

Required custom fields do not have the `clear` option displaying on the radio custom field.

---
Tags: custom-fields
---


title: Emailed invoice PDF line items missing

text:
# Question
Title: Emailed invoice PDF line items missing
I have setup a webform to process membership renewals via a checksum. When the user pays they are sent a pdf invoice which is missing information such as description, quantity and unit price (see attached screen capture).

However, the correct PDF invoice is sent when I select the following: Home » CiviCRM » Administer CiviCRM » Manage Contribution Pages » Receipt » Tick Email Receipt to Contributor?

The issue with this is that Civi will also send the email with the missing information.

Does anyone know how I can get the correct information to display on the first email? Or to stop 2 emails being sent when: Email Receipt to Contributor - is selected?

All message templated are default. CiviCRM 5.26.1. Drupal 7.71

Edit: Second screen capture of desired outcome.

# Answer
Can you post the screenshot of the webform used to retrieve membership renewals? Not sure what you expect in the description, qty field.

> Or to stop 2 emails being sent when: Email Receipt to Contributor - is selected?

Check whether `Automatically email invoice when user purchases online` is enabled on contribution settings? - `Administer => CiviContribute => CiviContribute Component Settings`
> 1 votes

---
Tags: civimember, webform-civicrm, invoice, system-workflow-messages
---


# Question
Title: I can send emails with Drupal 7 using the SMTP Module but not CiviCRM
I host a server on Google Cloud with Protonmail Bridge running in the background. I am still new at working with CiviCRM 5.26.1 and PHP. I can successfully send emails via Drupal usinig the SMTP module but with CiviCRM I receive this error when I send a test email:

> authentication failure \[SMTP: STARTTLS failed (code: 220, response: Ready to start TLS)\]

In the Bridge Configuration Guide, an exception has to be set on Thunderbird.

Now, according to this solution that would seem to solve my problem : SMTP connection failing problem, I don't have the same structure when I open the /Net/SMTP.php file.

Note: This exception is needed for Protonmail Bridge.

# Answer
Civicrm has changed how it's including the PEAR library - it was previously including a patched version - however this was updated in https://github.com/civicrm/civicrm-core/commit/a6a0ff13d2a155ad962529595dceaef728116f96# to improve maintainability

I believe if you want to apply the fix from SMTP connection failing problem

you will now find the required file in vendor/pear/net\_smtp/Net/SMTP.php
> 1 votes

---
Tags: smtp
---


title: Smart Group DB error

text:
# Question
Title: Smart Group DB error
Viewing some Smart groups (not all) causes DB error.

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

[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => INSERT IGNORE INTO civicrm_tmp_e_gccache_554616ac5a2e5773984de236f4af031e (group_id, contact_id)  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
[type] => DB_Error
[user_info] => INSERT IGNORE INTO civicrm_tmp_e_gccache_554616ac5a2e5773984de236f4af031e (group_id, contact_id)  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT IGNORE INTO civicrm_tmp_e_gccache_554616ac5a2e5773984de236f4af031e (group_id, contact_id)  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]"]
)

```

I think, this error is since the last, 5.26.1 update.

Has someone this problem, too?

# Answer
It has been reported here https://github.com/civicrm/civicrm-core/pull/17622 and it should be fixed by the CiviCRM 5.26.2.
> 4 votes

---
Tags: error, smartgroups
---


# Question
Title: Dedupe rule ignores the location type for Email/Phone but does not ignore for Addresses. Should we make this consistent
per the title, what do others think is the better behaviour

a/ ignore Location Type for Email, Phone, but use Location Type for Address (status quo)

b/ change so Location Type is never taken in to consideration (ie Address would be treated same as Email, Phone)

c/ change so Email/Phone also have Location Type taken in to consideration when applying matching rules.

Reason for asking is we got caught out using a rule with postcode. We expected the postcode to be location agnostic. Seems it isn't.

# Answer
> 5 votes
B please. This has been a point of frustration when importing. Make the location type simply a label without deduping consideration.

I thought it always takes into account location type.

# Answer
> 1 votes
Looking at the code this was implemented in svn days & it's just a case of removing code & adding a unit test

https://github.com/civicrm/civicrm-core/blob/2cbe6e87cbf0c1ce7a2f89c2000c472b58e66146/CRM/Dedupe/Finder.php#L266-L298

Relevant tickets: https://issues.civicrm.org/jira/browse/CRM-17564 https://issues.civicrm.org/jira/browse/CRM-5026 https://issues.civicrm.org/jira/browse/CRM-3902

From the code it looks like this is used when matching on creating a contact but not on finding duplicate contacts from the finder screen.

I'm +1 on B but would want to see more people weigh in (esp as I'm not a heavy user of this functionality as we import and then dedupe for historical reasons - which by-passes this)

# Answer
> 1 votes
I came across this today and am also a +1 for B. I think the Bs have it.

---
Tags: duplicate-contacts, dedupe-rules
---


# Question
Title: problems with kcfinder image browser in Chrome
There did not use to be a problem with the media browser in CiviMail when using Chrome, but it's broken now.

https://BASEURL/sites/all/modules/civicrm/packages/kcfinder/js/index.php 3.12

WORKS in Firefox: shows KCFinder: /image33 files (4 MB)

Does not work/Hangs showing "CIVICRM File Manager" as heading Chrome Version 83.0.4103.97

Other reports of hanging while trying to upload or select images.

# Answer
> 1 votes
You don't mention CMS but if this is Drupal then I would recommend you upgrade to 7.71 due to

---
Tags: civimail, images
---


# Question
Title: access civimail images from Drupal media browser
If we wish to reuse images in a node on the main Drupal site uploaded for a CiviMail email newsletter, we can not access with the media browser widget for a field from: sites/default/files/civicrm/persist/contribute/images/image

Is there a way to change this? (More of a Drupal question than a CiviCRM question.) Currently everything has to be uploaded twice if first used in CiviMail.

# Answer
possibly the same answer per your other Question, namely upgrade to 7.7.1
> 0 votes

---
Tags: drupal, civimail, images
---


# Question
Title: How can I connect my website to CiviCRM on a remote server?
The easiest common installation pattern is to have CiviCRM and the frontend website on the same server using the CMS as the website but it is often said there are benefits to keeping them separate. Multiple approaches and extensions have been developed to facilitate this - but our documentation does not (yet!) provide any guidance on these.

The purpose of this question is to gather information about the various tools that exist, what problems they solve and how they fit together as the basis for a new section in the documentation.

* What extensions exist to connect a frontend website with a backend CiviCRM?
* What can they be used for? Eg - mailing list signup, event signup, personal profile updates, contributions etc
* What front-end extensions/modules/plugins work with them?
* What back-end extensions work with them?

Notes:

1. I know the normal advice is not to ask multiple questions in one SE question. But think of those as sub-parts of the overall question "How can I connect my website to CiviCRM on a remote server?"
2. There are some previous related questions but the aim here is to get a comprehensive list of current recommended methods. Eg: creating contacts from remote websites Webform CiviCRM integration with REST Using iframes to present contribution page on remote site CiviCRM and WordPress on different hosts?
3. If we get one great all-encompassing answer, that can become the basis for the documentation update. More likely, we'll get a selection of answers on particular tools that will need to be consolidated.

# Answer
I am not even going to try and answer it all in one go :-) But I am happy to share the configuration that my customers with remote CiviCRM's use.

They all basically have a public website (Drupal 7 or 8 in most cases, Wordpress in some but in theory any CMS would do) on a server and a separate CiviCRM in a "dummy" Drupal 7 on another server. I use the word "dummy" because in this case Drupal 7 on this CiviCRM server really only is the operating system that makes CiviCRM run.

They all use **CMRF** on their public website to be able to connect to another server. CMRF is a framework that enables a website to connect to one or more CiviCRM instance(s). The core is CMS agnostic, and there are currently implementations for Drupal 7, Drupal 8 and Wordpress. If an organization would want to use another CMS they could develop a CMRF implementation for that specific CMS.

Almost all of our customers that work in that way use **CiviProxy** as a gatekeeper for their CiviCRM instance(s). CiviProxy is a a kind of policeman that checks if the request you want to send to the CiviCRM server is allowed. So the public website (or other webservices!) sends a request to CiviProxy, CiviProxy checks if the credentials are correct and if the request is allowed and if so, sends it to CiviCRM and returns the result. Documentation on CiviProxy: https://docs.civicrm.org/civiproxy/en/latest/

We use the **Form Processor** extension (https://civicrm.org/extensions/form-processor) to create webforms on the public website that communicate with CiviCRM. If the website is in Drupal 7, there is a module called CMRF Form Processor that makes it a little easier. Documentation on the Form Processor: https://docs.civicrm.org/formprocessor/en/latest/

We use the **Data Processor** extension (https://civicrm.org/extensions/data-processor) when we want to show data from CiviCRM on the public website.
> 6 votes

---
Tags: documentation, architecture
---


# Question
Title: How can I send "Birthday wish" email to contact?
I have tried to create a smart group for the contact who's birthday is today and send an email via civirules, but search builder doesn't have option to set the date as "Today".

Is there any alternative way to achieve this?

Just wondering if anyone has worked on a similar flow and give a hint please?

# Answer
The scheduled reminders functionally works nicely with any date field. -
> 5 votes

# Answer
I would not use a smart group, but use the "Individual has birthday" trigger that is included in CiviRules?
> 6 votes

# Answer
If you use Adv Search then you can get the Today option on the birth date. Your question doesn't explain why it needs to be via Search Builder hence 'using Adv Search' seems to be a valid answer to 'is there an alternative way'.
> 3 votes

---
Tags: civimail
---


# Question
Title: Any way to catch the user hitting "cancel" or close on Print/Merge form - as activity list does not refresh?
The particular issue I am trying to deal with is that the print/merge form (Export Document on Manage Case) does not refresh the civiCase activities list.

This is because the user never "saves" this form, but only "cancels" it (or closes it) so there is no interaction back at the main civiCase caseView.

Any ideas for a solution to this problem?

# Answer
> 1 votes
Good question. You can turn off popups but that doesn't fully solve it since it still stays on the page, but then at least there isn't a mismatch and when you click Cancel you can go back to Manage Case and it shows the activity.

To turn off popups go to Administer - Customize - Display Preferences and there's a checkbox "Enable Popup Forms" near the bottom.

---
Tags: civicase
---


# Question
Title: What is a line item? And what is a financial item and how are those two linked together?
I have created an extension to generate invoices (contributions) based on time spend on activities on a case.

For each activity a line item was created and added to the contribution. Also the financial type had 21% percent of VAT configured.

In CiviCRM version 4.6 this extension works smoothly. However after upgrading to CiviCRM version 5.9.1 I cannnot edit contributions any more. It fails with the error `Expected one FinancialItem but found 0`.

After debugging I found out that the line items created with my extension does not have a related financial item (I did not even know they existed and/or where required).

So now I have changed my extension to create **two** financial items when **one** line item is added:

1. One financial item for the amount **without VAT**
2. And, one financial item for the **VAT amount**

Contributions created after this change could be edited. Hurray!

**The questions**

Now comes my questions:

1. What are financial items?
2. How do they differ from line items?
3. Where do I find documentation about line items and financial items?
4. What are financial transactions (trxn)? (See answer of Joe)?

**Solution**

To create all the underlying financial items etc.. One must use the Order API. The order API does create a contribution and line items.

# Answer
> 3 votes
The solution to my question is to use the Order API. The order API does create a contribution, line items and the underlyning financial items etc...

# Answer
> 9 votes
The Line Item table is oriented towards the current state of an order's line item. The Financial Item table is oriented towards keeping track of the history of the financial aspects of line items. The Financial Transaction table is the base table for financial transactions created by CiviCRM every time there is any add, update, cancel, refund, pay grant or other action that has a financial impact.

At a high level, each time there is a change in a line item that produces a financial effect, like a change in the quantity, or the price, or the financial type associated with the line item, a reversal entry of the previous financial impact of the line item is made in the financial item table, and a new entry is inserted representing the current financial impact.

Another difference is that line items are more like business entities while financial items are aspects of financial accounting entries. To hide the complexity of double entry bookkeeping, CiviCRM uses Financial Types to create a bundle of Financial Accounts that will be used through the life cycle of a transaction for things like its Accounts Receivable account, its Revenue account, and potentially other accounts like the Accounts Payable or Contra Revenue account for refunds owing. These financial accounts are the ones that appear in the Chart of Accounts for an organization. Line items have financial types associated with them, while the specific detailed nature of financial items means they have financial accounts associated with them.

The civicrm\_financial\_trxn and civicrm\_financial\_item tables hold the main accounting or bookkeeping information in CiviCRM while civicrm\_entity\_financial\_trxn is a related table that connects records in civicrm\_financial\_trxn to related records in various other tables. There are many types of financial transactions, and they all are stored in these tables, and are exportable via Financial Batch exports to Accounting Packages like QuickBooks, Sage, and Microsoft Dynamics.

Bookkeeping entries have two sides to them: a debit account and a credit account, as well as an amount and a date. Some bookkeeping entries are split, where a single amount on one side is split amongst several amounts and accounts on the other side. For example, a payment for an event registration and a donation would have the total going into the bank on one side, and revenue being recognized for two accounts on the other side.

In the case of contributions which handle the finances for donations, memberships and event registration as well as other sale items, each line item will create a civicrm\_financial\_item, each payment will create a civicrm\_financial\_trxn, and civicrm\_entity\_financial\_item records will connect them. In the case of line items with sales tax, which in general goes to a different account in an organization's chart of accounts, there will be an additional entry in the civicrm\_financial\_item table representing the tax on a line item.

An important principle of accounting is that books should be auditable. One part of that is to retain records about all of the changes that have been made on items. So if a purchase is made with pay later selected, and two partial payments are made, the number of things purchased is changed, a refund is made, etc., then all of these are tracked in the financial tables in CiviCRM. Entries in civicrm\_financial\_item and civicrm\_financial\_trxn tables are intended to never be edited or deleted.

We highly discourage developers trying to write directly to the civicrm\_financial\_trxn, civicrm\_financial\_item and civicrm\_entity\_financial\_trxn tables which store financial information in CiviCRM since version 4.3. We'd encourage use of the order api and/or payment api, and will enhance and/or fix issues with those APIs.

Documentation that is reasonably accurate on entries for these interlinked tables for various types of accounting transactions can be found at https://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccounts4.3DataFlow-OnlineorofflinecontributionwithFEE.

The Caldera Forms CiviCRM plugin for WordPress was recently trying to integrate its support for various line item operations with Civi core, so their code may provide useful guidance. The Line Item Edit extension might also be a useful developer resource, though I seem to recall that it needs a bit of refactoring.

# Answer
> 2 votes
Let me try to explain: Line item, Financial item

First of all both line item and financial item are created based on contribution

Line item are created only once and financial items are created based on the contribution status

---

**Line item**

Line item are used for invoice purpose which holds contribution break down (amount and tax amount)

They are static line which gets changed only when a contribution total changes

---

**Financial Item:**

Financial items are created for each contribution status - Purely used for accounting purpose (also for finding the outstanding contribution amount to pay)

when you create a contribution as pending you end up with financial item as pending

Then when the contribution is completed you will see one more record for completed

same for cancelled and refund

---

Other linked tables

civicrm\_entity\_financial\_trxn
civicrm\_financial\_trxn

I guess this helps - I tried my best !!!

Thanks

# Answer
> 0 votes
If I may add another question: Why are we going through this whole rigmarole in the first place with "financial type" "financial item" and line item"s?!

In Quickbooks, things are simple: Every record has two objects, which they represent in rows on a spreadsheet (starting at different columns though): (1) transaction (2) line items. Every transaction must have at least one line item and, but can have more. The transaction is represented by one row in a spreadsheet, the first line item is a second row in a spreadsheet the the second line item is a third etc. The sum total of the "items" (line items) becomes the "amount" on the transaction record. The transaction record itself does not have any items. This way, a single transaction can have a single or multiple "items" and "classes", be recorded as one transaction (and gives you the benefit of tracking quantity & inventory when that's relevant).

In Civi, each transaction is only one line and that one line must have a "financial type" associated with it ("financial type" seems to match QB "items"-because they are both associated with accounts, but not actually accounts).

If you don't use the line item extension, you can't record split transactions, quantities, or inventory.

If you do use the line item extension, you have "line items" and "financial items" & "financial types" which are all essentially the same thing but overcomplicate things for no good reason (they are all a way of recording what was "sold"). All the line item fields are stuck in some weird place that you can only access with a special report. Because the transaction itself requires a "financial type", the "financial types"of the "line items" are overridden, rendered useless (the whole reason are putting different "financial types" on each line item is because this one transaction can't be characterized by one "financial type").

You can't export the line items as CSV, IIF or sync with Quickbooks and it doesn't reflect the reality of business. The QBO integration had to map civi "accounts" to QBO "items/products/services" which doesn't make any sense (shouldn't accounts map to accounts, not "items"?) The reason they had to do this, is because every QB sales receipt or invoice must have an "item", and there's no good item to map to.

Is there any reason civi can't mirror the same setup as QB with (1) "items" (2) "class" (3)"accounts" and require every transaction to use line items, even if they only have one? This doesn't hurt other accounting softwares which don't record like this because they can pull only the "transaction line" while QBO can sync seamlessly with all the relevant lines.

For the record, I would argue that "events" should also use line items to represent the "ticket/item" that was sold as a "contribution".

Does anyone have ideas on this? I do, and I'm willing to put money towards it, but it needs more support from the community first.

---
Tags: civicontribute, contributions, financial-accounts, line-items
---


# Question
Title: How can I change a cell in dataTables (custom data type tab with table) to disable the inline edit?
I need to make a change where some of the contact identifiers (extension Identity Tracker) can not be changed by the user. I can do that with the validateForm hook. But the Contact Identities are actually custom data of the type "tab with table" and you can also edit them inline.

The custom data tab with table uses the jQuery dataTables, and do not respect any hook unfortunately. In the is a with the class "crm-editable-enabled". If I can change that class to "crm-editable-disabled" I would be fine, but I have no idea how to do that with the dataTables API and the documentation shows stuff like this:

```
CRM.$(function($) {
  var myTable = $('.dataTable').DataTable();
  myTable
          .columns('.crm-editable')
          .nodes()
          .flatten()  // Reduce to a 1D array
          .to$()      // Convert to a jQuery object
          .removeClass('crm-editable-enabled')
          .addClass('crm-editable-disabled');
});

```

I can get the var myTable, but the rest does not seem to have any effect....any ideas?

# Answer
> -2 votes
how about using apiwrapper hook and throwing exception?

---
Tags: custom-fields, jquery, datatables
---


# Question
Title: Received the following error after creating contibution in backend
Please correct the following errors in the form fields below: Select at least one option from Contribution(s).

# Answer
> 0 votes
One or more of the required field for contribution or a custom field related to contribution which is a required field value maybe missing. I would look in there first.

---
Tags: drupal
---


# Question
Title: Offline event registration Pay later option
I want to be able to offline register user, that will pay later. If in 'Payment information' I set an amount of 0 and a 'Payment status' to 'pending', 'Participant Status' is always set to 'Partially paid' and not the status that I have set, when an confirmation and receipt is send by email. If 'Send Confirmation and Receipt' is unchecked, 'Participant Status' is not changed, and only contribution status is set to Pending (Pay Later)

It should be nice to have a 'Pay later' checkbox so it's not mandatory to record an empty payment.

Is it possible?

Thank you for your help,

Olivier.

# Answer
You could do the above by going to a contribution form and have cid=0 or use the 'register as another person', ie use the public form but put in their details and set as 'pay later' via the form
> 2 votes

---
Tags: civievent, registration
---


# Question
Title: Drupal 8: How do I shift a project/site from using the roundearth installation method to the CiviCRM official composer asset plugin
From an existing site set up using the roundearth composer plugin method as detailed -\> https://www.mydropwizard.com/blog/better-way-install-civicrm-drupal-8

composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction

How do I update this to use the newer https://lab.civicrm.org/dev/drupal/snippets/43composer require civicrm/civicrm-asset-plugin:'~1.0.0' pear/pear\_exception:'1.0.1 as 1.0.0' civicrm/civicrm-{core,packages,drupal-8}:'^5.25' --prefer-source

# Answer
> 5 votes
Depending on how your initial site set up was created you might need to take a more extreme option detailed below but hopefully the following will work:

If you want you can copy composer.json , composer.lock to a new directory (or local) and use issue `composer install`to check the below works this can be useful if you are having problems and need to remove composer.lock and vendor. But I'm assuming you are going to be doing this on dev/staging.

```
composer remove roundearth/civicrm-composer-plugin --no-update
composer config extra.enable-patching true

```

civicrm/civicrm-{core,packages,drupal-8}:'^\[civicrm latest version without the point version\]'

Apart from the removal of the roundearth/civicrm-composer-plugin you want to follow the install steps outlined here: https://docs.civicrm.org/installation/en/latest/drupal8/

(Note D9 Drupal recommended you'll need to set the minimum stability from stable to dev if you haven't already).

If you are still on an older version of civicrm you might need to include pear/pear\_exception:'1.0.1 as 1.0.0' in the above require. But the latest version doesn't require this anymore.

Assuming this is successful you will then want to drush updb drush cr

I'd also recommend clearing out web/libraries/civicrm/ and then repopulating with composer civicrm:publish

This is something you might need to repeat on live.

Note hopefully soon "pear/pear\_exception:'1.0.1 as 1.0.0'" will not be required. Check the install instructions and mirror them.

Options to make things easier.

* If your civicrm is not latest either upgrade first (best option) or use '\[civicrm latest version\]' (note missing '^' and you want full version with patch level i.le. '5.26.2' not '^5.26') to lock yourself to the specific civicrm version in composer.json - you will want to update to add the '^' in once complete and remove the point version to allow upgrades - or you might want to leave it like this to prevent composer update upgrading civicrm.
* If you get composer conflicts in your dev/sandbox environment remove vendor and composer.lock. This will mean that you then end up running upgrades on everything - so best to do these first, or lock anything you need not upgraded in composer.json.
* If you forget to remove roundearth/civicrm-composer-plugin you'll run into problems with resources not being copied correctly across to web/libraries. If you are not seeing the menu on load or are missing seeing an error for a missing file extension-compatibility.json you might need to make sure you have removed roundearth/civicrm-composer-plugin fully.
* add --no-update to the second require then you can use composer update --dry-run along with all the packages you are adding/removing.

As per below check your civicrm.settings.php file and make sure the following are either removed or match the location where the libraries are stored.

```
$civicrm_paths['civicrm.root']['url'] = '/libraries/civicrm/';
$civicrm_paths['civicrm.packages']['url'] = '/libraries/civicrm/packages/';

```

**The extreme version below assumes you have no custom themes/modules or file uploads. If you have any of the above. You probably want to follow a different root!**

I had done this once and I described it at https://lab.civicrm.org/dev/drupal/-/issues/115#note\_34161

1. Backup civicrm.settings.php and drupal settings.php.
2. Delete everything in the root folder, including drupal.
3. cd `<one folder up from root>`
4. `composer create-project drupal/recommended-project:8.x.y <root folder>`
5. cd `<into root folder>`
6. SET COMPOSER\_MEMORY\_LIMIT=-1 (or `export COMPOSER_MEMORY_LIMIT=-1` for unix)
7. composer require civicrm/civicrm-asset-plugin:~1.0.1 civicrm/civicrm-core:dev-master civicrm/civicrm-packages:dev-master civicrm/civicrm-drupal-8:dev-master
8. restore civicrm.settings.php and drupal settings.php
9. If you have the two extra lines in civicrm.settings.php that were needed after roundearth+civi5.23, then you don't need them anymore, i.e. **remove these lines**

```
 $civicrm_paths['civicrm.root']['url'] = '/libraries/civicrm/';
 $civicrm_paths['civicrm.packages']['url'] = '/libraries/civicrm/packages/';

```
10. log in and clear caches

CAVEAT: As described in that thread it really depends where you started from and additionally what else you have installed via composer on that site and so you might not want to remove the whole drupal folder. The above was a pretty plain stock site and I was also converting to drupal-recommended at the same time. If you keep some things and for example if you've installed fancy modules, you may see composer throwing up irreconcilable differences.

Also the above was for a dev install, using dev-master. Replace dev-master with a specific `5.x.y` or `^5.x` as desired.

Further disclaimer: Civi + d8 has been a constantly moving target. It's repeatedly come up that what worked "2 months ago" doesn't quite work "now". I have not tried the above in the last 2 months.

---
Tags: drupal, drupal-8, composer
---


title: CiviEvent Fees not displaying

text:
# Question
Title: CiviEvent Fees not displaying
Using Drupal 7.7.1/Civi 5.26.1 I've set up a paid event with two price options (Waged/Unwaged), with no 'Pay Later' and Stripe as payment processor.

When I use the registration page for this event (test or live) in a logged in browser, the prices display OK and registration succeeds, but the prices don't display on the live registration page for a browser that is not logged in. All the other elements on the page seem fine.

Anonymous users' permissions to 'register for events' and 'view events' are set.

Log messages are

> Warning: array\_intersect\_key(): Expected parameter 1 to be an array, null given in CRM\_Event\_Form\_Registration-\>buildCustom() (line 550 of /var/www/clients/client4/web5/web/sites/all/modules/civicrm/CRM/Event/Form/Registration.php)

and

> Notice: Undefined variable: fields in CRM\_Event\_Form\_Registration-\>buildCustom() (line 550 of /var/www/clients/client4/web5/web/sites/all/modules/civicrm/CRM/Event/Form/Registration.php)

I see in Registration.php @550 that this error may(?) relate to profile fields, but these seem to be displaying & filling OK.

Advice gratefully received.

# Answer
When I modified the event to use a price set, it worked perfectly.
> 1 votes

---
Tags: civievent, drupal, online-registration
---


# Question
Title: Where is minDate on membership start date set? Or can I change what minDate is set to?
So we have historic records which have been imported which include start dates going back to 1990s.

However, when those records are brought up for editing, the minDate kicks in and sets the date to 20 years ago.

I would like to be able disable the minDate test altogether, but cannot find it in the form setups at all.

If I can't disable it, can I set it to something much older?

Any suggestions as to where I should be looking, can't find anything in membership.php or .tpl that seems to set this.

# Answer
minDate for these entities can be updated at `Administer > Customize Data and Screens > Date Preferences`, i.e, `civicrm/admin/setting/preferences/date?action=reset=1`

Click on `Edit` and update the Start Offset(minDate) to eg 30. This will default the membership start date to start from current year - 30.
> 3 votes

---
Tags: civimember
---