# Question
Title: How can I add login and registration page for members with civiCRM?
I would like to have registration and login page for my clients.by defining user and password and selecting their city. Now I using Theme My Login plugin for registration, but I want to do this without using plugins? Is it possible? If yes how Can I do this?

# Answer
So you want a registration page for your site where they input their username, email, password, and city? If I'm understanding you correctly, do it like this:

I haven't used the Wordpress version, but it seems like it should be similar to the Drupal one - I create a profile in CiviCRM: http://www.yourdomain.com/civicrm/admin/uf/group?reset=1

In the settings for it, I choose it to be used for user registration and view/edit account. Username, email, and password you don't have to add to the profile because those are the minimum required elements for a user account.

Then any field you add there will be added to the registration page as well as their user account page (so they can view and update the information).

UPDATE: Forgot one step - you will need to enable an option in WordPress for the option to show up under profiles: Turn on "anyone can register" under Settings \> General.
> 3 votes

# Answer
You can do this through a profile. Under advanced settings in the profile setup there is an option for WordPress account creation. You can make it required or optional. You will need to check the box 'Anyone can register' in the WordPress general settings and set a default role. This will insert the account creation fields into the profile if the user is not logged in. You can use this profile as part of an event registration, contribution page or insert the profile in 'add' mode with a short code on a WordPress page.

I would recommend installing a plugin that requires a reCaptcha when user accounts are created. This will prevent robots from creating junk users in your system.

Hope this helps.
> 1 votes

---
Tags: wordpress, contribution-page
---


title: How to clear hook cache

text:
# Question
Title: How to clear hook cache
When I am changing a query or logic in my hook, I have to reinstall the entire module so then only the updated logic / code works in civicrm.

Is there a settings to clear the cache or something

I tried the below options none works

```
1. Admin > System Settings > Cleanup Caches

2. http://localhost/drupal/civicrm/menu/rebuild&reset=1

```

# Answer
Just go to http://localhost/drupal/civicrm/clearcache. This does a pretty thorough cache clear, including hooks.
> 1 votes

# Answer
If you are using drupal CMS, then you would need to clear all drupal cache and that should fix the issue.
> 0 votes

---
Tags: hooks, cache
---


# Question
Title: Adding individuals' event attendance as activity for employer?
Is it possible to set up Civi so that when an individual attends an event, it also shows up as an activity for their employer?

I'd like to be able to get an overview of how many people from an organisation attended (or spoke at) events alongside the other meetings, phonecalls, etc attached to that organisation's Activities.

Or would I have to create a custom report for this?

# Answer
> 4 votes
There are a couple of ways to do this:

* When creating an activity, add the Organization as a related contact.
* Create an extension to automate adding the Organization (see below).
* Create a custom report (not recommended).

As extensions go, it's pretty easy to write:

* use the `hook_civicrm_pre` to hook created activities.
* Use an API call to look up the contact. Is the `contact_type` equal to `Individual`? Is the `employer_id` not null?
* If so, add the employer as a related contact.

You'll have to consider edge cases: What happens if someone leaves an organization - does their attendance still count? If someone joins an organization after the activity, does that count? A custom report limits your ability to handle edge cases any way other than a "default" way, which is why it's not usually recommended.

---
Tags: civievent, activities
---


title: Image Upload URL Inconsistency

text:
# Question
Title: Image Upload URL Inconsistency
My image upload url is \[civicrm.files\]/persist/contribute/

What is telling \[civicrm.files\] to go that url?

# Answer
CiviCRM can have issues resolving symlinks if they exist in the path to CiviCRM codebase or resources (mentioned also here). Either avoid symlinks in your filesystem layout, or supply CiviCRM with the "real" path for the directory.
> 1 votes

---
Tags: resource-urls
---


# Question
Title: How to change the date on an exported batch
I have exported a batch but the date in the title is not correct, so I need to change the date on the name of the batch, however I cannot seem to re-open the batch. Please can you help. Thanks in advance, Grace

# Answer
> 4 votes
A financial batch once exported cannot be reopened through UI. But you can reopen/update a batch using a api.

If you want to change only title of the batch than i would recommend you to change the batch only title using api rather reopening the whole batch.

---
Tags: database, batches
---


# Question
Title: Embed video in Profile field for directory
Working on a public directory. The listings include a link to a YouTube video. It is working fine with a custom field of the type link. We would like to embed the videos in the search results. I created a custom field for this. When I add the embed code in the back end I get.

> Network Error Unable to reach the server. Please refresh this page in your browser and try again.

If I use a text area field with rich text editor and paste the code using the source view the video shows and can be played when you switch out of source but it will not save.

Using WordPress 4.9 & CiviCRM 4.7.27

# Answer
I followed the same steps on wpmaster and i was able to add embeded video. Here is what i did:

1. Added 2 custom field of type Link and Note(RichTextEditor).
2. Added above 2 fields in a Profile search.
3. Updated custom field for individual

* Added video link to link type custom field.
    * Added embed video code to Note type custom field.
4. On Profile search mode i did a search on contact #3

Can you check CiviCRM Log to see any error being recorded?
> 1 votes

---
Tags: custom-fields, profile, directory
---


# Question
Title: What is the differences between Suitecrm and CiviCRM?
I am wondering to know about differences between CRMs, especially suitecrm and CiviCRM when can I use them and can I use both of them on WordPress website together?

# Answer
> 2 votes
CiviCRM is made for non-profits. The *C* in CiviCRM points to your constituents. These are organisations and persons that share the mission of the non-profit. You can use CiviCRM to store the contact details, like address, telephone, and email, but it also has specific modules for specific non-profits processes like:

* CiviContribute to register donations.
* CiviMembership to register members.
* CiviEvent to register participants for events.

I do not know SuiteCRM but mostly the *C* in CRM is short for customer, and the application supports the process of selling products and services

Your choice of the software depends on what you want to do.

# Answer
> 1 votes
I've never used SuiteCRM, so I couldn't tell you the difference. I can tell you that it's never a good idea to use more than one CRM if you can help it. Otherwise you end up with data in two different places, which makes ensuring that you have the best, up-to-date information difficult. If Jane Smith is in both databases with the same mailing address, but different phone numbers and email addresses, which is the correct one?

---
Tags: wordpress, civimember, civicrm-home
---


title: CiviCRM AJAX api Permissions

text:
# Question
Title: CiviCRM AJAX api Permissions
**Background**

I am working on a React app for event participation management using the CiviCRM ajax API. There is a little more to this that isn't relevant.

Each user has access to their own API key, but no CiviCRM or CMS account. I have used the civitest\_civicrm\_alterAPIPermissions hook to expose/restrict various entities. I have given each user the "access AJAX API" permission.

**Issue**

Before I go looking through the code, I had a question about an issue I am having:

Users with CMS accounts and the exact same permissions (i.e. no "access CiviCRM" and cannot log into CMS) can access the API fine, but those without get the error "ERROR: No CMS user associated with given api-key"

The error is pretty self explanatory, but I was curious if there was a way to work around it that is built into CiviCRM.

**Setup**

Joomla 3.8

CiviCRM 4.7.22

# Answer
> 1 votes
I think you can bypass permission using permission\_check hook.

---
Tags: api, permissions, ajax
---


# Question
Title: migrating civi database from current hosting to civihosting.com
We recently signed up for shared hosting at civihosting.com and want to move our current site there. Both sites are running CiviCRM 4.7.29 and WordPress 4.9.1.

I cannot get into the CiviCRM dashboard on the current site (the biggest reason we're moving to civihosting !), but do have access to the MySQL database.

For the WordPress migration, we have been using the export/import tool in WordPress successfully, so that doesn't seem to be a problem.

Can I simply export the CiviCRM database from the current hosting provider and import it into civihosting? I understand I should drop the current database at civihosting first? As far as I know, I won't be losing anything important (I haven't done much yet in CiviCRM at civihosting).

Also, does anyone know of step-by-step instructions somewhere for doing this?

I'm comfortable with phpMyAdmin, if that comes into the picture.

Thank you!

# Answer
> 2 votes
Steps that i usually follow to migrate CiviCRM from one server to another

1. Export DB from current site.
2. Compress files structure of civicrm i.e /wp-content/plugins/files/civicrm or /wp-content/uploads/civicrm
3. Drop and create the database on CiviHosting.
4. Import db from #1.
5. Replace /wp-content/plugins/files/civicrm or /wp-content/uploads/civicrm from #2.
6. Re-Check civicrm.settings.php.
7. Log out from wordpress and log in.
8. Rebuild Menu and Trigger

http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/menu/rebuild&reset=1&triggerRebuild=1
9. Check and Update path in Administer \>\> System Settings \>\> Directories.
10. Check and Update path in Administer \>\> System Settings \>\> Resource URL.
11. Check and Update path in Administer \>\> System Settings \>\> Cleanup and Cache

# Answer
> 0 votes
Usually I export from PHPMyAdmin on the old site and then import the same way at the new site. I've always moved all my files and exported/imported the database myself so that everything was exactly the same. I'm not sure of what issues you might right into when just doing the database.

# Answer
> 0 votes
I would recommend that you:

1. Delete and then recreate the civicrm database at your account with CiviHosting
2. Export your other DB via phpMyAdmin, and select the custom settings and use compression like .zip or .tar.gz
3. Launch phpMyAdmin on CiviHosting and import

If both sites are using WordPress, then all you need to do is log in to WordPress on the CiviHosting site and confirm that the URL and Resource Directory settings are still correct.

Beyond that, it should work fine. If not, you can contact CiviHosting directly and I'm sure they would assist you.

---
Tags: wordpress, import, mysql, export
---


# Question
Title: Mailing not completing: "mail() returned failure"
I have two installs using Mosaico that are hanging up. The latest symptoms seem to be:

* if let cron start job, nothing in sent and every cron cycle it tries to start again, and never finishes (no "Finished execution" message in scheduler logs)
* if I brute force the start with "execute now" in scheduled jobs, the first batch of emails are sent, but then nothing the next cron cycle (starts and never finish message in logs). If I "execute now" again, the next batch of emails are sent. Unless I keep manually executing the job, it never finishes
* intermittently I notice a new mailing job will start in the scheduled jobs log before the next cron cycle runs (without me triggering it) and those do send another batch!
* the first time this happened a month ago things got a little better when I had the PHP memory limit increased to 295MB per process but it didn't help on the other account.

Hosting service says nothing in mail logs. Don't see anything amiss in apache(?) logs but not too familiar with them. Civi logs show the following message (but not always):

```
Jan 02 17:50:52  [info] Ignoring exception thrown by nullHandler: , mail() returned failure

Jan 02 17:50:52  [info] $backTrace = #0 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(959): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::nullHandler(Object(PEAR_Error))
#2 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(PEAR_Error))
#3 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(577): PEAR_Error->__construct("mail() returned failure", NULL, 16, (Array:2), NULL)
#4 [internal function](): PEAR::_raiseError(NULL, "mail() returned failure")
#5 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(237): call_user_func_array((Array:2), (Array:2))
#6 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/packages/Mail/mail.php(175): PEAR::__callStatic("raiseError", (Array:1))
#7 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/packages/Mail/mail.php(175): PEAR::raiseError("mail() returned failure")
#8 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/Listener/DefaultSender.php(85): Mail_mail->send("<kippski@gmail.com>", (Array:11), "--=_29173cf19e4941d68483ae618155e3a9\nContent-Transfer-Encoding: 8bit\nConten...")
#9 [internal function](): Civi\FlexMailer\Listener\DefaultSender->onSend(Object(Civi\FlexMailer\Event\SendBatchEvent), "civi.flexmailer.send", Object(Civi\Core\CiviEventDispatcher))
#10 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func((Array:2), Object(Civi\FlexMailer\Event\SendBatchEvent), "civi.flexmailer.send", Object(Civi\Core\CiviEventDispatcher))
#11 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "civi.flexmailer.send", Object(Civi\FlexMailer\Event\SendBatchEvent))
#12 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php(167): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("civi.flexmailer.send", Object(Civi\FlexMailer\Event\SendBatchEvent))
#13 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(47): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch("civi.flexmailer.send", Object(Civi\FlexMailer\Event\SendBatchEvent))
#14 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/FlexMailer.php(247): Civi\Core\CiviEventDispatcher->dispatch("civi.flexmailer.send", Object(Civi\FlexMailer\Event\SendBatchEvent))
#15 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/FlexMailer.php(184): Civi\FlexMailer\FlexMailer->fireSendBatch((Array:200))
#16 [internal function](): Civi\FlexMailer\FlexMailer->Civi\FlexMailer\{closure}((Array:200))
#17 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/Event/WalkBatchesEvent.php(71): call_user_func(Object(Closure), (Array:200))
#18 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/Listener/DefaultBatcher.php(62): Civi\FlexMailer\Event\WalkBatchesEvent->visit((Array:200))
#19 [internal function](): Civi\FlexMailer\Listener\DefaultBatcher->onWalk(Object(Civi\FlexMailer\Event\WalkBatchesEvent), "civi.flexmailer.walk", Object(Civi\Core\CiviEventDispatcher))
#20 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func((Array:2), Object(Civi\FlexMailer\Event\WalkBatchesEvent), "civi.flexmailer.walk", Object(Civi\Core\CiviEventDispatcher))
#21 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "civi.flexmailer.walk", Object(Civi\FlexMailer\Event\WalkBatchesEvent))
#22 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php(167): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("civi.flexmailer.walk", Object(Civi\FlexMailer\Event\WalkBatchesEvent))
#23 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(47): Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch("civi.flexmailer.walk", Object(Civi\FlexMailer\Event\WalkBatchesEvent))
#24 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/FlexMailer.php(221): Civi\Core\CiviEventDispatcher->dispatch("civi.flexmailer.walk", Object(Civi\FlexMailer\Event\WalkBatchesEvent))
#25 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/FlexMailer.php(186): Civi\FlexMailer\FlexMailer->fireWalkBatches(Object(Closure))
#26 /home/mainecrafts/www/www/wp-content/plugins/files/civicrm/extensions/org.civicrm.flexmailer/src/FlexMailer.php(148): Civi\FlexMailer\FlexMailer->run()
#27 [internal function](): Civi\FlexMailer\FlexMailer::createAndRun(Object(CRM_Mailing_BAO_MailingJob), Object(Mail_mail), NULL)
#28 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Resolver.php(119): call_user_func_array((Array:2), (Array:3))
#29 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(198): Civi\Core\Resolver->call("\Civi\FlexMailer\FlexMailer::createAndRun", (Array:3))
#30 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/Mailing.php(2959): CRM_Mailing_BAO_MailingJob::runJobs(NULL, NULL)
#31 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(324): CRM_Mailing_BAO_Mailing::processQueue()
#32 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_process_mailing((Array:1))
#33 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#34 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:7))
#35 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("Job", "process_mailing", (Array:1), NULL)
#36 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(145): civicrm_api("Job", "process_mailing", (Array:1))
#37 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(113): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#38 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(153): CRM_Core_JobManager->executeJobById("2")
#39 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(160): CRM_Admin_Page_Job->browse(NULL, NULL)
#40 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(136): CRM_Core_Page_Basic->run()
#41 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Admin_Page_Job->run((Array:3), NULL)
#42 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:16))
#43 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#44 /home/mainecrafts/www/www/wp-content/plugins/civicrm/civicrm.php(1216): CRM_Core_Invoke::invoke((Array:3))
#45 [internal function](): CiviCRM_For_WordPress->invoke("")
#46 /home/mainecrafts/www/www/wp-includes/class-wp-hook.php(286): call_user_func_array((Array:2), (Array:1))
#47 /home/mainecrafts/www/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#48 /home/mainecrafts/www/www/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#49 /home/mainecrafts/www/www/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
#50 {main}

```

This happened about a month ago on the same account (over 4000 recipients), then a mid-month mailing (about 2000 recipients) went fine.

Any help in resolving this would be great as I'm forcing these to go out in the meantime :/

# Answer
Your error is `mail() returned failure`. That strongly suggests an error outside the PHP stack. Check your SMTP logs; there should be a good clue there. You can also specify an alternate SMTP server if one is available to you.
> 1 votes

---
Tags: civimail, mailserver
---


title: Where to update new Mosaico templates

text:
# Question
Title: Where to update new Mosaico templates
I want create my Mosaico template in WordPress with the CiviCRM extension but I can't find where upload the new template.

Secondly, must I activate the new template after uploading it to my host?

# Answer
As you can see on Mosaico Extension v2.0-beta3, etal release, since this version...

> In the CiviCRM menu, you'll find a new item "Administer =\> CiviMail =\> Mosaico Settings". This exposes options, such as "Layout" and "Custom Template Directory", which would otherwise remain hidden.
>
> (...)
>
> v2.0-beta3 allows site administrators to install templates in the "Custom Template Directory", and it allows developers to bundle templates into CiviCRM extensions
> 3 votes

# Answer
When you install the Mosaico and related Extensions, you then create the Templates in civicrm and they become available to use in CiviMail, you do not upload them.

ADDENDUM:

If you have installed correctly, as per instructions, ie Shoreditch then FlexMailer then Mosaico then at /civicrm/a/#/mosaico-template you should see the word NEW on top of the base template
> 2 votes

# Answer
You can create a new template through following steps:

1. Create new template folder in mosaico extension directory: packages/mosaico/templates/new\_template
2. Copy 'versafix' template to your new template and edit according to your design requirements
3. Register the new template in mosaico extenstion directory in file: CRM/Mosaico/BAO/MosaicoTemplate.php

Hope that helps.
> 0 votes

---
Tags: wordpress, mosaico
---


# Question
Title: hook_civicrm_postSave_table_name not called on table update
In Drupal, I'm using hook\_civicrm\_postSave\_table\_name to listen for CiviEvent registrations. I've implemented hook\_civicrm\_postSave\_civicrm\_participant($dao) where I test for certain status\_id values and do something with a custom Drupal module. Although this works for non-paid events, I noticed that it's not working for paid events.

The reason is because during the payment process the status\_id is '6', but when the payment is processed and the status\_id changes to '1', the hook isn't called (The hook does get called when the database row is written with status\_id 6).

The documentation says "This hook will get called again with every update", but this doesn't seem to be the case.

Is this a bug, or should I be getting the participant status update in a different way?

# Answer
> 1 votes
You can use hook\_civicrm\_post hook which gets called every time a core object is written to db. Detailed description can be found here: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_post/

---
Tags: civievent, database, hooks
---


title: Create new CiviCRM database...?

text:
# Question
Title: Create new CiviCRM database...?
I just succesfully installed CiviCRM on our website (WordPress), I created a new DB but was not given the option to specify it during the installation process. It seems to have installed in a DB that was already there xxxxx\_demodb in which I can now see all the civicrm\_xxxx tables, along with a handful of tables that look like they belong to WordPress, listed here:

* wp\_commentmeta, wp\_comments, wp\_links, wp\_options, wp\_postmeta, wp\_posts, wp\_termmeta, wp\_terms, wp\_term\_relationships, wp\_term\_taxonomy, wp\_usermeta, wp\_users.

Can somenoe pls confirm if these are WP or CiviCRMtables, and/or advise on how I can move the tables into a new DB and what config/ini things will need to be updated to make this work.

Or just create a whole (or use the empty one I already created) new fresh standalone DB, I have only made minor changes to the settings that I can just redo...

Thanks, Joe.

# Answer
The database tables you mentioned are wordpress CMS db tables. you would need to reinstall civicrm again and when installing it would ask for database fields where you can put in the civicrm database name and connection details. This documentation explains well the process of installing civicrm in wordpress CMS: https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/
> 2 votes

---
Tags: database
---


# Question
Title: Smart Group relative date criteria not saving
There is a history of a bug in which Smart Groups do not store the proper relative date ("Next 60 days") criteria, but rather convert the relative date into a hard date ("3 Jan 2018" to "4 Mar 2018"). This bug was noticed starting with v. 4.7.x and was. supposedly fixed in 4.7.13 I'm still having this issue in 4.7.27 (Joomla 3.8.2).

Anyone else notice this recurring? Any advice?

# Answer
I recall we've experienced this for quite a number of fields in Advanced Search. Some of them are - `Event Dates`, `Registration Dates` and some date filters in Case section.

I did a patch to fix this for us but missed to update core for some reason. If the above fields fail for you, can you try applying this patch and see if it works for you?

Opened a JIRA for this issue with a PR https://github.com/civicrm/civicrm-core/pull/11486.
> 5 votes

---
Tags: smartgroups, dates
---


# Question
Title: Where does Civi store membership and membership signup info?
We are moving to a new site, and when I tried to import our entire current Civi MySQL database to the new site, I had problems.

So I have created a fresh database on the new site and want to try importing things bit-by-bit, starting with memberships. We have a membership signup page as well as info about past signups.

Can anyone tell me which tables from the current database I need to import to the new site? Any other advice/warnings would be welcome, too!

I am not able to get into the Civi interface (e.g. contributions, events, administer) on the current site, but can access the Civi database. So I want to do this just by exporting and importing from/to the databases.

(I can access Civi and WordPress files on both sites via FTP if that's helpful.)

Both sites are WordPress 4.9.1 and Civi 4.7.29.

Old site is at 1and1, new site at civihosting.

# Answer
> 2 votes
Best thing to do is to do a complete dump of your old database and import it into a fresh database on your new server. Then use that for your new Civi install. Importing piece by piece creates problems because there is too much data that is reliant on other tables.

# Answer
> 0 votes
Agree with Jenni, trying to do this table for table makes it extremely complicated and probably undoable. So I would do a `mysqldump` to dump the source database and restore it on the new site.

There are some guidelines here: https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/

---
Tags: civimember, import, export
---


# Question
Title: CiviVolunteer Stopped Working with upgrade to 4.7.29
I upgraded CiviCRM from 4.7.28 to 4.7.29. CiviVolunteer is at 4.7.21-2.2.3. I have active projects but the "Manage Volunteer Projects" screen comes up blank. The "Search for Volunteer Opportunities" reports "No results found".

I can create a new project, but it also doesn't show up. I see the projects in the database (civicrm\_volunteer\_project), although I noticed the new project I tried to create is listed in three identical records.

I have Angular Profiles 4.6-1.0.2 and am on WordPress 4.9.1.

I tried "cv flush" as described in https://issues.civicrm.org/jira/browse/CRM-21210.

# Answer
I'm not sure this was the problem, but the default PHP interpreter was at 7.1. I noticed CiviEvent was also not working (error message about "pass by reference"). I set PHP back to 5.6 and both CiviEvent and CiviVolunteer seem to be working.

The CiviCRM status screen is giving notice "PHP Out-of-Date: This system uses PHP version 5.6.32. This meets the minimum recommendations and you do not need to upgrade immediately, but the preferred version is 7.0."

Update July 3 2018: Currently at CiviCRM 5.2.2 with CiviVolunteer 4.7.31-2.3.1 and was able to move to PHP 7.1.18 with no issues.
> 2 votes

---
Tags: civivolunteer
---


# Question
Title: How refund is possible for event participants in civicrm?
I am using civicrm 4.6 in wordpress where users register for the events. We also want to allow users cancel their registrations and admin can refund them. We are using Stripe payment processor and participants make payment through credit card. Is their any in built feature to refund event participants? or how to integrate that?

# Answer
It's been my experience that refunds need to be done with the payment processor, not inside CiviCRM. We use Authorize.net and we just log into the system and do the refund from there. Payment systems can be real finicky when it comes to refunds because of fraud.
> 2 votes

---
Tags: wordpress, civievent, civicontribute, evaluating-civicrm
---


# Question
Title: Every time someone hits "Confirm Contribution" their screen just goes blank
Here is where it is happening http://bgcweberdavis.org/summerhays-golf-pro-am-scramble-payment/

It was doing it on the other payment forms I have so I disabled them on my site. Why won't it take the transaction?

# Answer
You can look for detailed error occurrence in civicrm logs, the file location of logs would be different based on the CMS you are using. Secondly you can follow below link to configure your settings file to display errors upon white death screen. How do I debug CiviCRM when I hit a blank page / white screen / fatal error?
> 1 votes

---
Tags: wordpress
---


# Question
Title: Why are custom tabs not displayed correctly in contact summary?
My users have reported seeing custom tabs not displaying correctly in the contact summary screen. Instead of wrapping, the tabs display as below. I can't reproduce the problem, although I have seen it in the past. This is Civi 4.7.19 running with Drupal. Theme is 'Seven'

# Answer
> 1 votes
Tried replicating the issue, but couldn't. Its working fine with Civi 4.7.19 on drupal 7.56 and theme 'Seven'. It maybe because of some conflicting css class.

---
Tags: 4.7, display
---


# Question
Title: Can the API be used to find contacts with multiple tags?
If I tag a contact as a Major Donor and a Volunteer, I can retrieve their contact ID via the API using an API call such as:

```
$result = civicrm_api3('EntityTag', 'get', array(
  'entity_table' => "civicrm_contact",
  'tag_id' => "Volunteer",
));

```

or

```
$result = civicrm_api3('EntityTag', 'get', array(
  'entity_table' => "civicrm_contact",
  'tag_id' => "Major Donor",
));

```

but I want to find only contacts who have both tags, I have to resort to making two API calls and comparing the results.

This seems to be the case across various CiviCRM APIs. For example, it doesn't seem to be possible to make an API call to retrieve groups that are of type ACL *and* Mailing List. Am I missing something? Have folks developed a recipe for this kind of query?

# Answer
> 1 votes
You can achieve this by giving the key 'tag\_id' an array containing multiple tags. Something like this:

`'tag_id' => array('volunteer', 'Major Donor'),`

---
Tags: api
---


# Question
Title: After CiviCRM 4.7 upgrade, CRM.$ Not A Function Errors
After upgrading to CiviCRM 4.7, several CiviCRM related pages/functions on my site are not working and reporting errors related to CRM.$ not being defined as a function, but I can't find where it should be originally defined. Jquery appears to be loading and working okay. Also, when I access the 'CiviCRM » Administer CiviCRM » System Settings » Directories' page, only the core menu is displayed without any css formatting. None of the directories options are displayed so I can't verify/change them. Three, ReferenceError: CRM is not defined errors are reported for the page.

# Answer
Try enclosing your jquery code in:

```
CRM.$(function($) {
$(document).ready(function () {

});
});

```
> 1 votes

---
Tags: civievent, upgrade, 4.7, javascript
---


# Question
Title: Event registration form does not show submit button when a 100% discount coupon is used
I run Civi 4.7.13, and trying to setup an online registration form for a CiviEvent. When no coupon is used, the event registration submit button is the "Pay Pal Checkout" button. But when the amount is 0 because a 100% discount coupon is used, there is no paypal button and the registration form cannot be submitted.

# Answer
> 2 votes
That looks like a bug, but I notice your CiviCRM is 4 versions behind the current one, so I'd update your CiviCRM first before doing anything else.

I have seen some similar issues in the past - when you have an on-site payment processor, there is some logic that hides the payment form when no payment is due. Perhaps in combination with an off-site processor like Paypal Standard, the hiding of the payment form turns into hiding the submit button.

# Answer
> 0 votes
I've also hit upon this issue -- an 100% discount coupon results in a zero $ cost for membership, and the Pay Now/Pay Later radio buttons don't appear, and when the prospective member clicks "Submit" to verify their membership request, they see the error :

0 - Call to a member function getPaymentFormFields() on null

I'm running civiCRM 4.7.27 and civiDiscount 3.3, with the Payment Processor set to PayPal - Website Payments Pro.

Any one have a workaround for this, so that we can offer these free memberships?

---
Tags: civievent, cividiscount
---


# Question
Title: How do I prevent blank fields on a profile from overwriting existing data when using the profile to register or donations from existing contacts?
I've setup a contribution page and made a link to it. I include a profile that includes things like address. The matching is set to update. If someone who already in civi goes to the donate page and only fills in the name and email address, leaving the street address blank, it will match and then null out the address that was there.

I'd like it to only update the fields if the user enters something in the field.

I don't really want to give everyone a drupal login and make them login first. We want to make donating as easy as possible.

We're using paypal so a lazy person who knows that and that they'll login to their paypal account and that it will pull up their address info, won't bother to enter it on the donate page. Interesting, if they do that either paypal doesn't send back the address info or civi doesn't do anything with it.

civicrm 4.5.8 (testing 4.6.11)

# Answer
> 1 votes
Created jira CRM-20731.

This problem also sort of exists with creating a new contact without an address. The contact will get an address record with only the country and state province. I included this in the jira as well since it's likely the same core code.

# Answer
> 1 votes
I'm working on WordPress 4.9.1 and CiviCRM 4.7.27. I'm seeing the same behaviour which can be replicated on the demo WordPress site. It's not only the address fields that are affected, it's also other fields as well, specifically custom fields.

If those fields are on the profile and you don't populate them, then they will all be blanked on a save. This is not good as we'd like to use volunteers to change select information but don't want to create a whole bunch of profiles for different scenarios. We'd like to present all info that they can change and then have them change only things that need changing.

It doesn't matter whether the state/province default is set or not. So our only recourse rights now to make things easier for volunteers is to create a duplicate record and then have an administrator go in and merge those records on a periodic basis.

I see that this bug has supposedly been solved, but it sure doesn't seem so.

# Answer
> 0 votes
this doesn't sound right. and i just checked on demo. gave user 'demo' a first and last name, added a address profile, filled it in incognito such that the match would pick it up, which it did, and I can confirm that demo did not have his (?) address overwritten as a result of leaving the profile address fields blank.

You can give it a go here to confirm (or point out i missed something)

check his address first (or give him one if system gets wiped before you get there) at

http://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=202

( also if system has been reset add Name and Address field at http://dmaster.demo.civicrm.org/civicrm/admin/contribute/custom?reset=1&action=update&id=1)

then go to this incognito to

http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1

and use first = demo, last = demo, email = demo@example.com to ensure match. then see outcome.

oh also if reset, make the contribution page have Pay Later so you can skip cc.

hth

---
Tags: profile, contribution-page
---


# Question
Title: Re-run iATS recurring contributions that failed due to bad iATS account credentials?
iATS credentials were messed up for a couple of days in December, and now I have lots of recurring contributions that failed, with source="iATS Payments Recurring Contribution (id=N) Agent code has not been set up on the authorization system. Please call iATS at 1-888-955-5455."

Is there a way to re-run those recurring contributions?

# Answer
Change the date for the next scheduled recurrence. Table civicrm\_contribution\_recur \> Column next\_sched\_contribution\_date

Change it to today and run your cron job or change it to tomorrow and it should process them with tomorrows transactions.
> 3 votes

---
Tags: contributions, recurring-contributions, iats
---


# Question
Title: Having error in contribution page after upgrade to 4.7.29
I'm a civicrm user, and I have problrm with contribution page after upgrade to 4.7.29, My civicrm installed on Joomla 3.8.3, this error show when I open the contribution form from frontsite.

the error message is : Warning: require\_once(CRM/Core/.php): failed to open stream: No such file or directory in /home/ablecomm/public\_html/administrator/components/com\_civicrm/civicrm/Civi/Payment/System.php on line 59

I have been trying to fix this but no have idea where is the problem.

is Anybody can help me? thankyou

# Answer
> 6 votes
This is a known bug and is documented and fixed at CRM-21595. You will need to apply the patch to fix the problem or will need to wait for 4.7.30 release.

---
Tags: payment-processor, contribution-page
---


# Question
Title: My Scheduled Jobs Log doesn't display a date or time
I kept checking the joblog and thought, wow, it sucks that it doesn't display the timestamp but just now I looked more closely and see that there is an actual "Date" column and all log entry values are blank for that field.

Sure enough all of the values for run\_time in the job\_log table are NULL. I updated one and refreshed the job log display in Civi and it showed up.

What is keeping the run\_time value from being set??

**UPDATE #1** : Well lookie there. What in the world would cause this schema? I didn't do anything special that I can recall.

```
mysql>  describe civicrm_job_log;
+-------------+------------------+------+-----+---------+----------------+
| Field       | Type             | Null | Key | Default | Extra          |
+-------------+------------------+------+-----+---------+----------------+
| id          | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| domain_id   | int(10) unsigned | NO   | MUL | NULL    |                |
| run_time    | timestamp        | YES  |     | NULL    |                |
| job_id      | int(10) unsigned | YES  |     | NULL    |                |
| name        | varchar(255)     | YES  |     | NULL    |                |
| command     | varchar(255)     | YES  |     | NULL    |                |
| description | varchar(255)     | YES  |     | NULL    |                |
| data        | text             | YES  |     | NULL    |                |
+-------------+------------------+------+-----+---------+----------------+

```

**UPDATE #2** : I just performed a completely new Drupal 7.56, CiviCRM 4.7.29 install and before I did anything else I checked the schema for **civicrm\_job\_log** and it has the exact same problem - NULLable, without Default: CURRENT\_TIMESTAMP, and without attribute on update CURRENT\_TIMESTAMP.

Upon a more direct web search I ran across "The date is no longer kept in the scheduled job logs" in the CiviCRM Jira from Feb/March 2017. It has been closed by Nicolas as "most probably not related to CiviCRM". Not buying that unless somebody can explain.

**Closed JIRA**

https://issues.civicrm.org/jira/browse/CRM-20165

I just looked at a Civi 4.7.27 install I have and it does not have the same problem.

For now I guess I'll modify them manually but I'd like to know if anybody else running 4.7.29 (perhaps new vs upgraded) have the same problem.

# Answer
The run\_time field is set to current timestamp by default and its a not null field which mean that run\_time will never NULL values. Can you please check you schema for civicrm\_job\_log. I am pasting below for CiviCRM version 4.7.29

```
mysql> DESCRIBE `civicrm_job_log`;
+-------------+------------------+------+-----+-------------------+-----------------------------+
| Field       | Type             | Null | Key | Default           | Extra                       |
+-------------+------------------+------+-----+-------------------+-----------------------------+
| id          | int(10) unsigned | NO   | PRI | NULL              | auto_increment              |
| domain_id   | int(10) unsigned | NO   | MUL | NULL              |                             |
| run_time    | timestamp        | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| job_id      | int(10) unsigned | YES  |     | NULL              |                             |
| name        | varchar(255)     | YES  |     | NULL              |                             |
| command     | varchar(255)     | YES  |     | NULL              |                             |
| description | varchar(255)     | YES  |     | NULL              |                             |
| data        | text             | YES  |     | NULL              |                             |
+-------------+------------------+------+-----+-------------------+-----------------------------+
8 rows in set (0.00 sec)

```
> 2 votes

---
Tags: scheduled-job
---


# Question
Title: WordPress Twilio Inbound SMS Callback URL failing when request method is POST
I set up Twilio with CiviCRM and WordPress a few weeks ago. Inbound SMS was working fine, but suddenly stopped.

I have the webhook URL for SMS in Twilio set to https://mydomain.com/civicrm/?page=CiviCRM&q=civicrm%2Fsms%2Fcallback&provider=org.civicrm.sms.twilio (the /civicrm/ is for the Page I have setup, before adding that it would only work when I was logged into WordPress).

When the webhook is set to use HTTP POST, Twilio is reporting a "Schema validation warning" because it's just getting WordPress HTML back for the website home page. It works when I set it to GET though. I've reproduced this behaviour via a PHP script that manually submits the POST/GET request.

How can I get this Twilio Provider extension to respond via WordPress to a POST request? What am I missing? (This seems similar to Inbound SMS from Twilio not showing up in CiviCRM (getting 404 error on HTTP POST) but I'm new here and don't have the reputation to comment.)

Or does it matter? The documentation says it should be set up to use POST, but maybe that's not important?

# Answer
Your webhook callback URL is off. It should be `https://mydomain.com/?page=CiviCRM&q=civicrm%2Fsms%2Fcallback&provider=org.civicrm.sms.twilio`
> 1 votes

---
Tags: wordpress, sms, civisms, twilio
---


title: How to recover deleted (?) activity

text:
# Question
Title: How to recover deleted (?) activity
I think I may have deleted a bunch of activities by accident. Here's what seems to have happened:

1. I had "Activity X" scheduled to occur every Saturday from 6/10/17 to 12/30/17
2. As 2017 rolled along, each Activity was customized as a stand-alone "just this one" edit week by week. This gave me lots of individual past activities as desired.
3. Because I needed to keep doing this through 3/31/18, I went to the entry for 12/30/17 and extended its "stop repeating" date to 3/31/18 and noted to apply only to this instance forward.
4. This preserved the 12/30/17 instance (correct), created the weekly activities through 3/31/18 (correct), but seems to have made all activities in the set prior to 12/30/17 disappear (ARRRGH)!

Any idea what may have gone wrong and how to recover? What I described above is actually the situation for about 300 activities all together (I just gave one example).

We use WordPress and latest Civi edition. Thanks.

P.S. We may have a backup, but if this is a bug or something unclear, I want to be sure others know.

# Answer
Activities have a fairly complicated pattern in the database, where the column is\_current\_revision determines what the actual version is. You migt want to check the civicmr\_activity table to see what the situation in your case. Also, if you have logging switched on that might help. Obviously if you have a backup that might be the quickest fix.

I am not sure if this is a bug, best option to find that out is try your scenario in a demo version?
> 1 votes

---
Tags: activities, search
---


# Question
Title: error http 500 when clicking Contribute button
I am on Civi 4.7.27 and wordpress 4.9

Our organization has been using civi for the last 6 months without any real problems. A couple weeks ago we upgraded to the latest version of civi. Today I noticed that when ever someone submits a donation they get an error 500 page. The donation still goes through and is recorded in civi, but the donor does not land on the confirmation page, nor do they receive their receipt in email. I tried running "Clean up Cache" and "Reset Paths" that did not help. Does anyone know what could be causing this and how I can resolved it?

Thank you.

**ADDED INFO 12/5/17 We are seeing the below errors. This issue is still not resolved. Remember everything was working perfectly until about three weeks ago, when both civi was upgraded to 4.7.27 and wordpress was upgraded to 4.9. These errors are not a result of something we did in attempting to fix it as we have not changed anything at this time. I hope it will give someone an idea of what is going on.**

```
1 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Mail/EmailProcessor.php(104):
   CRM_Core_Error::fatal("No mailboxes have been configured for Email to Activity Processing")

2 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(401):
   CRM_Utils_Mail_EmailProcessor::processActivities()

3 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89):
   civicrm_api3_job_fetch_activities((Array:1))

4 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169):
   Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))

5 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100):
   Civi\API\Kernel->runRequest((Array:7))

6 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(23):
   Civi\API\Kernel->runSafe("job", "fetch_activities", (Array:1), NULL)

7 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(145):
   civicrm_api("job", "fetch_activities", (Array:1))

8 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(79):
   CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))

9 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(99):
   CRM_Core_JobManager->execute(FALSE)

10 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89):
   civicrm_api3_job_execute((Array:2))

11 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169):
   Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))

12 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100):
   Civi\API\Kernel->runRequest((Array:7))

13 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(23):
   Civi\API\Kernel->runSafe("Job", "execute", (Array:2), NULL)

14 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(113):
   civicrm_api("Job", "execute", (Array:2))

15 /home/oursite/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32):
   civicrm_cli->callApi()

```

# Answer
> 1 votes
I don't believe that the error shown in the question is likely to be the one that triggers the error 500 for your registrants. Note that the backtrace shown starts with a CLI entry point `civicrm_cli->callApi()`, suggesting this has been triggered from system cron on the commandline, while your issue is reported as occurring via the web.

## First, find the relevant error log.

If you are seeing error 500s, you need to understand what the fatal error was. This probably involves inspecting your webserver error logfiles. You can find these via the webserver (eg Apache / Nginx / ...) configuration, and you may also find there are separate logfiles for a separate PHP process.

The PHP error logs may be identified via `phpinfo()` (look for "error\_log" setting). Webserver logs you'll need to ask your sysadmin or hosting provider. Bear in mind that a shared hosting provider may be reluctant to give access to logfiles which contain information from other sites, but you will need that information to resolve this issue without guesswork.

There should be a log entry made at the specific time you see the error in the browser. Don't accept any red herrings until you find out what this is, because it's essential to you finding the source of the problem.

If your hosting provider cannot help you track down CiviCRM errors, consider finding one who does: https://civicrm.org/partners

# Answer
> 0 votes
When I've run into a 500 error, it's almost always been because of something on the server itself. Sometimes it is an issue with files not being associated with the right user. For instance, I'm usually logged in as root, as that means I can easily switch back and forth between all the accounts on the server. But if I upload anything, I have to remember to set the user and group to the correct one, otherwise it's set to root and then I get errors. That's happened a couple times.

More often than not, it's a server error - sometimes a security rule need to have a task in Civi whitelisted so that it doesn't give the error. I pretty much always have my web host handle that, as they can easily access a lot more logs, settings, etc than I can. Usually they'll either ask you how to recreate it, or if it's something they can't access, they'll have you recreate it right then and then give them your IP address. Then they can more easily locate the problem in the logs.

---
Tags: civicontribute, error
---


title: Renaming Tags - Possible?

text:
# Question
Title: Renaming Tags - Possible?
We've got about 100 tags we use to mark a contact's vertical market across thousands of contacts.

We've been asked to rename some of the tags for consistency, but I can't seem to find any way to do that.

We also tried creating a new tag set with the new tags, but as not all tags need to be renamed, I am not allowed to create a duplicate tag, even if it is in a different tag set.

Is tags a Civi dead-end in this respect, or am I missing something?

Cheers!

# Answer
You should be able to navigate to /civicrm/tag?reset=1 select a tag and click on the label on the right side (see screenshot).
> 1 votes

# Answer
You could create a search (with advanced search) for all contacts with tag to be changed, then select all in the search and and specify new tag

then select all again and and specify the old tag.

Using this logic you may also decide you don't need the old tags deleted, you could simply not use them anymore.
> 1 votes

---
Tags: contacts
---


title: Stripe- Cancel recurring contribution

text:
# Question
Title: Stripe- Cancel recurring contribution
In testing CiviCRM/Stripe, we setup a recurring contribution and let it run for two months and then attempted to cancel it via the link in the email sent to the donor.

This resulted in the recurring payment being cancelled in CiviCRM but not in Stripe, so that the user will continue to be billed until someone logs into our Stripe account and manually ends the recurring payments (and no notification was giving to us on the admin side that someone attempted to cancel their 'subscription').

Our previous solution, using a Drupal module to handle recurring payments, allowed for seamless cancellations of recurring payments with Stripe. (We are running D7 and have installed the latest CiviCRM and Stripe extension)

Is this functionality working in Stripe? I am assuming it is and that we missed something in the setup as it does not seem that Stripe would be a viable option if donors are unable to cancel their recurring contributions.

Thank you for any insight.

Rachel

# Answer
> 1 votes
The way to cancel recurring contributions when using the stipe extension is to cancel to recurring contribution in stripe. Stripe then sends that event to CiviCRM and the record is updated.

However it might be worth looking at this pull request to the stripe extension which claims to allow the behavior you are looking for. https://github.com/drastik/com.drastikbydesign.stripe/pull/241

---
Tags: drupal, civicontribute, contributions, recurring-contributions, stripe
---


# Question
Title: Show translated string in a template field (using smarty?)
I'm using a custom profile template. I need display different text strings depending on browser language of user... One string for Spanish users and other string for all other users.

It seems this doesn't run:

{if $la eq 'es'}

Spanish string {else}

Catalan string {/if}

Mybe using {ts} tag? But I don't know where I should translate {ts strings}

# Answer
> 2 votes
I got it:

{if $tsLocale eq 'es\_ES'}

Spanish string {else}

Catalan string {/if}

An easy way, useful to translate custom form strings used once, for example ;-)

# Answer
> 0 votes
If you need CiviCRM to translate the string then you should use `{ts}String to display{/ts}`. In your case i believe the string should not translate so do not use {ts} tag.

# Answer
> 0 votes
It sounds like you're trying to translate a string, so using `{ts}` is the way to go. There's a nice blog post about creating local translation files that should help you prepare the Catalan one.

Three caveats:

* You'll need to add your new string to the file that you get from CiviCRM, since it's not going to know about your customization.
* As new versions of CiviCRM come out, you'll need to get an updated translation file and reapply your change.
* Strictly speaking, the assumption is that the string wrapped in `{ts}` is US English, so you'd be normally expected to set the English one there and then translate it to Spanish and Catalan in separate local translation files, but assuming you're defaulting to Spanish on your site and not offering English, I don't think it would be a problem to have `{ts}` wrap a Spanish string and then set up your local translation file as Spanish-to-Catalan rather than English-to-Catalan. That means you only have to customize the Catalan file.

---
Tags: smarty, templates, i18n, translation
---


title: Database Schema check/fix

text:
# Question
Title: Database Schema check/fix
I am getting random errors when I first log into Civicrm on Wordpress. It seems to be related to the check of existing indexes versus required indexes.

Warning: Invalid argument supplied for foreach() in /home/sporti62/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/SchemaHandler.php on line 750

Is there a tool where I can have the indexes checked and possibly rebuilt?

Norm

# Answer
> 2 votes
If there are indices problem, you can get false indices displayed on `Administer -> Administration Console -> System Status` page.

It will list the wrong indices in your table with the `Update Indices` button to rebuild them.

The above button tries to delete the listed false indices and recreate them in the correct order. If for some reason the `Update Indices` is unable to clear the message, you can manually delete the indices from the `Table Name` shown in the above screen and then create them using the same button.

Note that you can only see this message and button if your civi version is \<= 4.7.29. From 4.7.30, this message is hidden via `CRM-21298`.

So, on version \>= 4.7.30, as this UI is not present, you can try rebuilding them using the api via API explorer from `Support -> Developer -> API Explorer` with

Entity = `System` and Action = `updateindexes` (present on all versions).

# Answer
> 0 votes
I have seen same issue before and for same index 'UI\_case\_contact\_id'. The reason is 'update indices' script tries to recreate the index which already exists so we need to delete the existing 'UI\_case\_contact\_id' index and let the script create from scratch but before that you would need to create a temporary foreign key which will be deleted at the end of all steps. Follow the following steps to fix it:

1. Create temporary foreign key by SQL command:

`CREATE UNIQUE INDEX my_temp_key ON civicrm_case_contact (case_id, contact_id);`
2. Delete index UI\_case\_contact\_id:

`DROP INDEX UI_case_contact_id ON civicrm_case_contact;`
3. Run the 'Update indices' script
4. Delete temporary key that was created:

`DROP INDEX my_temp_key ON civicrm_case_contact;`

---
Tags: database
---


title: CiviCRM upgrade to 4.7.21 (Drupal 7)

text:
# Question
Title: CiviCRM upgrade to 4.7.21 (Drupal 7)
I am using Drupal 7.56 and have just upgraded from CiviCRM 4.7.20 to 4.7.21 with a number of significant issues that will require that I revert to 4.7.20. When I try to display System Status - Warning nothing is displayed. When I try to continue to use a previous email, nothing displays. I don't have the luxury of doing anything more to understand the issues since I now need to revert to 4.7.20.

# Answer
This is my answer pasted from this question

> We had one site that had 'lost' all it angular pages, eg CiviMail and System Status.
>
> In our case the angular cache files were returning 404 on the New Mailing page. (and 'inspector' was showing a lot of red angular errors)
>
> It was building the cache files in sites/default/files/civicrm/images, but then searching for them in sites/default/files/civicrm/persist/contribute
>
> The issue here was a mismatch between the resource url setting for Image Upload URL and the directory setting for Image Directory. Strangely (!!) these folders are being used for caching of angular files.
> 1 votes

# Answer
Try removing content of templates\_c folder, location: sites/all/default/files/civicrm/templates\_c
> 0 votes

---
Tags: upgrade, 4.7, angular
---


title: Initialization Error after any change

text:
# Question
Title: Initialization Error after any change
My website has member side and after adding a member to a site the site was broken and for members, Initialization Error occurs. so members couldn't access their own page on the website. and also when I install the new plugin I get this error again. I couldn't change anything on the website because after adding new page or post I have this problem. What is the reason of this problem?

# Answer
Your screenshot is incomplete (it's cut off on the right side) - but it looks like you have the wrong MySQL credentials somewhere. I would look at the two DSN lines in `civicrm.settings.php` and ensure they're correct.
> 1 votes

# Answer
Your screenshot definitely points that your MySQL connection is not correct that is defined in civicrm.settings.php file.

You can use MySQL Workbench to test the database connection or if you have access to phpmyadmin you can test it through there too.
> 1 votes

---
Tags: wordpress, database
---


# Question
Title: Http 500 Page not Found error when plugin clicked on backend - Wp-engine
I recently moved from linod sever to Wp-Engine server. I did the migration but Civicrm plugin wont work. I see it in the sidebar but when I click on it to access it I get a Http 500 page not found error. I am unsure what to do to fixed it.

# Answer
You should double check your `civicrm_settings.php` file. Particularly the section on File System Paths. Make sure the setting `$civicrm_root` is the correct path to civicrm for the new server.

Hope this helps...
> 3 votes

# Answer
WP Engine is a quirky host--it makes lots of configuration decisions for you with the goal of optimizing for WordPress sites, but that often makes things more difficult for CiviCRM. This is in stark contrast to Linode, where you have full control over your hosting configuration.

A `500` error could be any number of things; you'll need to find a log message to tell you more, and I'm not certain where exactly this is on WP Engine.

However, for examples of WP Engine-specific quirks, you might look at the following other questions:
> 2 votes

---
Tags: migration, error-page, 500
---


# Question
Title: Civicrm and wordpress user registration after admin approval
so the scenario is that i am using civi profiles for civicrm contact and wordpress user creation by enabling "WordPress user account registration option?" in profile's advance setting.

I am also using 2 other plugins to control access of wordpress users which are "**Ultimate Member**" and "**User Role Editor**". ultimate member plugin has a option by which when a user register it needs admin approval. i have selected that option but its not doing what it has to do. when ever a user register i automatically approves it.

# Answer
> 1 votes
It looks like you would need to create a custom plugin which would play role to interconnect the two features, ultimate member plugin account verification method and automatic wordpress user creation through profile.

In that custom plugin, you would need to use 'hook\_civicrm\_post' hook which will get called every time a DB write is done, make sure to put an if condition right after the hook function definition to make plugin run only when account gets created and in that if condition make call to the function that performs account verification process in 'Ultimate Member' plugins, more detail on how to call a function of wordpress plugin from another wordpress plugin can be found here.

Hope this solution will help you.

---
Tags: wordpress
---


title: Preferred given name for contact

text:
# Question
Title: Preferred given name for contact
I have used other contact systems in the past and as well as first\_name and middle\_name there has been a preferred name field. We have several people who have long first names but they go by a shortened name, additionally we have people who are known by a middle name rather than their first name. What I would like is to display the preferred name as the display name.

# Answer
You can change the display name for a contact in 2 ways

1. By using CiviCRM alter display name hook you can change the Display name to a preferred name.
2. Update the format for Sort name and/or Display name by navigating to Administer \>\> Customize Data and Screens \>\> Display Preference (civicrm/admin/setting/preferences/display?reset=1) and then update the 'Individual Sort Name Format ' and 'Individual Display Name Format' fields as per your choice. (Note: This change will be reflected to contact only if New Individual is added or updated)

HTH

Pradeep
> 3 votes

# Answer
For emails you can do this (considering you are using the Nickname field):

```
{capture assign=nickname}{contact.nick_name}{/capture}
Dear {if $nickname}{contact.nick_name}{else}{contact.display_name}{/if}

```
> 2 votes

# Answer
Also, there ia a nickname in CiviCRM which you can use for this purpose? There is also a setting that allows you to search on the nickname too.
> 1 votes

---
Tags: contacts
---


# Question
Title: Posting photos on our DONATE/ contribution page through Civi
Is there an ideal image size for posting photos on this page? The photo that I want to post keeps getting smushed. I finally found decent dimensions but it the mobile website doesn't keep the correct dimensions.

Let me know!

# Answer
> 1 votes
In my experience the best option is to give the image a width of 100% or at least use media queries to set the width at 100% for mobile

---
Tags: contributions
---


# Question
Title: Application of Discount Code results in crazy amounts, new discount codes do not work
I use CiviCRM for Joomla. After upgrading CiviCrm 4.7.27 to CiviCRM 4.7.29 following problems came up in module CiviEvent using CiviDiscount:

* a EUR discount results in crazy figures (e.g. a 100 EUR discount from 780 turns to be 779.999.999.900,00 instead of 680)
* new discount codes dont work at all

The database cividiscount\_item shows correct values, also the new values are added there. So problems seems to arise after hitting "APPLY" - Button with id and name "\_qf\_Register\_reload" in the CiviEvent-form

It looks like being related to the decimal sign "." or ",", but till now I have no clue checkign the code in cividiscount.php around line 420

Everything worked fine before the upgrade of CiviCRM

# Answer
I found this issue as regression to CiviDiscount ext due to CRM-21562 changes. Submitted a PR https://github.com/dlobo/org.civicrm.module.cividiscount/pull/190 against CiviDiscount ext. Can you please test this patch and if possible provide your feedback in the PR itself, that will be helpful in getting it merged?

Thanks!
> 3 votes

# Answer
This was a recent issue with some recent CiviCRM release.

See CRM-21562: Currencies (like Euro) with a comma for thousand separator are being seriously mishandled for the recent report and fix discussion. The discussion there suggests this issue is believed to be resolved in 4.7.29 - affected sites (like yours) will need to reach out (JIRA or ~dev-financial in CiviCRM chat) to report their experience.
> 0 votes

---
Tags: civievent, cividiscount
---


title: Manually Upgrade Extension

text:
# Question
Title: Manually Upgrade Extension
I wanted to upgrade my Mosaico extension to the latest version. There was no upgrade link on the extensions screen so I downloaded the latest release and replaced the source files. However, the version number is still corresponding to the previous files. Do I need to do anything else to notify Civi that the files have been updated? I know in Drupal you would normally run the database update, but I don't know if there is something similar in CiviCRM? I couldn't find any documentation on a manual upgrade process.

I am running CiviCRM version 4.7.28.

# Answer
> 1 votes
I would suggest you to uninstall the previous version first and then to install the new version - just replacing the files will not do anything.

So, Please replace your previous version of extension in the extension folder - and uninstall it first.

Then do replace your new extension and install the same - that should work as you excepted

Ref: https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/

I guess this helps !!!!

---
Tags: extension
---


# Question
Title: Field Source doesn't appear in Import Contributions
I'm trying to import contributions. I found all the fields except the "Source" field.

Is there any reason for not appearing? Is there a way to show it?

Thanks in advance. :)

# Answer
> 3 votes
The contribution source field is available during import and export. Its labeled as 'Contribution Source'.

---
Tags: contributions, import
---


title: Does CiviCRM support LDAP?

text:
# Question
Title: Does CiviCRM support LDAP?
Does CiviCRM supporting LDAP? Can we have a connection between LDAP and CiviCRM on a WordPress website?

# Answer
> 4 votes
CiviCRM's authentication is through the CMS - so you wouldn't connect CiviCRM to LDAP, you would use LDAP to authenticate to the CMS. All CMSes that support CiviCRM support LDAP authentication.

If you would like to use CiviCRM as your LDAP source (e.g. to populate an address book in your email client with CiviCRM contacts) you can use ldapcivi.

---
Tags: wordpress, ldap
---


title: 'Spark' CiviCRM on a shared server?

text:
# Question
Title: 'Spark' CiviCRM on a shared server?
Our new webhost will not permit us to use CiviCRM on its server due to use of 'triggers' and their unwillingness to grant us 'superuser' admin status. Will the lite version of CiviCRM that is coming out in February (Spark I think) be more acceptable to hosts who use shared servers for tiny not-for-profit organisations? We were using CiviCRM with Wordpress under our previous shared hosting arrangement without any problems but had to change hosts for security reasons and have found that it is no longer compatible in shared hosting environments. Is separate dedicated CiviCRM hosting our only future option? Karen

# Answer
> 3 votes
CiviCRM is compatible with shared hosting. It always has been. The host needs to support the server-side features that CiviCRM requires, however, and not all do.

There is a page on the CiviCRM site here: https://civicrm.org/hosting-providers with a list of such hosts, and most of the hosts there have shared hosting.

# Answer
> 3 votes
You don't need superuser status to use triggers on modern versions of MySQL (5.5+). Of course, your host may just choose not to support triggers, in which case they're unsuitable for hosting CiviCRM.

# Answer
> 2 votes
You could decide to move to a specialized CiviCRM hoster? You can find some on the list here: https://civicrm.org/partners-contributors?country=All&services=Hosting&language=All&cms=All

---
Tags: hosting, civicrm-spark
---


# Question
Title: How to add extra text field in Civicrm Contribution page?
I want to add text field in Civicrm Contribution Setting Page (CRM\_Contribute\_Form\_ContributionPage\_Settings). Please any one help me

# Answer
You can create custom field from civicrm UI and add that field to your contribution page.
> 2 votes

# Answer
Do you need field associated with contribution page or contribution?

**For contribution**:

You can create custom group extending contribution and then add custom field in it and then include the custom field in a profile.

**For Contribution page:**

Currently CiviCRM doesn't allow to create custom field to extend contribution page. JMA Consulting have developed an extension to have custom field extend contribution page. This extension is not yet released in civicrm.org but they are hoping it to release it soon. You can try by downloading and installing manually.
> 1 votes

# Answer
If you can clarify the goal you want to achieve then it would be better to explain but i believe you can add text field in contribution settings page itself using hook\_civicrm\_buildForm and putting an if condition for variable `$formName` to be equal to 'CRM\_Contribute\_Form\_ContributionPage\_Settings' alongwith with form\_id which will be the contribution page id.

If your question was to add custom field in contribution page, you can achieve that by creating a custom field, then create a new profile and include custom field in that profile and in the end include the created profile in contribution page settings in 'Profiles' tab.
> 0 votes

---
Tags: drupal, civicontribute
---


# Question
Title: Self-Service Payments for Contribution (Tuition)
CiviCRM 4.7.x and Drupal 7

Requirement:

* Staff creates "Pending" or "Partially Paid" contribution in CiviCRM backend.
* User can log on to a page, and make payments against that Contribution until it is paid in full.

Is there any way to do this with CiviCRM or Webform CiviCRM? Would 'Pledges' work?

Alternatively - could we create a Webform-CiviCRM that creates the contribution, and lets someone come back and apply payments to it, displaying the remaining balance? Thanks!

# Answer
You can certainly achieve this

1. Create a Contribution Page by enabling Other amount and payment processor.
2. Navigate to Administer \>\> CiviContribute \>\> CiviContribute Component Settings and select contribution page create at #1 for **Default invoice payment page**
3. Create a contribution for a contact with **pending** status.
4. On User Dashboard of contact (/civicrm/user?cid=\[contact\_id\]) under contribution section you will see pay now button against the pending contribution. When clicked on pay now it will redirect to online contribution page where one can pay pending contribution online using credit card.
5. You can also generate the link to pay pending contribution online `http://domainname.com/civicrm/contribute/transact?reset=1&id=[contribution_page_id]&ccid=[contribution_id]`

where contribution\_page\_id(id) is contribution page id created at #1 and contribution\_id(ccid) is contribution id created at #3.
> 5 votes

# Answer
In order to achieve this you would need to write a custom extension for partial payment, this video might help you: https://www.youtube.com/watch?v=Sxu2vdOrYO8&index=6&list=PLjSU7YfE0E01HW7JPVAI80XDI0sgOSPDs

Github repo: https://github.com/backoffice/BOT-Partial-Payment-Extension
> 1 votes

---
Tags: civicontribute, webform-civicrm
---


# Question
Title: "Unsupported html-element" error when trying to create or edit a contact record after upgrading to 4.7.13
I upgraded from 4.5.4 to 4.7.13 (on Drupal); I didn't receive any errors during the upgrade process, but now when I try to create or edit a contact, I get an unsupported html-element, similar to what was reported at After upgrade to 4.7 on Drupal 7, Can't edit a contact.

The backtrace looks like this:

```
#0 /var/www/drupal/sites/all/modules/civicrm/CRM/Contact/Form/Edit/Individual.php(77): CRM_Core_Form->addField("prefix_id", (Array:3))
#1 /var/www/drupal/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php(755): CRM_Contact_Form_Edit_Individual::buildQuickForm(Object(CRM_Contact_Form_Contact))
#2 /var/www/drupal/sites/all/modules/civicrm/CRM/Core/Form.php(548): CRM_Contact_Form_Contact->buildQuickForm()
#3 /var/www/drupal/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#4 /var/www/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contact_Form_Contact), "display")
#5 /var/www/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Contact), "display")
#6 /var/www/drupal/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#7 /var/www/drupal/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#8 /var/www/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Contact", "New Contact", (Array:1))
#9 /var/www/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#10 /var/www/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#11 /var/www/drupal/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3))
#12 [internal function](): civicrm_invoke("contact", "add")
#13 /var/www/drupal/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#14 /var/www/drupal/index.php(21): menu_execute_active_handler()
#15 {main}

```

Additionally, when I disable displaying the prefix (in Administration -\> Option Groups -\> Contact Edit Options) the top error line becomes:

```
#0 /var/www/drupal/sites/all/modules/civicrm/CRM/Contact/Form/Edit/Individual.php(77): CRM_Core_Form->addField("first_name", (Array:0))

```

Obviously, I don't want to disable the first name as well.

# Answer
> 1 votes
This is a known issue and applying following patch should fix this issue. https://github.com/civicrm/civicrm-core/pull/7770/files

---
Tags: drupal, contacts, upgrade, error
---


# Question
Title: Show the CiviCRM simple donate form on Drupal static page or node.
I am using Simple Donate version 1.2 I am trying to integrate 'simple donate' extension for drupal page and/or block.

I have tried it by initializing civicrm in custom block. CiviCRM is getting initialized properly.

I have jut tried to load /partials/simpledonate.html file using code in following file: com.webaccessglobal.simpledonate-1.2/js/simpledonate.js

```
$routeProvider.when('/donation', {
        templateUrl: resourceUrl + '/partials/simpledonate.html',
        controller: 'SimpleDonationCtrl'
      });

```

if the URL is '/donation' then it will load /partials/simpledonate.html But it is not working.

Can anyone put the idea i.e. how to load CiviCRM extension in drupal block or page?

Any idea is appreciable..

# Answer
You can make a use of Webform CiviCRM Integration module which integrates civicrm donation pages with webform and webform can be used as block anywhere in the node, for that you would need Webform blocks module.
> 1 votes

---
Tags: drupal, extension, simple-donate-form
---


# Question
Title: Prefered Communication Preferences boxes not set on profile page using Joomla
I'm using CiviCRM 4.7.29 with Joomla 3.8.3.

We've got a Joomla page connected to a CiviCRM profile definition which allows normal Joomla users to edit there CiviCRM address details and communication preferences. The problem is that the communication preferences checkboxes are never preset to the value stored in the CiviCRM database, the boxes are always unchecked regardless of the underlying stored value. So every time a user edits there address, the stored communication preferences get wiped out, unless they notice and re-tick them manually before clicking save (which rarely happens).

Has anybody else encountered this problem? How would I go about fixing it?

# Answer
This is a core bug logged at CRM-21644. You can apply the patch manually to make it work or will need to wait for 4.7.31 to release.
> 1 votes

---
Tags: joomla
---


# Question
Title: How to add Custom fields in civicrm contribution page?
How to add Custom fields in civicrm contribution page - below the title text field of contribution page form

# Answer
> 2 votes
1. Under Administer \> Custom Data and Screens, Create your Custom Fields
2. Under Administer \> Profiles, Create a Profile that has your Custom Fields in it.
3. Under Contributions \> Manage Contribution Pages, select the Page you want it to appear on. Under the Include Profiles tab, add that Profile. You can add it at the a) "top" (with the donor profile) this is below the price sets/contribution amounts but above the billing info or b) "bottom" of the Contribution Page just before the Confirm button. Those are the only two location options for placing Custom Fields on a contribution page.

You cannot make it appear right under the title.

# Answer
> 2 votes
Do you need field associated with contribution page or contribution?

**For contribution**:

You can create custom group extending contribution and then add custom field in it and then include the custom field in a profile.

**For Contribution page:**

Currently CiviCRM doesn't allow to create custom field to extend contribution page. JMA Consulting have developed an extension to have custom field extend contribution page. This extension is not yet released in civicrm.org but they are hoping it to release it soon. You can try by downloading and installing manually.

# Answer
> 0 votes
1. You can create custom fields through Administer-\>Customize Data and Screens-\>Custom Fields
2. Then create a profile through Administer-\>Customize Data and Screens-\>Profiles and use created custom fields in profile
3. Use the created profile in contribution page where you want the custom fields, you can add the profile in contribution page settings in 'Profiles' tab.

---
Tags: drupal, civicontribute, civicrm-home
---


# Question
Title: Pledge payment off contact dashboard: "DB Error: No Such Field"
Drupal 7 / CiviCRM 4.7

When I create a Pledge and view it in my contact dashboard, I can see all of my pledge payments and their dates. If I select "Make Payment" it sends me to a page like: civicrm/contribute/transact?reset=1&id=31&pledgeId=3 and then errors out, "DB Error: No Such Field".

Is this implemented currently in CiviCRM, or is there a configuration missing?

# Answer
This is a known bug and is documented and fixed at CRM-21465. You will need to apply the patch to fix the problem or will need to wait for 4.7.30 release.
> 2 votes

---
Tags: pledges
---


title: How to remove notice at login

text:
# Question
Title: How to remove notice at login
When users login right now (Jan 4, 2018) they get a notice publicising CiviCamp 2018. For 99% of users this notice is inappropriate. How do I remove it? I know it can be removed via some update to civicrm settings file but can't find how to do this.

# Answer
> 6 votes
This is a preference you can set, but it's not exposed in the web interface. There's a section of `civicrm.settings.php` that documents it. In case you've upgraded from an older version of CiviCRM that doesn't have it, I'm including it here:

```
 // Opt-out of announcements by the CiviCRM core team for releases, paid services, events, etc. Separate each preferred optout category with a comma:
 //   "offers": paid service offers
 //   "asks": requests for donations or membership signup/renewal to CiviCRM
 //   "releases": major release announcements
 //   "events": announcements of local/national upcoming events
 $civicrm_setting['CiviCRM Preferences']['communityMessagesUrl'] = 'https://alert.civicrm.org/alert?prot=1&ver={ver}&uf={uf}&sid={sid}&lang={lang}&co={co}&optout=offers,asks';

```

More documentation is available at in the CiviCRM Administration Guide, see page Customization \> Override Settings.

# Answer
> 3 votes
Thanks Jon G for providing the solution to turn off the community messages.

However, as one of the organizers of CiviCamp Brussels 2018, I am very happy with this feature. It's an effective way to reach civi users who are not on your own mailing lists and who might otherwise miss the event.

They would miss an opportunity to engage with the community. And the community is an essential aspect of open source software. Even if the event is not in their area, at least they realize that civi users get together to share knowledge and exchange ideas.

---
Tags: 4.7, 4.6, civicrm.settings.php, ux
---


# Question
Title: CiviCRM/Drupal site constantly logging user out
Drupal 7.56 and CiviCRM 4.7.27

I have a site that uses very few add-ons (Views and Chaos tools in Drupal, API csv import in CiviCRM), and a few word replacements with the Grant module. Otherwise, it's an out-of-the-box set up.

Users are frequently logged out for no obvious reason. It's not the same action that triggers it so I can't pin it down to a particular error. My error logs showed a theme hook error but I've switched to a different theme and still not resolved the issue.

My recent log messages look like this (ignore the 'login attempt failed'):

And my top 'Access Denied' errors look like this

# Answer
> 1 votes
One explanation is that, rather than being logged out of the site, your users are being moved from a site they *are* logged into to one that they *aren't* logged into. If your site is served via `https://www.example.org`, you might see users "suddenly be not logged in" when they visit any of the following:

* `https://example.org`, or
* `http://example.org`, or
* `http://www.example.org`

If your CMS site isn't configured to "lock in" a specific canonical URL (including protocol and hostname), CiviCRM may bounce people from another URL which they are logged into over to the URL CiviCRM thinks is "correct" (per CiviCRM's `civicrm.settings.php`). When this happens, the user experience is that they get logged out (but they will then be mysteriously logged back in if they visit the URL they were logged in on before).

Drupal isn't fussy about having a canonical URL, but CiviCRM is, and it's good practice anyway.

If this is the behaviour you're seeing, your best bet is to configure your CMS / webserver / `.htaccess` to enforce a canonical URL (single hostname and protocol), so that all visitors to alternate URLs are immediately moved over to the preferred / canonical base URL.

---
Tags: error, user-account
---


# Question
Title: How do Cividiscount codes work when used with a price set?
I may be missing something obvious here, but...

I create a contribution page that makes use of a price set. The price set includes a number of radio button price options. I create discount code that provides a discount against one of these price options. When I view the live contribution page, there is no field displayed where I can enter my discount code. I can recreate this on the demo site at http://dmaster.demo.civicrm.org

# Answer
> When I view the live contribution page, there is no field displayed where I can enter my discount code.

Make sure the contribution page uses the Membership section. There is no discount functionality for *only* Donation pages as far as I can see from the usage section.

Also see Can CiviDiscount be used on a Contribution Page without Membership
> 2 votes

---
Tags: cividiscount, discounts
---


# Question
Title: How to check if a contact has an active membership in a smarty template?
Is there a variable that one can use in smarty in a message template to simply determine if a contact has an active membership?

# Answer
> 4 votes
Don't think you have a direct variable to use in the template. Worth trying an extension to provide this? It can be done by simply writing something like below in your hook.

```
function yourextension_civicrm_postProcess($formName, &$form) {
  if ($formName == "your_form") {

    //Check if user has an active membership of type "General".
    $activeMembership = civicrm_api3('Membership', 'getcount', array(
      'contact_id' => <contact_id in $form>,
      'active_only' => 1,
      'membership_type_id' => "General",
    ));

    //Assign a new variable to the template.
    $form->assign('activeMembership', $activeMembership);
  }
}

```

You can now use this variable as `{$activeMembership}` in the template to check if user has a membership of the req type.

# Answer
> 4 votes
You can use CiviCRM api through smarty to retrieve if membership is active for a contact. You can achieve this by

1. Turn on CIVICRM\_MAIL\_SMARTY (set to TRUE or 1) in civicrm.settings.php
2. add below api snippet in your message template

($result will hold result of api call)

```
{capture assign=contactId}{contact.contact_id}{/capture}
{crmAPI var='result' entity='Membership' action='getcount' sequential=0 contact_id=$contactId membership_type_id="General" active_only=1}
{if $result gt 0}
  'active membership'
{else}
  'not active'
{/if}

```

HTH

Pradeep

---
Tags: email, message-templates, smarty
---


title: How to enable components?

text:
# Question
Title: How to enable components?
hello I currently use CiviCRM 4.7.29 with Drupal

I activated the CiviCase, CiviCampaign and CiviGrant components but I do not see the associated menus in the bar.

did I forget to do something?

sorry in advance if the question has been asked, I have not found an answer

Regards,

# Answer
> 4 votes
Are you logged in using super admin user(i.e user id = 1)?

Here are some advice to solve the issue:

1. Recheck visiting component page if the components are enabled.
2. Please check Drupal permission.
3. Clear Drupal and CiviCRM cache.
4. Check Navigation links for Grants, Case etc by navigating to Administer \>\> Customize Data and Screens \>\> Navigation menu
5. Do menu rebuild /civicrm/menu/rebuild?reset=1

HTH

Pradeep

---
Tags: modules
---


title: Event booking for multiple guests

text:
# Question
Title: Event booking for multiple guests
If a client is trying to book an event for multiple guests, is that possible to book (and pay online) without having to book himself? It is very common for a PA to book for bosses, or a junior staff to book for senior staff. The PA and the junior staff do not need to book the event for himself. Is this possible? Thanks!

# Answer
Yes, One can register for events on behalf using backend form or front end form.

Backend:

Navigate to Events \>\> Register Events Participants. Select Contact and Event to register.

Front End:

Visit online page by navigating to Events \>\> Manage Events. Click on Event links against the event you want to register and then click on Registration(live). If you are logged in than online form will pre populate with your details, to register other contact click on the link (Not Pradeep, or want to register a different person?) as shown in below image.

Here you will get 2 options

1. To select Contact from auto select field. (if user have permission to view contacts in system)
2. Create registration for new contact. In this case if CiviCRM finds duplicate match of this contact (using rule defined in dedupe rule) than it will update the existing contact in CiviCRM.
> 2 votes

---
Tags: civievent
---


# Question
Title: Search for Individuals with Employee Relationship for Organisations with Certain Criteria
We have a custom organisation option field showing the "Membership Type". I want to do a search (create a smartgroup) to find all individuals with a relationship "Employee of" for organisations that have specific membership types. So for example, I wish to find all employees of organisations with a membership type of "Current". Can anyone show me how I can achieve this? I do not want to use Drupal views.

# Answer
Try using existing search forms.

1. Search \>\> Advance Search
2. Search \>\> Search Builder
3. Other option would be to create a smart group having organization contact with specific membership type and then use advance search to search employee of with target contacts in group.

HTH

Pradeep
> 1 votes

---
Tags: search, relationships, smartgroups
---


# Question
Title: Outlook For CiviCRM - How to bypass activity confirmation dialog?
**Background:** When *Outlook For CiviCRM* is properly installed, configured and enabled, a confirmation dialog titled *Confirm Activity* appers for every email that is going to be sent. We would like very much to use this extension, but in our daily business can't afford this extra step and the delay caused by it.

**Question:** Is there a way to setup a default confirmation for this *Confirm Activity* dialog?

# Answer
> 3 votes
Outlook-CiviCRM documentation says that the confirm dialog box can be turned off through UI.

```
Prompt for All emails?: If this setting is enabled - While sending emails, you would always be asked whether you want to record this email in CiviCRM (A small pop up confirmation box would appear). If you don't want to be asked every time and just want to record every email you send, turn this setting off

```

HTH

Pradeep

---
Tags: extension
---


title: Customise Contacts Relationships Tab

text:
# Question
Title: Customise Contacts Relationships Tab
I want to customise the contacts relationships tab screen to show if the listed contacts (Individuals) belong to a specific group or not. I'm not sure where to start and would appreciate any pointers. I wasn't sure whether I needed to customise a template or create an extension that uses a hook...

# Answer
You can achieve this through following ways:

1. Create ACL rule through UI to View Contact of specific group.
2. Create an extension and use pageRun hook to alter the $rows send to smarty template.
3. Create an extension and use aclWhereClause hook to restrict contacts to show.
4. Probably not sure apiWrappers or selectWhereClause might also be used.

Note: Using #1 and #3 will be affected on all pages/forms/reports.

HTH

Pradeep
> 2 votes

---
Tags: relationships, hooks, templates
---


# Question
Title: Why am I getting Javascript errors/ unable to save when creating a new mailing?
Trying to figure out why I keep getting javascript errors and not being able to save when trying to create a new civimail mailing on WordPress / CiviCRM 4.7.27. It is a fresh install. Not sure what is going on.

Anybody have any good ideas on why this may be happening?

# Answer
> 3 votes
Got rid of WP Super Cache and Wordfence. No longer getting the errors. Thanks for the help tho!

---
Tags: wordpress, civimail
---


# Question
Title: How to extract views integration setting from the command line?
Is there a way to output from the command line the views integration settings as listed in Administer \> System Settings \> CMS Database Integration? I need this as part of our upgrade script to automatically update settings.php (rewriting a php include file) every time a system upgrade is released.

# Answer
> 1 votes
It is possible, you can code it (and because you are a scripter I suppose you are a coder). In CiviCRM, the views settings are generated in the with file https://github.com/civicrm/civicrm-core/blob/master/CRM/Admin/Form/Setting/UF.php

I used this as inspiration to create the following script

```
<?php
$config = CRM_Core_Config::singleton();
$dsnArray = DB::parseDSN($config->dsn);
$tableNames = CRM_Core_DAO::getTableNames();
$tablePrefixes = '$databases[\'default\'][\'default\'][\'prefix\']= array(';
$tablePrefixes .= "\n  'default' => '$drupal_prefix',"; // add default prefix: the drupal database prefix
$prefix = "";
if ($config->dsn != $config->userFrameworkDSN) {
  $prefix = "`{$dsnArray['database']}`.";
}
foreach ($tableNames as $tableName) {
  $tablePrefixes .= "\n  '" . str_pad($tableName . "'", 41) . " => '{$prefix}',";
}
$tablePrefixes .= "\n);";

echo $tablePrefixes;

```

Run this script with the CiviCRM `cv` utility (see https://github.com/civicrm/cv) as follows.

```
cv scr <scriptname.php>

```

I tested this on CiviCRM 4.7.27

---
Tags: drupal-views, developer
---


# Question
Title: Unable to install CiviCRM 4.7 on Wordpress 4.4.1
Environment:

PHP Version 5.6.15

Apache 2.4.17

MySQL 5.6.27

Windows 10

Wordpress Plugins Active: Exclude Pages from Navigation, Ninja Forms, Ninja Forms - Layout Master

When attempting to install CiviCRM on my local dev platform described above, I am following the instructions as detailed at https://wiki.civicrm.org/confluence/display/CRMDOC/WordPress+Installation+Guide+for+CiviCRM+4.5

Everything is fine until I click the "Check Requirements and Install CiviCRM" button - a spinner briefly appears next to it before the frame on the admin page goes blank (menu and toolbar remain) and the entire page appears to be attempting to refresh. Then after a few minutes of loading I am left with a URL ending `wp-admin/?page=CiviCRM&q=civicrm&reset=1` \- and a white screen.

If I navigate back to my admin console and attempt to go into the CiviCRM plugin I get the following error message:

> Fatal error: Uncaught CRM\_Core\_Exception: \[0: Found installation canary. This suggests that something went wrong with tracking installation process. Please post to forum or JIRA. thrown in (*MyWordpressHomeFolder*)\wp-content\plugins\civicrm\civicrm\Civi\Core\InstallationCanary.php on line 53

I have tried manually deleting the civicrm\_install\_canary table but that does not resolve the issue...

# Answer
> 1 votes
First try to increase the max\_execution\_time of your server in php.ini file. As the post installation process may take time long enough that time out occurs.

Also you can find more about the Installation Canary here.

Hope this helps.

---
Tags: wordpress, installation, 4.7
---


# Question
Title: No matches found for contact reference field in front end profile
Duplicated on Wp and Drupal Demo sites Custom field of type contact reference used in front end profile for search and listings (public) Search returns “no matches found” even though contact name appears in field Logged in as admin

Entering nothing in search fields and pressing search lists all contacts in database. I don't get why a single contact from the contact reference field is "no match"

# Answer
> 2 votes
Can you please check if Adams, Lou is saved in custom field for any contact in your system? The profile search that you have created will list all the contacts having Adams, Lou saved in their respective custom field.

I guess you trying to create a profile search that will list details of a contact by selecting contact from a drop down.

---
Tags: profile
---


# Question
Title: How does in-line editing editing work in CiviCRM?
Is there a reference anywhere for the in-line editing, e.g., 'Click Here to Edit' in CiviCRM? I need something similar for my extension and want to reuse as much as I can.

# Answer
> 3 votes
Assuming you have an API that allows to modify the entity you want (if it's a custom one, it's easy to add), adding a few classes should be enough to enable the edit in place. You need to define the entity that contain the field (class crm-entity, id "type-{id}" on a containing dom node and then "crm-editable crmf-{fieldname}". for example:

```
<table>
  <tr class="crm-entity" id="contact-123">

    <!-- textfield (default type) -->
    <td class="crm-editable crmf-first_name">Fred</td>

    <!-- select list with empty option -->
    <!-- (note: options will be fetched automatically by the api) -->
    <td class="crm-editable crmf-prefix_id"
        data-type="select"
        data-empty-option="{ts}- none -{/ts}">Mr.</td>

    <!-- yes/no select -->
    <td class="crm-editable crmf-is_deceased" data-type="boolean">
      No
    </td>

  </tr>
</table>

```

More details in the doc

https://docs.civicrm.org/dev/en/latest/framework/ui/#in-place-field-editing

---
Tags: extension, developer
---