title: CiviMobile “unknown error” on Wordpress

text:
# Question
Title: CiviMobile “unknown error” on Wordpress
I'm trying to use Civimobile but can't sign-on. I get "unknown error". I'm using WordPress 5.2.2, PHP 7.2 and CiviCRM 5.15.1. I installed Civi CRM Api Fix. plugin 1.0.0, and CiviMobileAPI extension 4.0.

I followed the advice in this post Does CiviMobileAPI generate any logs? and install the CiviCRM WP REST API plug-in. I also renamed the extension directory name so it is just "com.agiliway.civimobileapi".

What else should I do?

# Answer
Do you have this one? https://github.com/mecachisenros/civicrm-wp-rest Or the old one? This is the updated one and you need this one to work. (also check the ext directory for civimobileapi make sure that it doesn't include master or anything else)
> 0 votes

# Answer
If you are using WP you have to install and enable:

All other plugins are not required. Also if you are using some “security” plugins for WP it may be a problem. Feel free to ask me any questions!
> 0 votes

---
Tags: wordpress, mobile, civimobile
---


title: CiviCase + CiviRules + Tokens

text:
# Question
Title: CiviCase + CiviRules + Tokens
I would like to trigger an email to a particular Role on a Case (not the Client) when a Case Status is changed. Is this possible? I've added the CiviCase Tokens Extension, and I can create a message template to be triggered (containing CiviCase tokens, such as the name of the client), but CiviRules doesn't appear to have the option to specify a different email on the Case.

I tried to use the token {case\_roles.*role*\_email} in the 'Use alternative email' option in CiviRules, but it doesn't see that as a valid email address.

Any other ideas I can try?

# Answer
> 1 votes
You can do this with CiviRules. The trigger is then Case is changed. At the condition you can select Field Value Comparison to check for the right case status.

At the action you select: Send E-mail to contacts on a case'

It might be that you need two condition with the field value comparison, one of the old case status and one for the new case status.

You need for this the CiviRules extension and the Email api extension.

# Answer
> 0 votes
On the change case status activity, there's a section called send a copy where you can select them. Or put the person in the assignee field. Both will cause them to be sent an email.

---
Tags: civicase, tokens, civirules
---


# Question
Title: If membership status is 'Cancelled' get 'Lifetime' error message when trying to renew
I have seen this a couple of times in the past and wonder if others have seen it specifically linked to the membership status of 'cancelled'.

When a member tries to renew a membership that has been cancelled they get the error message:'You already have a lifetime membership and cannot select a membership with a shorter term.' regardless of their initial membership type.

The work around is to manually amend the status of the membership to expired, but this is obviously not a good work flow and frustrating for both users and admin.

Also possibly related: Membership on behalf of multiple organizations error Some users get a lifetime membership message when they try to renew

# Answer
I wrote a patch for this bug some time ago - but I didn't find time to follow up and improve it the way my reviewers requested. If you feel comfortable applying this though, it will solve your problem for now.
> 1 votes

---
Tags: civimember, error, renewals
---


# Question
Title: Add Contact Suffix to Quicksearch Results
How can we have the Contact's Suffix (Jr, et) show up in the dropdown results of the Quicksearch input? It's helpful for us as we have contacts with the same name but different suffixes.

# Answer
> 2 votes
At Administer - Customize - Display Preferences, near the bottom there is "Individual Sort Name Format". If you change it to `{contact.last_name}{, contact.individual_suffix}{, }{contact.first_name}` then NEW and UPDATED contacts will start to appear in quicksearch as desired. The only thing is that existing contacts who haven't been re-saved will still appear the old way. If you only have a few then just go edit and re-save them.

---
Tags: quicksearch
---


title: Simple Donate error

text:
# Question
Title: Simple Donate error
I'm trying to use the Simple Donate extension on my website, and I keep getting an error that says "One of parameters (value: ) is not of the type Integer"

I've tried deleting, uninstalling & clearing cache several times, and still get the error.

PS I'm running Civi 5.20.2 on Wordpress

PPS I was FINALLY able to resolve this by removing the Price Set. I'm now running into an error of not being able to view the Live Page (Test works fine).

# Answer
(Copying the resolution from the question into an answer)

From the question author: "I was FINALLY able to resolve this by removing the Price Set."
> 1 votes

---
Tags: civicontribute, simple-donate-form
---


title: Find only renewed memberships

text:
# Question
Title: Find only renewed memberships
Is there a way in advanced search to only find members that have renewed their memberships? It seems obvious but I can't find how :-(

best regards Guillaume

# Answer
There is an Activity Type called Membership Renewal :-)

Not an obvious thing to search for but could do what you need
> 6 votes

---
Tags: advanced-search
---


# Question
Title: Permission to see Campaigns in Activity search criteria
When I (admin) go to Search \> Find Activities, the criteria includes a selector for Campaigns. Authenticated users, however, do not get that option. See the snippet below from such a user, in my criteria the Campaigns selector is right below the Location box. Likely means they're missing a permission (Drupal 7.69, Civi 5.21.0), but don't know which. There are a number of permissions associated w. CiviCampaign and I'd rather not open all of them because our use case is very narrow. Any guidance on which permission to grant, if that's what the issue is, appreciated.

# Answer
This is related to this bug 'CiviCampaign: access CiviCampaign' permission missing. Unfortunately at this time, in order to get Campaigns search showing in Search -\> Find Activities, you have to grant permission to `administer CiviCampaign`.

Depending on your user base (trust and size) and how bad you need this working now, you could give `administer CiviCampaign` and then change the menu permission for the Campaigns top nav menu item to `administer CiviCRM`. They would only be able to get to those menu links if they knew the URL directly (unlikely).
> 4 votes

---
Tags: activities
---


title: Is slicknav really obsolete?

text:
# Question
Title: Is slicknav really obsolete?
The slicknav mobile extension classes itself as Obsolete when we load it into our extensions. https://civicrm.org/extensions/slicknav-web-responsive-admin-menu.

Is this really true? And if so, is it known what it would take to make it current again?

Or is there some other way of having a mobile responsive menu with Civicrm?

We are also looking at the CiviMobile app, which is really really cool! In fact it may make a mobile menu quite obsolete, although there are some parts of Civi we'd like to access (such as pledges and projects) on a mobile device that CiviMobile can't.

We're with latest Drupal 7 and Civicrm 5.21

# Answer
Yes it was made obsolete when another menu system was brought in: https://github.com/civicrm/civicrm-core/pull/13582

You could try the shoreditch theme: https://civicrm.org/extensions/shoreditch
> 2 votes

---
Tags: menu, mobile
---


title: OSM Geocoding fails

text:
# Question
Title: OSM Geocoding fails
CiviCRM rookie, and having problems with the Geocoder.

I'm using Wordpress 5.3.2 multisite and CiviCRM 5.23 and I've installed the OpenStreetMap Geocoding extension 1.2.1

In Administer/System Settings/Mapping and Geocoding Providers I have Mapping provider set to OpenStreetMaps and OpenStreetMapCoding as the Geocoding Provider. No key (I think I'm right in assuming this isn't needed?).

I have Street Address Parsing set as on in Administer/Locationisation/Address Settings

In Administer/Systems Settings/Scheduled Jobs I have geocoding=1 set as the parameter in Geocode and Parse Addresses.

If I execute now, then the response I get in the log is:

```
    Finished execution of Geocode and Parse Addresses with result: Success (Addresses Evaluated:
    1 Addresses Geocoded: 0 Street Addresses Parsed: 0
    Following is the list of contacts whose address is not parsed: Contact ID: 1 xxxxx (...)

```

I'd wanted it to geocode the 100 contacts I had imported. It seems to have read the one organisation record I have and failed to geocode that.

If I add or edit an existing address in the contacts screen it does appear to geocode that.

Any ideas on what to do next?

# Answer
It's come up before that street address parsing only works for US addresses. Try just going with geocoding.
> 3 votes

---
Tags: wordpress, geocoding
---


title: How do I restore a deleted tag?

text:
# Question
Title: How do I restore a deleted tag?
In attempting to remove a tag from a contact, i succeeded in deleting the whole tag for everyone. Is there a simple way to restore it?

# Answer
> 2 votes
Unfortunately not. Hopefully you have a backup of your database, and ideally a test site? If you load the backup on your test site, you should be able to search for people with the tag, select **Export**, and export only the Contact ID. Import the Contact ID list to your live site, and on the last page of the import, select **Create a New Tag**. You can enter the tag's name there. The import won't do anything other than create the tag, since it's only contact IDs.

---
Tags: tags
---


title: Priming Summary Fields

text:
# Question
Title: Priming Summary Fields
I hope you can help. I am new to CiviCRM and writing a custom Summary Field.

I have written the new field and the trigger, but I am confused about how this will count all of the values for before today. Is there a place in the extension I need to include another query? Is there other magic I am missing?

Thanks, Penny

# Answer
> 2 votes
When you go to **Administer menu » Customize Data and Screens » Summary Fields**, the last option is *When should these changes be applied?*. Your summary fields will be primed at the time selected. If you want to look at the code, the function is sumfields\_gen\_data.

---
Tags: contacts, summaryfields
---


# Question
Title: Allow list subscribers to update their email addresses?
We have a list of people who work at many different companies with company email addresses. When someone moves to a new job at a new company their email address changes. How can we make it simple for someone who changes jobs to come to a CiviCRM Webform and change the email address we have for them? This would relieve our tiny staff of a major burden!

# Answer
Creating such a profile is fairly straightforward. The (potentially) hard part is for CiviCRM to know who the person is. You have three options:

* If your users can log into your site, then the site will know who they are.
* If you can trust your users to enter their data correctly, you can give them a blank form to fill out and configure your Unsupervised Dedupe Rule to identify the record that needs updating.
* You can create an email linking users to the profile using a URL with a checksum token. These can be a bit confusing to add to your emails for non-technical folk, in which case you may want to install the Fancy Tokens extension, which gives a nicer user experience.

As for the form itself, you can use a profile, or if you need something fancier you can use Webform with CiviCRM integration (if you use Drupal or Backdrop) or Caldera Forms CiviCRM (if WordPress).

If you haven't created a form like this before, and you aren't a documentation learner, you can find videos on YouTube covering CiviCRM profiles.

It often helps to include first and last name as read-only fields, it helps folks understand that the system knows who they are.
> 5 votes

---
Tags: civimail, mailing
---


# Question
Title: Is there a way to schedule mails depending on whether or not a contact has opened a previous email?
We are planning to take a lead capture action where we want to take two automated actions by email:

(1) Send an email the day after the contact is created in the CRM. This is possible through the Schedule Reminders tool.

(2) Send an email one week after the contact is created in the CRM only for those contacts who have not opened the first mail.

Is there any mechanism or functionality that will allow this second action to be performed?

# Answer
I've investigated this before. The answer is "no, not without an extension", but we decided that email open rates were never reliable (because most email clients don't download the images by default). It can give you an aggregate sense of engagement but isn't accurate down to the individual level.
> 3 votes

---
Tags: scheduled-reminders
---


# Question
Title: Event registration: adding guest names later
The use case is that we need to allow people to buy tables of ten at a lunch event, but not have to submit the guest names until much closer to the event. I can get some of the way by having a price set with an option to increment the participant count by 10. But I can't then see how to input the 9 actual guest names at a later date, and keeping the total participant count at 10, and the contribution amount unchanged. Does anyone know of a solution?

# Answer
We're in the process of building an extension to do exactly this, will share it when complete (it relies on some drupal specific functions at the moment but could probably be made CMS agnostic without too much effort).
> 1 votes

---
Tags: civievent
---


# Question
Title: Sending organisation custom tokens to individual
I want to use CiviMail to bulk mail key individual contacts from member organisations and want to include tokens in their email to remind them of the information we currently hold on their organisation, namely, the name and email address of the key contact and the invoice contact, and also some custom fields saved against their organisation. I've created draft text with the following tokens but when I send a test email, the tokens are just showing as blank. I suspect it's because the email is sent to individuals but the tokens relate to their organisational information rather than their personal information. Any thoughts would be appreciated. We're using Wordpress.

Main contact is: {relationships.first\_name\_15\_b\_a} {relationships.last\_name\_15\_b\_a}

Email: {relationships.email\_15\_b\_a}

Invoice contact is: {relationships.first\_name\_16\_b\_a} {relationships.last\_name\_16\_b\_a}

Email: {relationships.email\_16\_b\_a}

Number of homes = {contact.custom\_2}

Number of tenants = {contact.custom\_3}

Number of staff = {contact.custom\_4}

# Answer
> 3 votes
You should be able to do this with the reltoken extension.

# Answer
> 1 votes
Welcome to StackExchange Helen!

I am not aware of any core function that can do what you want. With a little bit of coding or manual work (import/export) you could try an approach like this:

1. Create custom fields for the individuals that can hold organisation information
2. Create a skript or use an extension like SQL-Tasks or CiviRules that copies all relevant organisation information to the individual's custom fields in regular intervals or on demand. That however most likely requires coding and/or SQL-knowledge.
3. Use the tokens for the individual custom fields when sending out the email.

If you cannot / do not want to code or use the extensions mentioned you could try and export the organisation information and re-import it into the custom fields.

Make sure to test properly whichever approach you take :)

---
Tags: wordpress, civimail, custom-fields, relationships, tokens
---


# Question
Title: unable to upload image file when creating a message
This question was asked before, and marked answered at: Unable to upload or view files through the CKEditor

but the adjustment recommended did not solve the problem for me.

After upgrading to CiviCRM 5.22.1, I am no longer able to upload image files when working on defining a mailing. With previous versions of CiviCRM I could Upload an image using the dialog box Upload Tab that appears when clicking the image icon.

On the 1. Define Mailing tab on ,,, /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F#/mailing/151 clicking the image icon opens a dialog box titled: Image Properties It has 4 tabs: | Image Info | Link | Upload | Advanced

Selecting the Upload Tab shows Choose File:

I can enter an image file to import. But when I click the button "Send it to the Server"

I get a JavaScript popup alert that says: "incorrect server response"

Any suggestions?

# Answer
> 1 votes
This isn't fixing the root issue, but I tend to think the best practice here is to load media within the Wordpress Media Gallery and link to it in CiviMail. Content is best put in the CMS. That way, you can use the media for say a blog post and for CiviMail. It's more efficient.

I think some day being able for Civi to query the WP media gallery would be most desirable.

---
Tags: wordpress, mailing, images, upload
---


# Question
Title: Is is possible to save blocks from one mailing to reuse in another mailing using CiviCRM Mosaico?
I have two different newsletters – a monthly one to our full mailing list and a weekly one every other week to a smaller group. They use different templates so I cannot simply reuse a weekly issue as a monthly issue or vice versa, but I often need to repeat selected blocks (Mosaico) of content in both. At the moment, I am laboriously copying each element (title, text, button text, button link, image) from one mailing to the next, but this is really time-consuming. Is there a way to copy a block from one mailing into another mailing, eg by copy and paste or saving to a library?

# Answer
One way that I am aware of is to click into a block in one mailing and then select the "Source" button

That will bring up the HTML source code dialog window

You could copy this, and then paste it into a block on the other mailing and assuming there are no fundamental differences in the template's stylesheet, it should look the same.
> 2 votes

---
Tags: mailing, mosaico
---


title: Mosaico image upload and gallery error

text:
# Question
Title: Mosaico image upload and gallery error
When trying to upload an image to the Mosaico editor I get an internal server error and the image doesn't appear in the template nor in the gallery.

However, when I check the upload folder the image has actually been uploaded. Also, when I compose a traditional mail I can see the images in the KC Finder. Imagick is present on my server.

Any idea how to fix this?

# Answer
I have the exact same problem & eventually just gave up on it. It must have to do with file permissions and the settings configuration, but I couldn't get anything to work.

Out of curiosity, who's hosting your site?
> 0 votes

---
Tags: wordpress, email, mosaico, imagick
---


# Question
Title: Is there any way to add "Relationship Type" to a membership type that already has members?
We've decided that the way we initially setup civimemberships for our organization does not meet our needs. We need to extend membership to employees of member organizations so that employees will receive email communications sent to member organizations.

CiviCRM does not allow this setting to be changed through the UI. It is something I can change through the database?

# Answer
Yes, you would have to change the civicrm\_membership\_type table, in columns relationship\_type\_id and relationship\_direction. Be careful though as these are multi-valued field, so if you inherit the membership based on multiple relationship types you will need to store CONCAT\_WS(X'01', {type\_1}, {type\_2});
> 2 votes

# Answer
It's a long time since this question was asked but there is now an extension to help with this: https://lab.civicrm.org/extensions/membershiprelationshiptypeeditor
> 0 votes

---
Tags: civimember
---


# Question
Title: Searching by 'Contribution Source' gives no results CiviCRM 5.21.1
I currently cannot search using the 'Contribution Source' field within advanced search. I can however use the field successfully within the 'Find contributions' search.

Is this a bug?

# Answer
> 3 votes
It seems to work ok on https://dmaster.demo.civicrm.org and 5.23. I know there were a lot of search form changes around 5.21/5.22. If you're able to upgrade it seems to be working.

---
Tags: contributions
---


# Question
Title: PayPal Pro Button not working - returns to blank event form
We use PayPal Pro for our event pages. This is what is currently happening: Person fills in the event registration profile. Person clicks PayPal checkout button, enters their PayPal information. When the person clicks Continue, they are returned to our registration form. All of the profile information they had entered is gone. If they reenter all the info and click continue, they get an error message saying they didn't fill in the credit card information.

If people enter their credit card information on our registration form (instead of using the PayPal check out button), everything works.

How do we fix the PayPal button? Or can we remove it?

We are using CiviCRM 5.12.0 with WordPress and PayPal Pro.

# Answer
I encountered this bug myself last week and fixed it; I forgot about this post until @herb posted a comment on it.

The fix will be in CiviCRM 5.25+, but the bug is logged as https://lab.civicrm.org/dev/financial/issues/119, and the fix is incredibly simple to apply.
> 2 votes

# Answer
Removing the button is against the PayPal TOU...but I have an extension that does it anyway. Install Hide PayPal Express Checkout and call it a day.

Actually...I wrote this a LONG time ago for a client that doesn't use event pages. It should work on contribution pages but might need some tweaking for event pages.
> 1 votes

---
Tags: wordpress, civievent, paypal
---


# Question
Title: DB error on listing mailing recipients. Did anybody see that before?
When listing recipients of CiviMail either via advanced search or mailing report¹ I get a wrong row count query. See the where-clause in

```
SELECT count(DISTINCT contact_a.id) as rowCount  FROM civicrm_contact contact_a
LEFT JOIN civicrm_mailing_recipients ON civicrm_mailing_recipients.contact_id = contact_a.id
LEFT JOIN civicrm_mailing ON civicrm_mailing.id = civicrm_mailing_recipients.mailing_id
WHERE  (  AND civicrm_mailing.id IN (2198) )  AND (contact_a.is_deleted = 0)

```

This is generated by `CRM\Contact\Bao\Query.php`.

Before I dig down into all the query generating code: Did anybody of you civi gurus out there see this before?

Relevant stacktrace is:

```
#10 /civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("SELECT count(DISTINCT contact_a.id) as rowCount  FROM civicrm_contact contact...")
#11 /civicrm/CRM/Core/DAO.php(420): DB_DataObject->query("SELECT count(DISTINCT contact_a.id) as rowCount  FROM civicrm_contact contact...")
#12 /civicrm/CRM/Core/DAO.php(1496): CRM_Core_DAO->query("SELECT count(DISTINCT contact_a.id) as rowCount  FROM civicrm_contact contact...", TRUE)
#13 /civicrm/CRM/Contact/BAO/Query.php(4977): CRM_Core_DAO::singleValueQuery("SELECT count(DISTINCT contact_a.id) as rowCount  FROM civicrm_contact contact...")
#14 /civicrm/CRM/Contact/Selector.php(525): CRM_Contact_BAO_Query->searchQuery(0, 0, NULL, TRUE)
#15 /civicrm/CRM/Core/Selector/Controller.php(218): CRM_Contact_Selector->getTotalCount(4, NULL)

```

¹) URI on error is `/civicrm/contact/search/advanced?force=1&mailing_id=<MAILING_ID>`

# Answer
> 1 votes
The issue you getting has been now fixed and will be part of 5.23 release. You can either wait for 5.23 release and upgrade CiviCRM or apply patch from here.

HTH

Pradeep

---
Tags: core
---


# Question
Title: Search ajax script "not a valid JavaScript MIME type"
When a WordPress page editor plugin is activated (WP Bakery) I get the console errors on a page using the shortcode `[civicrm component="profile" gid="14" mode="create" hijack="0"]`.

> The script from “https://example.org/civicrm/?page=CiviCRM&q=civicrm/ajax/l10n-js/en\_US&cid=13243&r=nPFxX” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.
>
> SyntaxError: expected expression, got '\<' on line one of the dcocument

The page uses the Classic editor, not WPBakery. I've tried various plugins to disable the WP Bakery plugin on that one page, with no luck.

Disabling WP Bakery for the whole site allows the shortcodes to work; but it can't be deactivated due to client usage. I'm also trying to work with WP Bakery support.

As a result of the errors, no CiviCRM search results are returned.

Any ideas?

No errors in any WP or CiviCRM error logs.

Going directly to the URL of the Javascipt doesn't load the script, but loads the entire page.

Is it possible to enqueue the CiviCRM script in the footer or change its load order to help troubleshoot?

# Answer
> 1 votes
The problem was WP Bakery and how it hijacks the page; getting rid of WP Bakery for a simpler page editor was the solution.

---
Tags: wordpress
---


# Question
Title: How to set a contribution to another membership for the same member
Is there a way to set a contribution to another membership for the same member? He has 2 contributions and 1 active Membership without any contribution and 1 expired membership with 2 contributions including the renewed contribution?

Can I correct this?

Regards,

Guillaume

# Answer
> 2 votes
You can use the Membership Payment extension for this.

This extension adds a new *Membership* field when editing a contribution. You can use this to add, remove and move a contribution's association with a membership of that same contact.

See screenshot below:

---
Tags: civimember
---


# Question
Title: how to drop all civicrm tables using drush?
Civi is using it's own (not shared with Drupal) database. During a script to rebuild a dev/test site from production data I want to drop all the tables in the civi dev db. How do I do that?

After painstakingly trying `civitables=$(drush civicrm-sql-query "show tables" | tr '\n' ',' | sed 's/,$//') && drush civicrm-sql-query "drop table $civitables"` I realized I could more simply do `drush civicrm-sql-query "drop table like 'civi%'"` but both of these are giving me "Query failed" error. Why would these queries fail or what could I inspect to see why the failed? How can all the tables be dropped using `drush`?

\*edits...

The `drop table like...` is apparently invalid sql sytax. Doh.

And the `civitables=$(drush civicrm-sql-query "show tables" | tr '\n' ',' | sed 's/,$//') && drush civicrm-sql-query "drop table $civitables"` appears to fail due to `Cannot delete or update a parent row: a foreign key constraint fails` which apparently needs `SET FOREIGN_KEY_CHECKS=0;` in order to work but when I do that the query passes (doesn't produce error) but fails to delete any tables.

# Answer
> 1 votes
There's a file in the \[civicrm root\]/sql folder called civicrm\_drop.mysql. You should be able to use that as `source sql/civicrm_drop.mysql`. It doesn't drop views or the canary table, but you can do that separately.

# Answer
> 1 votes
I haven't seen anything as clean as `drush sql-drop` (for drupal) yet, but the following works and is more thorough than the `civicrm/sql/civicrm_drop.mysql` file:

```
#!/bin/bash
# include this in devize.sh or whatever script is being used to rebuild your dev/test site

echo "SET FOREIGN_KEY_CHECKS=0;" > drop-tables.sql
drush civicrm-sql-query "show tables" | sed -E 's/(.*)/DROP TABLE IF EXISTS `\1`;/g' >> drop-tables.sql
echo "SET FOREIGN_KEY_CHECKS=1;" >> drop-tables.sql
drush civicrm-sql-query "source drop-tables.sql"
sed -i 's/TABLE/VIEW/g' drop-tables.sql
drush civicrm-sql-query "source drop-tables.sql"
rm drop-tables.sql

# then you'd go and do something like:
# drush cvsqlc < production_db.sql
# but that's not exactly relevant to this question

```

---
Tags: mysql, drush, cli
---


# Question
Title: after upgrade civicrm dashboard missing 5.23.1 drupal
I have just upgraded to 5.23.1 from 5.15.2 (Drupal 7.69) The upgrade screen was a bit "mumbled" but I assumed it worked ok. When I went back in to Civicrm I first get a message:

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

When I return to home page and click on my record I can see it in Civicrm but there are no menus and I cannot see anyone else or anything else.

# Answer
> 1 votes
1. Do you have multi-lingual enabled? than try to rebuild the views to see if it resolves your problem

Missing column 'frontend\_title' in ''civicrm\_uf\_field\_de\_DE" after upgrading to 5.1.2

2. Do you have DB logging enabled? than disabled and enable back again.
3. Else can you check the CiviCRM log/watchdog to get more details of DB error?

---
Tags: drupal, upgrade, civicrm-home
---


# Question
Title: All Contribution pages result in "Your browser session has expired" "Could not find a valid session key"
Currently on: Wordpress 4.7.2 CiviCRM 4.7.16

As I am making changes here and there on this clean Civi install with a migrated database, I noticed when submitting all contribution pages result in,

> "Your browser session has expired and we are unable to complete your form submission. We have returned you to the initial step so you can complete and resubmit the form. If you experience continued difficulties, please contact us for assistance."

I believe the follow section of the civicrm log is relevant,

```
[info] $Fatal Error Details = Array
(
    [message] => We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.<br /><br />Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.<br /><br />Error type: Could not find a valid session key.
    [code] =>
)
[info] $backTrace = #0 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(373): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(833): CRM_Core_Error::fatal("We can't load the requested web page. This page requires cookies to be enable...")
#2 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(828): CRM_Core_Controller->invalidKeyCommon()
#3 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(312): CRM_Core_Controller->invalidKey()
#4 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(204): CRM_Core_Controller->key("CRM_Contribute_Form_ContributionPage_Settings", TRUE, FALSE)
#5 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller/Simple.php(66): CRM_Core_Controller->__construct("Title and Settings", TRUE, NULL, "CRM_Contribute_Form_ContributionPage_Settings", FALSE, FALSE)
#6 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(84): CRM_Core_Controller_Simple->__construct("CRM_Contribute_Form_ContributionPage_Settings", "Title and Settings", NULL, FALSE, FALSE, FALSE, FALSE)
#7 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Contribute_Form_ContributionPage_Settings", "Title and Settings", NULL)
#8 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#9 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#10 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:4))
#11 [internal function](): CiviCRM_For_WordPress->invoke("")
#12 /home/yoursbaa/public_html/tbe/wp-includes/class-wp-hook.php(298): call_user_func_array((Array:2), (Array:1))
#13 /home/yoursbaa/public_html/tbe/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters("", (Array:1))
#14 /home/yoursbaa/public_html/tbe/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#15 /home/yoursbaa/public_html/tbe/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
#16 {main}

```

I have tried clearing the browser's cookies, using a different browser, and a different WordPress account. No luck.

One old forum post mentioned changes in URLs when loading the next page. I don't know how to test. I can tell you the URLS are the same when the pages load, and the URLs in Civi settings and Wordpress are the same absolute URL.

I checked all URLs in

* WP's Settings - General
* Civi's Settings - Resource URLs
* Civi's civicrm.settings.php

They all match: `https://yourshulbythesea.org/tbe/`

I've had issues with SSL when installing Civi, so I tried submiting a form with disabled HTTPS (no luck):

* Turned off Civi's force HTTPS
* Disabled WordPress Force HTTPS plugin
* Edited the WP URL settings to be standard HTTP.

Note that this is a migrated site. The original 'staging' one doesn't have this issue. **The change in URL was from `subdomain.website.com/` to `website.com/subfolder/`**

I've run some search/replaces on the changes. A double check since this issue gives no results for the former URL. Is it possible a Civi setting didn't add the new subfolder to URLs?

Maybe something isn't properly configured for the change in URL? How can I troubleshoot this further? Thanks.

*Edited to add more details.*

*Edit: I've made a second migration of the WordPress site to the root folder.* **The error is now gone, which makes me speculate that the error has to do with the CiviCRM database retaining the original URL without a subfolder or subdomain** (despite CiviCRM's directory settings saying the correct path). If true, this may be two things: \- My initial migration/SQL replace efforts made a mistake and edited a URL improperly. \- CiviCRM has made editing URLs for certain tasks like contributions not accessible through the directory settings/migration.

I believe it's the former. I likely made an error myself, as opposed to CiviCRM never having a reported instance of migration over subdomain/subfolder breaking contributions.

# Answer
Are you by any chance using a caching plugin or extension? We had this error on event registrations and had to exclude the event pages from being cached. That resolved the issue.
> 3 votes

---
Tags: wordpress, contributions, contribution-page, migration
---


# Question
Title: Log Entry View and other settings pages don't load (5.18.4, Drupal 7.67)
recently I am unable to load Log Entry Views and other settings pages in my Drupal CiviCRM. On the page it shows the following errors:

Warning: include(/var/www/html/sites/default/files/civicrm/templates\_c/de\_DE//%%48/488/4880C3C4%%LogViewEntry.tpl.php): failed to open stream: No such file or directory in include() (Zeile 1911 von /var/www/html/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php).

Warning: include(): Failed opening '/var/www/html/sites/default/files/civicrm/templates\_c/de\_DE//%%48/488/4880C3C4%%LogViewEntry.tpl.php' for inclusion (include\_path='/var/www/html/sites/default/files/civicrm/ext/uk.artfulrobot.civicrm.importhelper/:/var/www/html/sites/default/files/civicrm/ext/ca.bidon.civiexportexcel/:/var/www/html/sites/default/files/civicrm/ext/ca.civicrm.logviewer/:/var/www/html/sites/default/files/civicrm/ext/com.agiliway.civimobileapi/:.:/var/www/html/sites/all/modules/civicrm:/var/www/html/sites/all/modules/civicrm/packages:.:/var/www/html/sites/all/modules/civicrm:/var/www/html/sites/all/modules/civicrm/packages:/var/www/html/sites/all/modules/civicrm/vendor/tecnickcom:/var/www/html/sites/all/modules/civicrm/vendor/phpseclib/phpseclib/phpseclib:/var/www/html/sites/all/modules/civicrm/vendor/pear/pear\_exception:/var/www/html/sites/all/modules/civicrm/vendor/pear/auth\_sasl:/var/www/html/sites/all/modules/civicrm/vendor/pear/log:/var/www/html/sites/all/modules/civicrm/vendor/pear/console\_getopt:/var/www/html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src:/var/www/html/sites/all/modules/civicrm/vendor/pear/mail:/var/www/html/sites/all/modules/civicrm/vendor/pear/net\_socket:/var/www/html/sites/all/modules/civicrm/vendor/pear/net\_smtp:/var/www/html/sites/all/modules/civicrm/vendor/pear/validate\_finance\_creditcard:.:/usr/share/php') in include() (Zeile 1911 von /var/www/html/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php).

The last major change to my CRM was adding the civicrm.importhelper extension.

# Answer
> 0 votes
Welcome to Stack Exchange! I'm tempted to mark this question as a duplicate to point you to existing answers - but I'm struggling to find the "one true answer". templates\_c cache files not being deleted is close. Essentially, it sounds like something created a file in `templates_c` that's not readable by the web server user. The quick solution is to delete the `templates_c` folder - this is always safe and it will regenerate. However, in the longer term you need to find what caused the problem. Are you running cron as a user other than the web server/PHP user? Are you running `drush` from the command line as a user with different permissions? If you don't find the solution the problem will keep coming back.

---
Tags: drupal, logs
---


title: Restore a deleted mailing?

text:
# Question
Title: Restore a deleted mailing?
Is there any way to restore a mailing after you delete it? Or even find it?

We are using CiviCRM 5.8.12 with WordPress. We use Mosaico for some mailings.

# Answer
Two answers:

Do you have detailed logging eanabled? If no, then no - you can restore a backup of your database (to a test site) and copy the data out.

If you have advanced logging enabled: you can use SQL. You need to know the ID of the deleted mailing - you can check the titles with `SELECT DISTINCT id, name FROM log_civicrm_mailing`.

Once you find the ID number, substitute the `X` at the end of this query for the ID.

```
INSERT INTO civicrm_mailing (id, domain_id, header_id, footer_id, reply_id, unsubscribe_id, resubscribe_id, optout_id, name, mailing_type, from_name, from_email, replyto_email, subject, body_text, body_html, url_tracking, forward_replies, auto_responder, open_tracking, is_completed, msg_template_id, override_verp, created_id, created_date, scheduled_id, scheduled_date, approver_id, approval_date, approval_status_id, approval_note, is_archived, visibility, campaign_id, dedupe_email, sms_provider_id, hash, location_type_id, email_selection_method, language, template_type, template_options, modified_date) SELECT id, domain_id, header_id, footer_id, reply_id, unsubscribe_id, resubscribe_id, optout_id, name, mailing_type, from_name, from_email, replyto_email, subject, body_text, body_html, url_tracking, forward_replies, auto_responder, open_tracking, is_completed, msg_template_id, override_verp, created_id, created_date, scheduled_id, scheduled_date, approver_id, approval_date, approval_status_id, approval_note, is_archived, visibility, campaign_id, dedupe_email, sms_provider_id, hash, location_type_id, email_selection_method, language, template_type, template_options, modified_date
FROM log_civicrm_mailing WHERE log_action = 'Delete' AND id = X;

```
> 2 votes

---
Tags: civimail, deleted
---


# Question
Title: Strange error when updating 5.23.0 Joomla
When i try to update my Joomla version (Windows) to 5.23.0 I get the screen to run the database upgrade utility after the question are you ready to upgrade (Yes) I get the screen with the progress-bar left at the screen but it does nothing. When I look at the console of the screen I see warnings as: Laden voor het met bron ‘http://localhost/Joomla/Joomla/administrator/components/com\_civicrm/civicrm/bower\_components/jquery/dist/jquery.min.js’ is mislukt. (and 14 others). The URL must be with only once "/Joomla". I didn't change or save the civicrm.settings.php. But there is no double /Joomla. What is the reason that the URL is wrong? I have tried version 5.23.1 with the same result.

# Answer
> 2 votes
I have updated the lines 824 en 825 in CRM/CORE/Resources.php with a dirty solution:

$map = \['bower\_components' =\> str\_replace('Joomla/Joomla','Joomla',rtrim(Civi::paths()-\>getUrl('\[civicrm.bower\]/.', 'absolute'), '/')), 'packages' =\> str\_replace('Joomla/Joomla','Joomla',rtrim(Civi::paths()-\>getUrl('\[civicrm.packages\]/.', 'absolute'), '/')), \];

It can not be the real solution but the site is now working and i have just completed succesful the database-upgrade. Maybe only a problem with sites on Windows.

---
Tags: upgrade
---


# Question
Title: Using hook_civicrm_tabset; why doesn't my tab focus when linked to via url?
I've added a tab adjacent to the event "Info and Settings" configuration tab, using hook\_civicrm\_tabset(), but when I link to the URL for that tab, the "Info and Settings" tab is displayed. This behavior is different from that of native tabs, such as "Location": I can type in the URL for that tab, and the tab is correctly selected.

**Question:** How can I get my "My Settings" tab to display itself from a URL in a way that's equivalent to the behavior of native tabs such as Location?

---

Here are some examples of native URLs that work as expected, and my custom tab which does not.

**"Info and Settings" tab**
http://example.l/civicrm/event/manage/settings?reset=1&action=update&id=23

---

**"Location" tab**
http://example.l/civicrm/event/manage/location?reset=1&action=update&id=23

---

**"My Settings" tab**
http://example.l/civicrm/event/manage/mysettings?reset=1&action=update&id=23

---

Example code (slightly redacted for public viewing)

```
/**
 * Implements hook_civicrm_tabset().
 *
 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tabset/
 */
function myextension_civicrm_tabset($tabsetName, &$tabs, $context) {
  if ($tabsetName == 'civicrm/event/manage') {
    if ($eventId = CRM_Utils_Array::value('event_id', $context)) {
      $tab['mysettings'] = array(
        'title' => E::ts('My Settings'),
        'link' => NULL, // 'link' is automatically provided if we're under the 'civicrm/event/manage' path.
        'class' => 'ajaxForm', // allows form to re-load itself on save.
        'valid' => _myextension_EventHasMySettings($eventId), // indicates whether tab has actively used settings.
        'active' => TRUE,
        'current' => FALSE, // setting this to FALSE prevents the tab from pre-loading
                            // focus when the page is loaded.
      );
    }
    else {
      $tab['mysettings'] = array(
        'title' => E::ts('My Settings'),
        'url' => 'civicrm/event/manage/mysettings',
        'field' => 'is_my_settings',
      );
    }
    //Insert this tab into position 1
    $tabs = array_merge(
      array_slice($tabs, 0, 1),
      $tab,
      array_slice($tabs, 1)
    );
  }

  // Set mysettings tab as enabled/disabled in configuration popup-menu, on manage events listing screen.
  if ($tabsetName == 'civicrm/event/manage/rows' && $eventId = CRM_Utils_Array::value('event_id', $context)) {
    $tabs[$eventId]['is_my_settings'] = _myextension_EventHasMySettings($eventId);
  }
}

```

# Answer
> 2 votes
You will need to add below line in your preprocess() function.

```
$this->assign('selectedChild', 'mysettings');

```

---
Tags: extension, hooks
---


# Question
Title: Is there an extension to limit activity types to contact types?
We have a custom activity type that should only be added to contacts of a specific contact subtype (ie activity targets must be of given contact subtype)

Is there an extension to enforce this?

# Answer
You might be interested in this:

CiviCRM: Hide Activity Types (com.joinery.hideactivitytypes)

> Hide activity types in one or more ways:
>
> * Remove the activity type from the "Actions" list on the Activity Summary.
> * On a per-contact-type basis: activity type will be removed from the "New Activity" list under a contact's Activities tab, based on the contact's Type or Sub-Type.

Note, however, it only does what's stated above. It won't prevent creating activities in some other way, e.g., via api, or the New Activiy form. (But if features for more aggressive limitation are desired, I think it would be a good fit to add them.)
> 3 votes

# Answer
Not that I am aware of Aidan, but sounds like something that could be very useful!
> 0 votes

---
Tags: extension, activity
---


title: The requested Profile is disabled

text:
# Question
Title: The requested Profile is disabled
Using 5.17.5 on Wordpress, I've got the dreaded error on a member search form: *"The requested Profile (gid=10) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile"*

The search form works for admins, but not other users or members.

I'm using `[civicrm component="profile" gid="10" mode="search" hijack="0"]` on the search page.

In Admin\>Customize Data/Screens\>Profiles, the profile exists:

The profile is active:

These are the fields:

Is this a problem with an ACL? Search settings? How do I fix this?

# Answer
> 2 votes
Based on comments, it sounds like you have a permission issue. It's possible you have an ACL issue, but it's pretty unlikely; you would know if you set up ACLs.

* Go to **Administer menu » Users and Permissions » Permissions (Access Control)**.
* Click the **WordPress Access Control** link.
* Check the permissions: *CiviCRM: profile create* and *CiviCRM: profile view* and ensure they can be used by the role in question.

---
Tags: wordpress, profile, search
---


# Question
Title: CiviCRM Administration areas unreachable even by direct link
I am setting up and configuring a new CiviCRM/Drupal 7 installation for a local business and have installed the latest of both. I have inserted a very small amount of data and configured the event calendar (views only) Going through the settings for localisation etc. I encountered an error were CiviCRM warned that the attachment size could not be more than php size. I altered this to the correct value, clicked save and:

I cannot access any admin link, no CiviCRM menu and the direct links are also not doing anything. Normally okay at debugging these things but I'm at a loss. Can anyone help?

```
misc?reset=1:1 Refused to execute script from 'https://###/civicrm/ajax/l10n-js/en_US?cid=2&r=Tx80w' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Common.js?q73rge:1517 Error: CRM.url called before initialization
CRM.console @ Common.js?q73rge:1517
CRM.url @ crm.ajax.js?q73rge:19
initialize @ crm.menubar.js?q73rge:18
(anonymous) @ crm.menubar.js?q73rge:491
(anonymous) @ crm.menubar.js?q73rge:493

crm.ajax.js?q73rge:26 Uncaught TypeError: Cannot read property 'back' of undefined
    at Object.CRM.url (crm.ajax.js?q73rge:26)
    at Object.initialize (crm.menubar.js?q73rge:18)
    at crm.menubar.js?q73rge:491
    at crm.menubar.js?q73rge:493
CRM.url @ crm.ajax.js?q73rge:26
initialize @ crm.menubar.js?q73rge:18
(anonymous) @ crm.menubar.js?q73rge:491
(anonymous) @ crm.menubar.js?q73rge:493

misc?reset=1:1 Unchecked runtime.lastError: The message port closed before a response was received.

```

# Answer
Feel like an idiot now:

Used an old trick by visiting /civicrm/menu/rebuild?reset=1

Appears fixed. No browser errors!
> 3 votes

---
Tags: administer
---


# Question
Title: How can I search for or report on contacts based on date, method and/or status of group subscription?
With GDPR coming down the track I'm keen to dig in to my contact lists in more detail. I'm looking the ability, ideally through the UI, of reporting on, and searching for, contacts based on the date they subscribed to a given group, the method by which they were added to the group, and the status of their group membership.

# Answer
> 1 votes
Currently there is no reporting or search on group subscription history. But I do think the gdpr extension (https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr) has a custom search which allows you to search the group subscription history.

# Answer
> 1 votes
Exists a subscription history extension https://github.com/MegaphoneJon/org.cpehn.subscriptionhistory which may fit your needs.

---
Tags: civireport, groups
---


# Question
Title: CiviCRM Dashboard and Menus disappear after upgrade and GoCardless extension disabling
I was running CiviCRM 5.16 on top of Drupal 7.69, atop Debian 9. I tried installing the GoCardless extension (after discussion at CiviCamp Birmingham) using the built-in extensions manager and couldn't quite get it to work. I figured it might be because my CiviCRM was a bit too old, so I tried removing it and upgrading Civi to 5.23.1, then reinstalling the extension.

Somewhere in this upgrade process, I've got to the point where the CiviCRM menu bar and dashboard no longer appear on my site. Everything seems to work if I can remember the URLs, but this is obviously very frustrating. Any idea where to look? I'm not getting any browser errors, and the last thing in `ConfigAndLog/CiviCRM.*.log` is the database upgrade to 5.23.1

# Answer
This is because your cms.root doesn't match properly with civicrm.root variable and you might be using variables in Resource url for 'CiviCRM Resource URL'.

You need to make sure paths are correct in your system

1. Check the Document root path in your apache or nginx config of site.
2. It should match exactly with the path of $civicrm\_root and template\_c path in settings.php

For some cases you add below two line at the end of the file you will need to change

```
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . 'sites/all/modules/civicrm/';
$civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . 'sites/all/modules/civicrm/';

```
> 1 votes

---
Tags: upgrade, menu, gocardless
---


# Question
Title: How to change contribution pages profile labels into a placeholder?
I would like to convert all the form fields labels of the contribution pages and events pages into placeholder. Is it possible to do? If yes, how please ? Thanks

# Answer
You write a small jQuery script and include it on your forms

```
<script type="text/javascript">
CRM.$(function($) {
  let label, labelDiv, value;
  $('input').each(function() {
    value = $(this).val();
    labelDiv = $(this).closest('.crm-section').find('.label');
    $(labelDiv).hide();
    label = $(labelDiv).text();
    label = label.replace(/\s\s+/g, ' ');
    $(this).attr("placeholder", label);
  });
});
</script>

```

There are various ways to include jquery in your forms

1. Implement hook(buildform or preprocess or pagerun) via extension/plugin/module to add js using add resource method
2. Override tpl file using extra.tpl method to include jquery
> 2 votes

---
Tags: contribution-page, forms
---


# Question
Title: Can we be notified when civi recieves an SMS?
I would like to know if there is a way users can be notified when a client replies to a text that has come from Civi. Our system is currently receiving SMS that have been sent to civi, but the only way of knowing they have been received is to look at each individuals activity list. I wondered if a notification to a user could be set up through Civi Rules? Has anyone been successful in setting this up? Thanks in advance.

# Answer
Lisa, Welcome to CiviCRM SE. Since Civi stores response as a activity, you can create schedule reminders to send sms/email for Activity type 'Inbound SMS' with 0 hrs after activity date time and limit to group of contacts. You can also use tokens like activity details, contact name etc in your message.

Using CiviRules extension you can send email/sms by using trigger 'Activity Added' with Filter 'Activity type' as 'Inbound SMS' and Action as Send SMS/Email. (You will need to Install CiviRules extension along with Email Api extension to send email or SMS api extension to send sms)

HTH

Pradeep
> 3 votes

---
Tags: civimail, contacts, civirules, sms, civisms
---


# Question
Title: How can I customize the default gear icon on a custom tab set?
Now that there are icons on all the tab sets (awesome, btw) - I'd like to change the standard gear icon that appears on any custom contact field sets that are set to display as a tab. I didn't see anywhere in the interface that I could select a fa icon to use.

I know the hook\_civicrm\_tabset can be used if you've added a tab as part of an extension, you can just include the `'icon' => 'crm-i fa-yourchoicehere'` line in your array. But I'm wondering how to apply that to an existing tab set.

# Answer
For folks looking for a no-coding solution to this, you can use the Contact Layout Editor extension to change icons. After installing the extension, go to **Administer menu » Customize Data and Screens » Contact Summary Layouts**. You can click on the icon on a tab (see screenshot below) and it will bring up a menu of FontAwesome icons to choose from.
> 3 votes

# Answer
I found there were two parts to this, first I needed to identify the current array that was setting the 'default' gear icon, then I needed to set a new one.

This page describes the basics of the tabset hook - so I started with that as a base: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_tabset/ I built the basic hook

Then I had to figure out which nested array held the information for my custom data and I was unable to perform the code that follows without the array number (not just the custom data number). In my case, it is an 'alerts' tab. This was tricky because the number can change depending on the contact, so I couldn't just ask it to look for the 15th array, because it could be a different number per contact. I used this post's logic to search the array for the id containing my custom data.

With the array number, I was able to reset the icon part of the array

```
function mymodule_civicrm_tabset($tabsetName, &$tabs, $context) {
  //check if the tabset is Contact Summary Page
  if ($tabsetName == 'civicrm/contact/view') {
    // get the number of the tabset, change custom_00 to the number of your custom data fieldset
    $alertstabnum = array_search('custom_00', array_column($tabs, 'id'));
    // change the icon from the default gear icon
    $tabs[$alertstabnum]['icon'] = 'crm-i fa-flag';
  }
}

```

If there's an 'easier' way or something already set up in the tabset hook, I'm all ears this is just what I found to work.
> 1 votes

---
Tags: custom-fields, hooks, contact-view
---


# Question
Title: Where is CiviPetition currently documented please?
My online searches for CiviPetition guidance have so far found only nine year old articles which lead to dead ends? Is petition functionality still supported in the latest version of CiviCRM? Can someone here please point me to online guidance for how to use it? Thanks. -- Hugh

# Answer
> 1 votes
There are some docs at docs.civicrm.org/user/en/latest/petition/what-is-civipetition and more pages if you look in the left sidebar there.

---
Tags: activities
---


# Question
Title: Error on [civicrm.root] as CiviCRM Resource URL
After upgrading to 5.23.0, I am getting the error that my resource URL is not correct. Everything seems to be okay though.

In the admin section, the Civicrm Resource URL is \[civicrm.root\]/

In civicrm.settings.php:

> $civicrm\_root = '/home/myuser/domains/mydomain/private\_html/sites/all/modules/civicrm';

# Answer
> 4 votes
Mistake by myself: there should be a slash at the end of the variable:

> $civicrm\_root = '/home/myuser/domains/mydomain/private\_html/sites/all/modules/civicrm/';

---
Tags: resource-urls
---


# Question
Title: How to access contact ID and checksum for a new contact from the Caldera form that creates the contact?
Using a Drupal webform I can create a new Civi contact, and get the contact ID and checksum for that contact from the form submission, enabling me to use it in an email triggered by the form submission. This lets me send a link to a second form, passing the contact id and checksum in the URL, to pre-populate the second form with details of the newly created contact.

I'd like to do the same thing using Caldera forms on Wordpress, but I'm struggling to see whether, and if yes, how, that might work. Can anyone cast any light?

# Answer
There's an example of how to do the second part of this in the integration module's README.

> Checksum support to auto-populate form with URLs like example.com/some-page?cid={contact.contact\_id}&{contact.checksum}

The part I'm not aware of is how to properly redirect from one form to a second form with the right contact ID and checksum. I don't have any Civi-on-WordPress instances to test with.
> 1 votes

---
Tags: wordpress, checksum, caldera-forms
---


title: Is a CiviVolunteer shortcode available?

text:
# Question
Title: Is a CiviVolunteer shortcode available?
All my WordPress pages have completely different headers (through a plugin). However, I need to get the `Search for Volunteer Opportunities` form in CiviVolunteer to appear on a WordPress page in order to change its header.

Is there a shortcode to do this? If this is not possible, how would I go about giving the form its own header?

# Answer
No, there is not a shortcode available, but I'm not sure either that it isn't trivial to enable one.

But, I suspect it is not necessary for what you are trying to acomplish.

Have you enabled clean URL's for your CiviCRM install?

https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/#enabling-cleaner-urls-for-wordpress

After you do that, the sign-up page should be displayed with your wordpress front-end theme: http://example.org/civicrm/vol/#/volunteer/opportunities

Be sure to note the permissions required: https://docs.civicrm.org/volunteer/en/latest/sign-up-form/

I think this would enable your custom plugin to display its headers.

Saludos!
> 1 votes

---
Tags: civivolunteer
---


# Question
Title: Case Activity does't respect 'Do not notify assignees for'?
When submitting activity from case, assignee contact still gets email even though the activity type is included in 'Do not notify assignees for' setting under Display Preference. However it obeys the setting when sent from Activity form. Is this intentional?

# Answer
> 4 votes
It's not intentional but it's come up before. See https://lab.civicrm.org/dev/core/issues/1582 and https://lab.civicrm.org/dev/core/issues/1649

UPDATE: @pradeep-nayak submitted a PR https://github.com/civicrm/civicrm-core/pull/16800 so it will restrict for case activities too in version 5.25.

---
Tags: civicase, activities
---


# Question
Title: Is anyone using Google Group Integration for CiviCRM?
We have tried implementing Google Group Integration for CiviCRM \- we got 90% there but ran into issues. We have some funds to get a fix - but we have not heard from the developer. Is anyone using this extension successfully?

# Answer
> 3 votes
I have a forked version of the primary repository where i have updated the code to support latest version of api. This is hasn't been tested since 2 years.

---
Tags: extension, groups, integration
---


title: Need to resend event confirmation email

text:
# Question
Title: Need to resend event confirmation email
We need to be able to resend individual event confirmation emails (e.g. corrections to the registration, sometimes not received etc.). Up till last year's event in August this was no problem. There was a check box on the participant record to allow you to resend upon saving the record. Since upgrading to our current version CiviCRM 5.22.0 this appears no longer an option. Has this been moved elsewhere? For our event (https://www.capelcarshow.com/show-registration/) it is a critical feature. We are really in problems without it. Any suggestions or help out there?

# Answer
> 5 votes
OK - I have now found the setting. The functionality has changed.

Go to 'view Event Participation' -\> click 'change selections' -\> now the checkbox is visible and an email can be generated.

Thanks

---
Tags: civievent, email, confirmation
---


title: How do you export a multi record set?

text:
# Question
Title: How do you export a multi record set?
On CiviContact we have a number of custom fields set up as multi-record sets. Any ideas on how these can be exported?

The import to a multi-record set is hidden on the main import page \> tooltips pop up has a link at the end of the help notes which takes you to the import page. Is the export function similarly hidden...

Any help appreciated.

# Answer
I don't know of any hidden export pages, but if you can talk the data into appearing in a report then you can export as CSV from there. We've created a few custom reports to allow this on our multi-record custom data.
> 6 votes

# Answer
There’s a custom search available called ‘Custom Group Multiple Values Listing’ that allows you to search and export multi value fields –

Search \> Custom Searches \> Custom Group Multiple Values Listing
> 3 votes

---
Tags: export
---


# Question
Title: Is there a method in ACL of allowing anonymous access to some events and not others?
I want some CiviCRM events to be Member-only and some to be public. But I'm not seeing a way of creating an ACL permission for the anonymous user and then assigning it to an event.

The only way of doing seems to be to revert to Drupal permissioning, which is global and not selective.

Is there a way around this? I'm thinking make all events available to everyone and put ACLs on profiles attached to events?

# Answer
The title of your question only makes a distinction for "anonymous" users; the question itself mentions "Member-only" vs "public".

If by "Member" you mean "current membership holders as defined in CiviMember", then the Member Only Event extension is probably a good choice.

If on the other hand you only mean "members of my site" a.k.a. "logged in users", then what you're describing is possible with ACLs. The following will default to "authenticated users only" for all events, with exceptions defined on a per-event basis using ACLs.

1. Configure Drupal (or other CMS) permissions to deny the "CiviEvent: register for events" permission for the Anonymous role, and grant this permission to the Authenticated role.
2. In CiviCRM, create an ACL that grants "Edit" permission to a single event for the "Everyone" role, as in this example:
3. Naturally you'll want to test that event and a normal "authenticated user only" event, both as an authenticated user and as an anonymous user, for your own peace of mind that it's configured correctly.

An important caveat here is that with ACLs you are introducing a separate mechanism for managing user permissions, which runs parallel with -- and sometimes overlaps with -- Drupal permissions. That's not a bad thing; it just means it's important to a) have a clear understanding of what you're enabling, b) test to ensure you've configured it correctly, and c) remember to check ACLs as well as Drupal permissions, if you ever find an issue later on where users have different access levels than you expected.
> 2 votes

# Answer
A more custom approach could involve adding a Custom Field to Events, that is used to differentiate if the Event is 'public' or not, and then build an extension that provides the ACL to determine whether anonymous should be able to see/register the event.
> 1 votes

---
Tags: civievent, acl
---


title: Page timeout on contact import

text:
# Question
Title: Page timeout on contact import
Drupal 7 CiviCRM 4.6.28 Hosted on: Pantheon

I have a client that needs to import 15,000-20,000 contacts on CiviCRM. The problem we are running into is that importing any amount over 500 is causing a page timeout error to be thrown; our host, Pantheon, puts a strict 60-second limit on how long a page can take to load. We have been working on getting the resource usage down, which has improved the import, but the error is still being thrown.

The import does continue, and finish the job, after the error is thrown. We need the error to stop being thrown, though, so that the client can be confident that the import has completed.

The current idea we have to fix this is to skip over the import progress bar popup, keep them on the Summary page, and use Ajax to track the import and communicate when it is finished.

I'm fairly new to CiviCRM, so am wondering, does that solution sound doable? Or, does anyone have an idea for another solution to this problem?

# Answer
That's a lot of contacts to import at once. Honestly, I try to keep it below 2,000 an import, especially if there is a lot of information. If you're only allowed a max of 60 seconds, it's likely there are other places where you will also run into errors regarding it timing out. Not only that, I've found that often times even when you think it did import everything, there was indeed information left out, errors with contacts, etc. Long term, your best solution will likely be a new host where you get more control over your resources. Looking at their site, it appears to be more of a shared hosting environment and I've found that I can rarely get a large CiviCRM site running well unless I'm either on a VPS with control over the resources or a dedicated server.
> 4 votes

# Answer
If you can access httpd.conf file, add TimeOut value - it dramatically changed the number of records we were able to import - 5x and perhaps more per upload.

The value should be set under Server Root section we set as a temporary value to: TimeOut 1200
> 0 votes

---
Tags: contacts, import, pantheon
---


# Question
Title: How do I update the text seen on a membership payment page when the autorenwal option is provided?
Running on Drupal 7.69 and Civi 5.18.x.

We would like to update the text that gets displayed when the auto-renewal option is active for membership types. Is there a way of doing using the admin interface or does it have to be done with code?

Image of current text is below:

# Answer
You could use the word replacement function to do so. It is described in the CiviCRM documentation here.

Sometimes a text is composed of more than one string which means that you would have to do more that one word replacement.
> 1 votes

---
Tags: civicontribute, recurring-contributions, auto-renew
---


# Question
Title: CiviCRM admin screens don't display icons/special chars
See screen snippet below. The question marks and other graphical items normally displayed throughout the CiviCRM UI are showing as squares with the unicode. This is a dev instance, copied (codebase and databases) from a production instance using the instructions here. The symbols show correctly in the production instance. What did I mess up?!?

CiviCRM 5.23.1 and Drupal 7.69.

# Answer
> 1 votes
Based on comments the problem was civicrm.settings.php still had old settings.

---
Tags: theme, ui
---


# Question
Title: Getting CiviCRM Security Upgrade Needed warning after upgrade to 5.23.3
Upgraded to 5.23.3 and now get warning that CiviCRM Security Upgrade Needed

The list of upgrades only shows

CiviCRM 5.9 has reached its end of life. Security updates are not provided anymore. Please upgrade to the latest stable release (5.23) or an extended security release (5.21).

Release history

5.10.0 was released on 2019-02-06. The latest patch revision is 5.10.4 (2019-02-22). 5.11.0 was released on 2019-03-06. 5.12.0 was released on 2019-04-04. The latest patch revision is 5.12.4 (2019-04-25). 5.13.0 was released on 2019-05-01. The latest patch revision is 5.13.8 (2019-12-04). 5.14.0 was released on 2019-06-05. The latest patch revision is 5.14.2 (2019-06-29). 5.15.0 was released on 2019-07-03. The latest patch revision is 5.15.2 (2019-07-31). 5.16.0 was released on 2019-08-07. The latest patch revision is 5.16.4 (2019-09-03). 5.17.0 was released on 2019-09-04. The latest patch revision is 5.17.5 (2019-09-26). 5.18.0 was released on 2019-10-04. The latest patch revision is 5.18.4 (2019-10-22). 5.19.0 was released on 2019-11-06. The latest patch revision is 5.19.4 (2019-12-04). 5.20.0 was released on 2019-12-04. The latest patch revision is 5.20.3 (2019-12-28). 5.21.0 was released on 2020-01-01. The latest patch revision is 5.21.2 (2020-01-23). 5.21.x is an Extended Security Release. 5.22.0 was released on 2020-02-05. The latest patch revision is 5.22.1 (2020-02-18). 5.23.0 was released on 2020-03-04. The latest patch revision is 5.23.2 (2020-03-13).

Any suggestions?

# Answer
> 2 votes
Try clearing CiviCRM cache, if you still get same issue than try doing whats mentioned in System Status reports incorrect version number after update stall post

---
Tags: upgrade
---


# Question
Title: Local (flywheel) wordpress install with CiviCRM
we are trying to

If I change language to french from the install page (I installed correctly the language files) I get immediatly this error.

```
Fatal error: Uncaught RuntimeException: Undefined constant: CIVICRM_TEMPLATE_COMPILEDIR in /Users/f/local/lib/app/public/wp-content/plugins/civicrm/civicrm/CRM/Utils/File.php on line 583
( ! ) RuntimeException: Undefined constant: CIVICRM_TEMPLATE_COMPILEDIR in /Users/f/local/lib/app/public/wp-content/plugins/civicrm/civicrm/CRM/Utils/File.php on line 583

```

So this makes it impossible to install in another language than english which is annoying. Any idea about this ?

If language is set to english, it almost works except for an error in some urls:

On a civicrm submenu, like for example administer -\> administration console -\> configuration checklist

if I click for example on the "Pages" wordpress menu, the url I end on is https://domaine.test/wp-admin/admin.php/edit.php?post\_type=page with a blank screen. This url should be https://domaine.test/wp-admin/edit.php?post\_type=page There is systematically this unnecessary "admin.php" in the url. We've tried on another computer with this same local version and we got the same incorrect behaviour. With another instance of civicrm (version 5.17) on this same particul local setup we don't have this error so we think that this is related to one of the following civicrm releases. Any idea about this ?

We also tried on the new local by flywheel (5.2.5 with php 7.3.5 and MySQL 5.7.28) Warning: this news version is a different application and connects differently than older Local to the database, using socket. With that setup we have the same error as above when we change the language on the install page. Then, if we install in english, it installs and generate the tables and the settings file in uploads/civivrm Nonetheless I systematically gets several "network error" alerts... and civicrm is not working. Any idea how to set civicrm with this new version of flywheel ?

# Answer
> 0 votes
I've posted a possible solution to the language part of the problem at https://lab.civicrm.org/dev/translation/issues/40#note\_33313. It works for me on drupal 7 and should work for wordpress too I think. Add this to install/index.php around line 141:

```
if (!defined('CIVICRM_L10N_BASEDIR') && file_exists($crmPath . DIRECTORY_SEPARATOR . 'l10n')) {
  define('CIVICRM_L10N_BASEDIR', $crmPath . DIRECTORY_SEPARATOR . 'l10n');
}

```

The other part of the problem is already fixed in the latest 5.23.

---
Tags: wordpress, installation, localisation
---


# Question
Title: Which mobile Apps or Extension work well for what scenario
(EDIT - I changed this from a question asking for an App for the 'general contact/member to a more generic one that hopefully gives good enough across the whole range of scenarios)

There are several questions about Apps that i have found eg \- CiviCRM on mobile phone \- What is the best approach for using CiviCRM as an app on mobile? \- CiviCRM on mobile phone

My sense at this early point of discovery is that most effort has been going in to Apps for the admin/organiser, rather than just for a general user/member who may want to \- view and update their profile and membership. \- see their relationships and click through to those relationships eg employer, region and club. \- search for and register for events through the app

Hence this question will hopefully flesh out what features each offers and what particular scenarios they may be best applied to.

# Answer
Here is an initial list - hoping we can collectively flesh this out so it is a useful reference document

CiviContact \- AgileWare

* Android and IOS

CiviMobile \- AgiliWay

* Android and IOS

SmartCivi \- ArtTech

* Android only

CiviMobile Extension \- WebAccess

NOTE: I will do my best to update this list with more info/summaries if folk post Comments or separate Answers
> 2 votes

---
Tags: mobile
---


# Question
Title: Membership for Group of people. One payer
I have a case where I need the ability for a user to fill out and submit a membership application for himself and other people.

Specific Requirements:

* Single transaction: The user pays for himself and everyone else, but everyone gets a membership
* The cost is not fixed: $75 dollars per person (ex: Group of 5 = $375, group of 2 = $150)
* Renewal reminders only sent to the originator.
* Everyone gets assigned to a group with a name assigned by the user

Is this possible to do with CiviCRM? I can't seem to find an online example or documentation on this specific use case.

Edit: I'm using Joomla! 3.9.16

# Answer
If you are using Drupal CMS than you can do this by using webform and webform civicrm module and probably CiviRules. You will need to create 2 membership type Member and Additional member. Setup webform to accept # of contacts with 1st contact as set to use Member membership type and rest of the contact set to Additional member membership.

Set up reminder for membership type member to send membership for primary member.

(Not sure if the same process can be done in wordpress caldera form plugin)
> 2 votes

# Answer
Suggest you read up about Inherited Memberships if you want to treat this as a single 'entity' which just the primary member manages in terms of the renewal
> 2 votes

---
Tags: civimember, civigroup
---


# Question
Title: Notification if a member cancels their membership?
Is there a way to have Civicrm notify us, via email or any other way, everytime a member cancels their membership/auto renewal?

thank you for the help.

# Answer
> 2 votes
As petednz suggested the CiviRules extension should be able to help you with this. Are your memberships cancelled from a profile? Or in the CiviCRM user interface? Then it will certainly help you. You should test first, I do not know if people used it for cancelling memberships yet.

The CiviRules extension is here: https://civicrm.org/extensions/civirules Documentation is here: https://docs.civicrm.org/civirules/en/latest/

---
Tags: civimember
---


# Question
Title: How do I clear all the personal / sensitive data from CiviCRM DB via SQL?
We have cloned a live DB and run the following SQL to anonymise the contact data:-

```
delete from civicrm_email;
delete from civicrm_address;
update civicrm_contact set birth_date = NULL;
update civicrm_contact set first_name = 'Staging';
update civicrm_contact set middle_name = '';
update civicrm_contact set last_name = concat('Test',id);
update civicrm_contact set legal_name = '';
update civicrm_contact set display_name = concat('Staging Test',id);
update civicrm_contact set addressee_display = '';

```

However, when we search for contacts (Search/Find Contacts) it still displays the original contact name under the "Name" column.

How can we improve this SQL script to remove all traces of contact names?

# Answer
As people have pointed out there is a very comprehensive answer to the question of anonymising data, however this questions was about simply clearing data.

The correct answer from Pete and Demerit was that I had missed the sort\_name column from the civicrm\_contact table. So the full SQL is now:-

```
delete from civicrm_email;
delete from civicrm_address;
delete from civicrm_phone;
update civicrm_contact set birth_date = NULL;
update civicrm_contact set first_name = 'Staging';
update civicrm_contact set middle_name = '';
update civicrm_contact set last_name = concat('Test',id);
update civicrm_contact set legal_name = '';
update civicrm_contact set display_name = concat('Staging Test',id);
update civicrm_contact set sort_name = concat('Staging, Test',id);
update civicrm_contact set addressee_display = 'Dear Staging';
update civicrm_contact set email_greeting_display = 'Dear Staging';
update civicrm_contact set postal_greeting_display = 'Dear Staging';

```

And as pointed out by @Chris you will also need to clear the cache tables, but please use the GUI for this as direct SQL on these tables can cripple the CiviCRM caching logic.

Feel free to edit and expand this answer if you know of any other fields that can be cleared by SQL.
> 4 votes

# Answer
While there's a good answer as indicated by the comments above, in this specific issue might be seeing data from the cache in those autocomplete results?

CiviCRM has a UI to clear the cache at something like **Administer \> System Settings \> Cleanup Caches & Update Paths**

*Using CiviCRM's public interfaces / ux / tools like `civix` are recommended over direct SQL.* But you asked about a specific case (contact table wiped, autocomplete shows retained results), so there you go :)

Your SQL may still not fully anonymize the DB (see other answer), and there's no simple answer which can ensure you do this short of wiping and installing a fresh DB.
> 1 votes

---
Tags: contacts
---


# Question
Title: Getting error message from cron but no clue why - can anyone help?
I'm getting the following message about 3 or 4 times a day from cron. Nothing is showing up in the error log and I'm puzzled. This follows moving the site from one host to another which must be a clue. Civi is working fine except for this error message. The site is Drupal based, release 5.19.4 and PHP 7.3.15. After putting in the line suggested by Demerit, here's the new trace, the problem occurred once today.

**Warning**: array\_intersect\_assoc(): Expected parameter 1 to be an array, string given in **/home/example/public\_html/sites/all/modules/civicrm/Civi/Core/SettingsMetadata.php** on line **150**
**Warning**: array\_intersect\_assoc(): Expected parameter 1 to be an array, string given in **/home/example/public\_html/sites/all/modules/civicrm/Civi/Core/SettingsMetadata.php** on line **150**
**Warning**: array\_intersect\_assoc(): Expected parameter 1 to be an array, string given in **/home/example/public\_html/sites/all/modules/civicrm/Civi/Core/SettingsMetadata.php** on line **150**
**Warning**: array\_intersect\_assoc(): Expected parameter 1 to be an array, string given in **/home/example/public\_html/sites/all/modules/civicrm/Civi/Core/SettingsMetadata.php** on line **150**
**Warning**: session\_start(): Cannot start session when headers already sent in **/home/example/public\_html/sites/all/modules/civicrm/CRM/Core/Session.php** on line **124**

And here what was in ConfigAndLog at the time the problem occurred

Mar 18 02:15:02 \[info\] ddd DD

Mar 18 02:15:02 \[info\] month

Mar 18 02:15:02 \[info\] 500

Mar 18 02:15:02 \[info\] en\_GB

Mar 18 02:15:02 \[warning\] Deprecated Path: There is a setting (generate\_schema\_and\_data) not correctly defined. You may see unpredictability due to this. CRM\_Core\_Setting::setItems Array ( \[civi.tag\] =\> deprecated )

Mar 18 02:15:04 \[warning\] Deprecated Path: There is a setting (generate\_schema\_and\_data) not correctly defined. You may see unpredictability due to this. CRM\_Core\_Setting::setItems Array ( \[civi.tag\] =\> deprecated )

# Answer
Based on comments this was tracked down to extensions. @andy-clark looked at the installed extensions and an older version of the CiviCalendar extension was creating the string error.

Also the Summary Fields extension was creating deprecated warnings.
> 2 votes

---
Tags: drupal, error
---


title: Getting Stripe Webhooks working

text:
# Question
Title: Getting Stripe Webhooks working
I'm using Stripe Payment Processor 6.3.2, MJWShared 0.6 on Civicrm 5.23.2 with Wordpress Multisite.

I've used the Wizard to instal webhooks in Stripe.

I'm now getting a warning in CiviCRM System Status "Webhook API version is set to 2020-03-02 but CiviCRM requires 2019-12-03. To correct this please delete the webhook at Stripe and then revisit this page which will recreate it correctly. Webhook path is: https://xxx.xxxx,com/?page=CiviCRM&q=civicrm/payment/ipn/2."

If I delete the webhooks on the Stripe Dashboard, the Wizard can again be used to instal webhooks, but the same warning message comes up.

Any ideas on how I proceed? Or indeed where this process is documented?

David Brown

# Answer
> 2 votes
If the Stripe webhook wizard is creating webhooks with the wrong API version, that's a bug, and should be reported on https://lab.civicrm.org/extensions/stripe/issues.

To allay your concerns - it's very unlikely that you're going to experience any ill effects from this. The check in question is mostly concerned with folks running older versions of the Stripe API, and the API doesn't change that drastically from version to version.

---
Tags: stripe
---


title: Control duplicate entries in Hook Post

text:
# Question
Title: Control duplicate entries in Hook Post
I'm in need of inserting a control query into a hook post to retrieve if there is duplicate data.

I am using a php query but the only reaction I have is that it continues to compute forever, is it possible that there are strings of CIVI seasoning more suitable for this task?

```
$check = mysql_query("SELECT * FROM table WHERE code = '$invoicenum'");
    $checkrows = mysql_num_rows($check);

   if ($checkrows > 0) {
WARNING
   }
   else {
OK CONTINUE CHANGE
}

```

Regards

# Answer
You're using `mysql_query`, which is deprecated in both PHP and modern versions of Civi. The code isn't running forever, it's failed with an error - you should be able to find that error, most likely in your CiviCRM log.

While you could use `mysqli_query`, the better choice is to use a wrapper, which should give at least partial future-proofing. Here's my (untested!) attempt at a rewrite:

Use:

```
$check = CRM_Core_DAO::executeQuery("SELECT * FROM table WHERE code = '$invoicenum'");

if ($check->fetch()) {
  // WARNING
else
  // OK
}

```

Note also that if you're using the *post* hook, the data has already been written to the database. I would put this in a validation hook or an API Wrapper hook if you're trying to prevent the data being written.
> 1 votes

---
Tags: hooks
---


# Question
Title: I was looking a solution for a organization with contacts and volunters with actuation diarly and needs register it. Some extension required?
I need a solution with the information between a volunter and a contact with diary operatons. I think with a calendar that I can register these actuations. Is there any extensions I can try?

Thanks

Andreu

# Answer
> 1 votes
Very hard to guess what you are trying to do. But to record information between a Volunteer and a Contact I would suggest you consider

* using Activities as this means the 'interaction' is recorded on both the Volunteers record and the Contacts record
* using Cases if the workflow is complex

When you talk about a 'calendar' sometimes people just mean a date-based log and sometimes they mean an actual monthly calendar of Activities.

I have done both using Drupal Views so will depend on what CMS you are using

---
Tags: civivolunteer
---


# Question
Title: Membership cancelled, but active until end date
Our memberships period is a calendar year. If a member decides to cancel, he will still be a member until the end of the year. During the remainder of the year, the member can still profit from his membership. But he must not be reminded of renewing his membership.

So, the end date discriminates active memberships, not the membership status itself. At the end of the year, the status should still be cancelled, not expired.

Is this something that can be done?

# Answer
> 3 votes
I think I did a bit of both:

I created an extra membership status called Stopped. This is valid and active until the end of the year. At the end of the year I update all the Stopped memberships to Cancelled.

# Answer
> 1 votes
As you know, membership statuses are calculated based on membership status rules, however, the status of "Cancelled" can only be manually assigned, and it does not represent a "current" membership. You might want to consider creating a new rolling, monthly membership type (e.g. "Cancelling") with no "auto-renew" option that will keep members current for the remainder of the period - this will allow you to exclude this membership type from receiving scheduled reminders for renewal and to quickly search for and update the membership statuses to "Cancelled" when their end date has been reached (using update multiple membership records as described **HERE**). In short, you would cancel their existing membership, then create a new "Cancelling" membership with an end date that matches the existing membership.

Important: If you have any discounts/permissions based on membership type, you'll need to be sure to add the "Cancelling" membership type to the list of eligible memberships.

Hope this helps!, Tamar

# Answer
> 1 votes
Something like following might work \- add an Activity for those who no longer wish to be members \- make a smart group of the above \- exclude the Smart Group from getting Scheduled Reminders about renewing \- on d-day find Smart Group and batch update Membership status to Cancelled.

---
Tags: civimember
---


# Question
Title: Has anyone gotten GiveWP to work with CiviCRM
One of my associates wants to use GiveWP for donation forms. GiveWP has a plugin

https://shop.civivip.com/civi-plugins/give-donation-pages-integration/

The current version is called civivip\_give-0.3.0-beta

Does beta mean it is not released for production sites?

# Answer
CiviVIP doesn't make their plugins freely available, so it's very difficult to find support from folks outside of CiviVIP. I would ask CiviVIP support, they should be able to answer this.
> 1 votes

---
Tags: civicontribute, plugin
---


# Question
Title: Why does "from" email show a different list on single email versus bulk?
I checked the option that shows all my contact email address in the from list, and if I pull up a single contact and click Action -\> Send Email, it will show the full list. But when I go to Mailings -\> New Mailing, it only shows the list from the From Emails list screen. Can I send a bulk email using a from address from the logged in user's contact? That list is going to be a mile long if I have to add everyone that might send bulk email to the list. I toggled the yes/no a couple times and it definitely doesn't affect the new bulk mail screen. Is there some reason the new mailing screen is required to be limited this way? Could/should the one yes/no toggle control both, or could/should a second toggle be added to allow it?

On a side note, I noticed the Mailings -\> New Mailing screen doesn't sort the dropdown in the same order indicated on the config screen. Actions -\> New Email does sort the from list correctly, but New Mailing doesn't.

# Answer
Sending an email using CiviMail is different from sending a one-off email to an individual contact, both technically and conceptually. Sending CiviMail is a much more fraught activity in terms of ip reputation, bounce handling, etc. since it is used to send thousand of emails or more. So it makes sense to have different rules, and one of those is to limit the different From: email addresses that allowed.

It sounds like you want everyone in your database to be able to send civimails from themselves? That doesn't sound like what CiviMail is intended for.

Perhaps you're looking for more of a mailing list functionality as provided by list serve type software (mailman, etc.)?
> 2 votes

---
Tags: email
---


title: Modifying Relationship.tpl modal

text:
# Question
Title: Modifying Relationship.tpl modal
I have custom fields underneath a relationship type that I want to restrict to view only or entirely remove if they are not a specific user. I can make the permissions work so the issue is load order I think. My jQuery code in Relationship.extra.tpl loads before the custom fields appear. I suppose my answer lies somewhere here https://docs.civicrm.org/dev/en/latest/framework/ajax/ but any pointers to get me in the right direction?

# Answer
Putting this in Relationship.extra.tpl works. Both ajaxSuccess or ajaxComplete events works. Thank you Pradeep.

```
{literal}
<script>
CRM.$( function( $ ) {
    $( document ).ajaxSuccess(function( event, request, settings ) {
     // do stuff
    } )
 } )
</script>
{/literal}

```
> 1 votes

# Answer
You can use preProcess or BuildForm hook on formname CustomDataType and unset the custom group or field based on user role or id

You can use PageRun hook and unset the variable in smarty template based on condition and it will not display on view page

since the custom fields are build using ajax, you can also use ajaxSuccess jq event to remove the custom field using Relationship.extra.tpl
> 2 votes

---
Tags: templates
---


title: Pausing a autorenewal membership

text:
# Question
Title: Pausing a autorenewal membership
with the current covid-19 situations and mandatory closures, we are investigating ways to 'pause' autorenewals. The idea being that members who have paid for part of this month's memberships will get the remaining days of the month for free when we reopen our facility.

What is the best way to achieve this? We use Stripe as the payment processor and monthly autorenewals.

thanks for the all the help we have gotten from this great community here.

# Answer
In general, auto-recurring memberships are generated via an auto-recurring payment, whose mechanism depends on the payment processor, and most especially on whether the recurring payment schedule is managed by CiviCRM or the processor.

When the schedule is managed by CiviCRM, you have more direct control and could for example use some sql to just push forward the next scheduled contribution date one month (or so). You could also manually go in and edit each recurring schedule, updating the next scheduled contribution date. You'd also want to deal with the issue of the membership status - one way would be to extend the grace period, though mucking about with membership status rules can get you in weird trouble.

When the schedule is managed by the payment processor, as is the case with Stripe, (i.e. the payment processor will trigger the recurring payment according to a schedule stored on it's servers), then you'll need to depend on whether the payment processor extension gives you the ability to update that schedule. Based on one example I just looked at, that doesn't appear to be the case.

So you'd need to use the Stripe interface itself to make any changes to the schedules.
> 3 votes

---
Tags: civimember, stripe, auto-renew
---


# Question
Title: Only !CRM.checkPerm("administer CiviCRM")) conditional works
If I put this (or any JQuery) in an .extra tpl file it works

```
{literal}
<script>
if (!CRM.checkPerm("administer CiviCRM")) {
CRM.$( function( $ ) {
    $( document ).ajaxComplete(function( event, request, settings ) {
   //do stuff
 })
 })
 }
{/literal}
</script>

```

If I switch the permission away from **administer CiviCRM**, it does not work and executes the code for all users. Carrying over from here: Removing elements for non-admin users.

# Answer
> 2 votes
If you want to use CRM.checkPerm() JS function than you will need to add permission using hook and than it will be catched in CRM.checkPerm() js function. eg: In hook

```
function extname_civicrm_buildForm($formName, &$form) {
  if ('Some_FormName' == $formName) {
    CRM_Core_Resources::singleton()->addPermissions('administer CiviCRM');
  }
}

```

and than in tpl

```
{literal}
<script>
  CRM.$( function( $ ) {
    if (!CRM.checkPerm("administer CiviCRM")) {
      $( document ).ajaxComplete(function(event, request, settings) {
       //do stuff
      });
    }
  });
{/literal}
</script>

```

An other alternate could be

```
{if !call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM')}
  {literal}
  <script>
    CRM.$( function( $ ) {
      $( document ).ajaxComplete(function(event, request, settings) {
        //do stuff
      })
    });
  {/literal}
  </script>
{/if}

```

---
Tags: permissions, templates
---


title: Alternative CiviCRM theme

text:
# Question
Title: Alternative CiviCRM theme
I have looked a great bit into some alternatives to the default civicrm theme such as shoreditch, haystack, the CiviHR theme and one that agiliway developed for their demo site.

My question is what alternatives are most people using instead of their default civicrm theme? Custom theme or one of the alternatives i discussed above.

# Answer
> 3 votes
We have been using CiviCRM shoreditch theme for quite a long time until we switched to Kindly Theme by artfulrobot for some of our clients recently. Both are good in their own aspects. Around 2.4k sites in this universe are using CiviCRM shoreditch theme. We also have custom theme inheriting Drupal bootstrap3 theme for some clients to match their screens.

# Answer
> 0 votes
We use Shoreditch for most of our customers, Haystack for 1 and have looked at (but not yet used) the Aah or Kindly theme by artfulrobot.

---
Tags: theme
---