# Question
Title: 100% mailing have bounced : validation failed for <(INVALID)>
Hello after two modifications on the server and on CiviCRM, it becomes impossible to send any mailing. All the email adresses are "burned" with all the email addresses being wrongly tagged as bounced. In the Report, the **Bounce Type** is for all emails indicated as **Invalid**.

**Some symptoms** : The table **civicrm\_mailing\_event\_bounce** indicate for all mails adresses in the bounce\_reason this problem :

`Validation failed for: "(INVALID)" <(INVALID)>`

The **bounce\_type\_id** in the is #6 which is **Invalid** : *Email address is not valid* Of course the setting in admin/options/**from\_email\_address** (From Email Address Options) have been verified, they are OK.

In the table civicrm\_mailing\_bounce\_pattern there is 24 different patterns from the bounce\_type\_id #6.

**There is then two clues** : The server had been recently moved under PHP7.2 and CiviCRM had been enabled to handle the Multi Site Configuration with the extension CiviCRM Multisite (org.civicrm.multisite).

Did someone experimented and solved this trouble ?

Thanks for any help.

* The CMS is Drupal 7 with CiviCRM 5.4.1 on a Debian 8 server
* The bounce email boxe is located on a different Debian 8 server with Postfix Mail Server Postfix version 2.11.3

# Answer
> 2 votes
So I found the problem. Thanks to @HomoTechsual who lead me in the right direction.

The reason had been found in the **Settings - Outbound Mail**. It was set to **mail()** with a success message : `Your SENDMAIL settings are correct. A test email has been sent to your email address.` That looked good but in fact the message was never sent by the server ! Trusting this message, I did forget to check if the test email really arrived to email address. My mistake : always double check.

After I changed the setting to SMTP with all the right setting of the mail server, I still got the success message but the message arrived in the mailbox. After I removed the bounce tag for each email address, I could make a test mailing that went fine this time ;-)

So the issue was from the mail server. The issue was not with CiviCRM. Something probably related to the DNS is not working on the server. This made CiviCRM confused about the mailing. From now Civimail works well with the **SMTP set** in the Settings - Outbound Mail. I the case of my server this is the only option.

UPDATE : In this case it seems that a group of several issues happened. I found another thing that could be at the origin in the table civicrm\_mailing : both from\_name and from\_email are set to (INVALID)

```
from_name From Header of mailing (INVALID)
from_email From Email of mailing (INVALID)

```

Yet I have no clue how this happened but there now a clear link with `validation failed for <(INVALID)>` I did not find why chosen email provoque that. It might be related with multi-site extension. Now I can manage the mailing with an another email address.

---
Tags: civimail, mailing, multisite, bounce, drupal-multi-site
---


# Question
Title: Drupal Core Search to show results from CiviCRM Events data along with drupal content results
I'm looking for a solution to extend Drupal Core Search functionality to fetch results from Civicrm Events.

Did anyone tried or achieved this? Is there any module to achieve this? any configurations? or any pointers please?

Does CiviCRM Entity module helps to achieve this?

I want drupal to search CiviCRM events along with entire drupal site when someone search for event related content

TIA

# Answer
Good Question! I have three different ideas for answers to this questions, but I'll lump them all here.

First off, we've used Search API module with CiviCRM Entity with success a number of times. If you have an option to use Search API, because it is easier to setup search indexes without code. You might check out that module to create a more powerful site search.

2nd option, register your own search index. It will be a coded solution, there is no module I am aware of to do what is necessary.This could get to be a complex answer, so first I'll say you will have to making a custom module, if you aren't comfortable with that, then likely best course is to use Search API..

You must have the code from the "CMS Database Integration" CiviCRM page added to your settings.php , civicrm/admin/setting/uf?reset=1

See the Drupal API documentation for hook\_search\_info()

You'll need to implement that hook to register a search page for the CiviCRM Event entity type...see in the description of the hook\_search\_info() documentation, at a minimum hook\_search\_execute() and hook\_update\_index() . They given a pretty good example of how nodes are integrated into Drupal Core search, and the same methodology can be applied for CiviCRM Events or other entity types. The CiviCRM Entity module would be a requirement to use the same methodology.

3rd option. If you have event related content types, you could add a entity reference field that reference the CiviCRM Events. In that case you might only need some little bit of code, that could modify the search for those event related nodes, to index the referenced event data along with the node that references the event. See hook\_node\_update\_index() . In the example provided, they are adding some information about a node's comments to the node's indexed text...a similar procedure could be used to add data from the referenced event. CiviCRM Entity would again be required, as this is how you can reference CiviCRM events from node types..

Let's start there and see where it goes. Sounds like a fun project!
> 1 votes

---
Tags: drupal, civicrm-home, civicrm-entity
---


# Question
Title: Profile for Drupal User Registration not functioning
Our simple "My Details" profile for Drupal User Registration is not functioning.

The profile adds fields for First Name, Last Name and Birth Date to the Drupal User Registration page.

But when a new user registers, an account is created but the profile field information is not saved. Even the field names (mostly) are not shown on the new users page (see second image below). A Civi contact is created with just the Drupal email address.

Even if admin user tries to add those details via the Drupal user page, the information is not saved. If added via CiviCRM, the contact information does appear in the Drupal accounts.

I've tried creating a new registration profile with just First and Last Name and disabling the existing one - same result.

We have latest Civi version 4.7.25 and Drupal 7.56. No errors in Drupal logs at time of account creation. Several modules including Mollom, Webform-Civi Integration, Civi-Rules Integration, LoginToboggan, Views etc. installed.

Any suggestions on how we can debug this appreciated!

Phil Hart - Camp Cooinda - CiviCRM Member

# Answer
We engaged Fuzion to resolve this, who systematically disabled all modules to find the offending one.

The issue was caused by the Page Manager module, which was overriding the user/%/edit pages (admin/structure/pages). This override was empty, and I'm unsure why it was enabled - but by disabling it the civicrm profile forms are fixed. This also resolves the issue we were observing where an administer role was being removed upon submitting this form.

One further step was required, which was to disable a redirect to the webform we had in place after a new user was created (configured here: admin/structure/trigger/user). It appears what was happening is that the redirect is stepping in after the user is created, but before CiviCRM had time to react to the new information.
> 0 votes

# Answer
Check your Drupal CiviCRM permissions, particularly the following:

* CiviCRM: profile create (anonymous users)
* CiviCRM: access all custom data (anonymous and authenticated users)
* CiviCRM: profile edit (authenticated users)

Also, check the profile settings: click "fields" and make sure none of them are "view only".
> 1 votes

# Answer
Have found something for you in Google to start from, not sure if it helps, yet, you may want to to have a look:

https://docs.civicrm.org/sysadmin/en/latest/setup/users-contacts/

https://forum.civicrm.org/index.php?topic=30064.0 (form year 2013)

https://www.google.com/search?q=civicrm+drupal+profile+sync (if anything else fails)
> 0 votes

---
Tags: drupal, user-account
---


# Question
Title: Fresh WP install succeeds then fails - path or permissions problem?
I've followed the install instructions on docs.civicrm.org site to make a fresh installation of CiviCRM in Wordpress on a local server (Synology NAS running Linux kernel). All went fine, leading to message that CiviCRM was successfully installed but then screen refreshed to show this warning:

> Warning: include(/volume1/web/wp-content/uploads/civicrm/templates\_c/en\_US//%%E6/E65/E656EDCD%%wordpress.tpl.php): failed to open stream: No such file or directory in /volume1/web/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1270 Warning: include(): Failed opening '/volume1/web/wp-content/uploads/civicrm/templates\_c/en\_US//%%E6/E65/E656EDCD%%wordpress.tpl.php' for inclusion (include\_path=

The CiviCRM admin page is blank except for this warning. I notice that there is a double // in the path to the compile directory. Could that be a bug?

The path exists down to \[..\]/templates\_c/en\_US/ but there are no folders below that. I have checked that /en\_US/ has permissions 755.

# Answer
The civicrm files directory `/volume1/web/wp-content/uploads/civicrm` don't have required permission. Either change the ownership of the directory or give 755 permission.
> 1 votes

# Answer
If you look in that folder '/volume1/web/wp-content/uploads/civicrm/templates\_c/en\_US//%%E6/E65/', does that file (E656EDCD%%wordpress.tpl.php) exist? Or, instead of that file, something like WRTXXX.TMP is there instead?

See my issue: New Install Civi 5.4.0 getting Uncaught Symfony Rename Error and Blank Screen
> 0 votes

---
Tags: wordpress, installation
---


# Question
Title: Webform contact autocomplete only searches the first character of external ID
I have a webform set up with a contact autocomplete box, searching using the external ID. Our external IDs are in the format ec1234567.

The problem I have is that when searching for a contact, it starts to autocomplete on the first character 'e' (and shows the results as it should), but when entering the second character 'c' and subsequent digits, it shows no results, only the 'create contact' option.

Does anyone have any ideas why this might be, and what could be done to make it search for the full external ID?

# Answer
> 1 votes
For a large org who also could not use any Name autocomplete (just too many Contacts) - I create a Enter Contact ID Form Widget (for \_contact\_existing). If you adapt your processes to do lookup by Contact ID - this new Widget is in current versions of Webform CiviCRM module. If you continue to want to lookup by External ID - have a look at the code and mimic it after this example or alternatively sponsor a bit of time and we'll be happy to get that done for you.

# Answer
> 0 votes
Not sure of the answer to that exact question, but: why not include both Display Name (first name, last name) or Sort Name (last name, first name) as well as External ID in the lookup for Existing Contact? Then, the user can search by name, and choose the correct record based on External ID (if there is more than one user with the same name).

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


# Question
Title: New Install Civi 5.4.0 getting Uncaught Symfony Rename Error and Blank Screen
I installed CiviCRM 5.4.0 locally under both Apache and IIS 6 (PHP 7.0) and did not get this error, but the every time I try to installing it using shared hosting (Everleap - IIS 8, PHP 7.0) the install fails with:

Uncaught Symfony\Component\Filesystem\Exception\IOException: Cannot rename "C:\home\site\wwwroot\wp-content\uploads\civicrm\templates\_c\Cac3AA.tmp" to "C:\home\site\wwwroot/wp-content/uploads\civicrm\templates\_c/CachedCiviContainer.e5d039483e5b5fef124d645e968cad32.php"

Now, I can verify that the file exists (Cac3AA.tmp) in the templates\_c folder, so I know the install process created that file (has write access to the folder). However, the rename fails. Anyone see that before?

# Answer
Problem resolved. The bug is in fact that the PHP rename function running on Windows Server can't handle a double slash (\\\) in the path name. I made three changes (so far).

Symfony - Filesystem.php line 272
`if (true !== @rename(str_replace(array("\\\\", "\\/"), "\\", $origin), str_replace(array("\\\\", "\\/"), "\\", $target))) {`

Smarty.class.php line 1253
`$_smarty_compile_path = str_replace(array("\\\\", "\\/"), "\\", $this->_get_compile_path($resource_name));`

Smarty - core.write\_file.php line 45
`@rename(str_replace(array("\\\\", "\\/"), "\\", $_tmp_file), str_replace(array("\\\\", "\\/"), "\\", $params['filename']));`
> 1 votes

---
Tags: wordpress, symfony
---


# Question
Title: Database in unexpected version (and we have no backup DB)
Applied the 5.3.2 patch to our WP site yesterday, and in so doing upgraded the database to 5.6.alpha1. After doing this, multiple components (Contributions, Events, Mailing) became unusable. Trying to access these caused 500 (server) errors. Meanwhile, Civi 5.4.1 dropped, so I replaced the 5.3.2 patched code with 5.4.1 -- but couldn't update the database, because it was still 5.6.alpha1.

"No problem," I thought -- I can restore the WP database from a backup. But the only backup I had was from after the 5.3.2 patch, i.e. in the 5.6.alpha1 state. And as luck would have it, the hosting provider's backup on the server was corrupt and couldn't be restored.

So here's my dilemma. System Status tells me I need to "determine the correct version corresponding to your current database state." Should I try to manually alter the working database so it aligns with the 5.4.1 codebase (and if so, how do I even begin to do that)? Or do I try to reapply the 5.3.2 patch and hope to somehow fix the server errors? Or do I apply a different codebase entirely?

The error message also suggests fixing the file civicrm-version.php -- so I set the 'version' value to '5.4.1' but no luck. I still get this:

```
Your database is marked with an unexpected version number: 5.6.alpha1. The v5.4.1 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using until you resolve this problem. OR if this is a manual install from git, you might want to fix civicrm-version.php file.

```

**How best do I fix this?** And since Civi appears to be running okay right now despite having different codebase and database versions, **is it possible the database version is somehow misidentified** -- that the DB version is really 5.4.1, but identifies itself as 5.6.alpha1? Images (bottom) showthe current DB structure.

As an aside, I've just learned a valuable lesson. **Always store a DB backup locally before starting an upgrade**, even when two automatic backup systems are running. If I had backed up manually, right now I'd be moving other projects forward instead of trying to remedy this version mismatch on an active production site.

---

# Answer
> 2 votes
Ahh did you upgraded to unstable version of CiviCRM? The last stable release i see is 5.4.1. Try replacing the civicrm code base to 5.4.1 and then update the civicrm\_domain.version to 5.4.1 and also truncate all cache tables and anything under template\_c folder.

---
Tags: database, 500, version
---


# Question
Title: Bug?: Repeat activities won't accept edits after 4.7.31 upgrade
We've noticed that we cannot edit recurring activities after upgrading to 4.7.31 on WordPress 4.9.4 running PHP 5.6.34.

On making a change to any activity in a series and hitting "Save", we get the usual three options:

**How should this change affect others in the series?**

* Only this activity
* This activity onwards
* Every activity

However, on selection, none of the options are working and the system continues to display the activity in editing mode.

This also is the case if we try to delete the Activity by clicking delete here:

Attempting to delete in this fashion also brings up the same non-working 3 radio buttons noted above.

HOWEVER, we do note that if we select a checkbox in a list of activities, we *can* successfully delete the single activity.

In short, none of the radio buttons that appear after trying to edit/delete an Activity during its view seem to work anymore and, as such, a series of activities cannot be modified after creation, accept for deleting en masse via checkbox commands.

Troubleshooting suggestions appreciated.

# Answer
We're still having the issue with 5.4.2 and I've made a better thread here since my observations may not have been expressed clearly.

After creating/saving an activity, re-opening it to edit won't allow links and drop-downs to be changed

Suggest future discussion occur at that link and this be closed.
> 0 votes

---
Tags: activities, issues
---


title: Updating an activity using the API

text:
# Question
Title: Updating an activity using the API
I'm looking at the API and the options to update an Activity are struck through.

Is there a way of updating an activity with the API? COUld someone point me in the right direction? Thanks

# Answer
You can use the Activity Create API with an id in the parameter list. That should function as an update.
> 3 votes

---
Tags: api, activities
---


title: Adding a column to search results

text:
# Question
Title: Adding a column to search results
i try to add a custom column to the search results of "find contact". I use the hook "searchColumns", i can easily add a column with:

```
$headers['summary'] = array('name' => 'Summary');

```

, but when a add the data like:

```
$rows[$id]['summary'] = 'BBBBBBBBBB';

```

, the header shows up in the results but the data not. The whole code is:

```
function contactsearchshowsummary_civicrm_searchColumns($objectName, &$headers, &$rows, &$selector){
    if('contact' == $objectName){
        $headers['summary'] = array('name' => 'Summary');

        foreach($rows as $id => $row){
            $rows[$id]['summary'] = 'BBBBBBBBBB';
        }
    }
}

```

# Answer
Unfortunately you can't use searchColumns to add column on contact search result. The layout in tpl doesn't respect the 'searchColumns' hook.

However you can still use the hook by doing some additional UI setting or using javascript. Here are some alternate approaches

1. Create a profile with same column as Find contact and set 'Visibility' to 'Expose publicly and for listings' and Results Column? to true for each field. Navigate to CiviCRM \>\> Administer \>\> Customize Data and Screens \>\> Search Preferences. Use the created profile as 'Default Contact Search Profile' option. Alter the code accordingly to adjust the result display.
2. Add javascript to insert a column(td) for each row(tr) against each contact using the contact id defined in id or class for tr element. Iterate based on $rows assigned to tpl.

HTH

Pradeep
> 2 votes

---
Tags: hooks
---


# Question
Title: Display Contact Addressee as {prefix} {Initial} {last_name}
Hopefully self explanitory.

I want to extract the initial from the first name (if there is one) e.g. Mr John Smith appears as Mr J Smith as default.

Would be grateful for any help on this one.

# Answer
> 2 votes
You can alter the 'Individual Display Name Format' in display preference to include {initial} token through custom extension using tokens and tokenvalues hook.

If you don't want to store this in the database and just alter the display on screen then you can use contact\_get\_displayname hook to alter the display name.

Pradeep

---
Tags: contacts
---


# Question
Title: Why is Microsoft Edge autofilling disabled fields on my Webform CiviCRM?
We're struggling with a complex Webform that is auto-populating the wrong values into some text fields in Edge browser. The text fields are pulling data (phone number, email, address) from an existing Company Contact - and if those values are NULL in CiviCRM - Microsoft Edge happily populates these fields with previously seen but completely irrelevant and incorrect phone number, email and address.

We've since reproduced this on a number of sample forms.

Some illustrations - **this is Chrome** \[Semper IT - with phone has a phone number in the CiviCRM database; Semper IT - no phone does not\]. The yellow fields are the auto-fills from Chrome

And here's what **Microsoft Edge** does with this exact same form (apparently I live in Edmonton now). The blue fields are the auto-fills from Microsoft Edge. Thank you Laura for the screenshot!

# Answer
> 7 votes
I found the answer in a post on the Miscrosoft developer forum: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9847360/

Some of the 'highlights':

**From Microsoft:** “In IE11 and Edge, we made the decision to ignore autocomplete=off”

**From a developer:** WHAT !!! ??? That’s why we are receiving so many UI complaints recently. This is a terrible decision Microsoft. Please STOP breaking Edge by NOT supporting standard HTML correctly. Edge should honor the autocomplete="off" tag.

**And from another one:** “By Design” doesn’t mean that the functionality is correct. I’m struggling with a complex web form that is auto-populating the wrong values into some text fields in Edge browser"

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


title: Mosaico menu items missing

text:
# Question
Title: Mosaico menu items missing
We recently installed Mosaico (and Shoreditch Theme and FlexMailer) on our CiviCRM 5.4 Wordpress installation.

None of the required Mosaico menu items are showing up under Mailings or Administer\>CiviMail

I've cleared caches, etc.

Thoughts?

# Answer
Which version of mosaico did you use, because I had the same issue with mosaico 1.1 (described as stable on https://civicrm.org/extensions/email-template-builder), but actually it is not supported anymore and you should go with the 2.x releases.
> 1 votes

---
Tags: menu, mosaico
---


# Question
Title: Is it possible to restrict view to certain case activities?
We are currently evaluating CiviCRM 5.4.1 and CiviCase on Wordpress 4.9.8

One of the requirements is to limit access to certain activity types.

In simple words, some users are not allowed to view sensitive activity types.

So far I only found:

* CiviCRM: view all activities
* CiviCase: access all cases and activities
* CiviCase: access my cases and activities

But we need to restrict access to activity type: Payment

Any way to accomplish that?

# Answer
Yes - you can install the Activity Type ACL extension which will give you permissions on a per-activity type basis.
> 3 votes

---
Tags: wordpress, civicase, permissions, acl
---


# Question
Title: Link Drupal Node Content to a CiviCRM user and add user to a group?
I am trying to add the current user logged in to the Drupal 7 site to a CiviCRM group when they add content. For example we have a business directory and the signed in user can submit their listing. I want the user who submits the listing to be added a CiviCRM group called business directory which can then be used to email them in the future.

I tried using the contact reference field but this allows me to select the user. We want it to automatically select the signed in user.

Further, I am trying to get the rule to add the user to the group.

Has anyone achieved this with Drupal 7 & CiviCRM 4.7X.

Thanks.

# Answer
You can use rules module where you set condition upon node submit to perform to add user to CiviCRM group.

Module: Rules/ CiviRules
> 3 votes

# Answer
On a node update (You can change it to node create) it captures the email address from the node i.e. directory and creates a new Drupal user and CiviCRM contact and assigns that contact to the group.

```
{ "rules_add_new_user_to_civicrm_group_working" : {
    "LABEL" : "Add New User to CiviCRM Group - Working with New User",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "civicrm", "civicrm_entity" ],
    "ON" : { "node_update--directory" : { "bundle" : "directory" } },
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "user",
            "param_name" : "[node:title]",
            "param_mail" : "[node:field-directory-email]"
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "entity_save" : { "data" : [ "entity-created" ], "immediate" : "1" } },
      { "civicrm_entity_action_load_create_contact" : {
          "USING" : { "user" : [ "entity-created" ], "email" : [ "" ] },
          "PROVIDE" : { "civicrm_contact" : { "civicrm_contact" : "Created or Loaded CiviCRM Contact" } }
        }
      },
      { "civicrm_entity_query" : {
          "USING" : {
            "type" : "civicrm_contact",
            "property" : "id",
            "value" : [ "civicrm-contact:id" ]
          },
          "PROVIDE" : { "entity_fetched" : { "entity_fetched" : "Fetched CiviCRM entity list" } }
        }
      },
      { "civicrm_entity_rules_action_assign_contact_to_group" : {
          "contact" : [ "entity-fetched:0:contact-id-contact" ],
          "group_id" : { "value" : { "2" : "2" } }
        }
      }
    ]
  }
```
> 1 votes

---
Tags: drupal, groups, drupal-rules
---


title: Reverse a payment

text:
# Question
Title: Reverse a payment
Posted the wrong amount to an event and would like to go back and fix. Not sure how to reverse the payment or just delete it.

Thanks,

Alex Englander

# Answer
In case of data entry error - I recommend you delete and recreate. Otherwise you’ll end up with additonal financial transactions that could be negative (looks like you ‘refunded’) or positive (looks like you received an ‘additional payment’).
> 1 votes

---
Tags: payment
---


# Question
Title: Why doesn't anything happen when I select a search action from the CiviCRM search results?
I'm in CiviCRM 5.5.0 and everything works perfectly - except that nothing happens when I select a search action like "Add an activity". There are no errors in the Javascript console. What's happening?

# Answer
The cause was that I had the "Select2" Drupal module installed, which was adding a second Select2 widget to my search actions, breaking them.

To resolve:

* Go to Drupal **Configuration menu » User Interface » Select2**.
* Click the **Exclusion Rules** tab.
* Under *Don't load Select2 for specific pages*, enter `civicrm/*` and save your changes.

This should fix your search actions.
> 2 votes

---
Tags: drupal, search-results, select2
---


# Question
Title: Columns available for sorting in CiviReport seem arbitrary/random
I'm trying to run a contact report which sorts by Street Name, but it's not available as a sort option, and the list of options available seem abitrary and vary depending on the base report I use.

Strangely enough, Street Number is available as a sort option, which is definitely useful, but not so useful without Street Name. Some of the custom fields that I've created are also visible, but not all of them.

Things I've tried:

* Checking to make sure address parsing is turned on (it is, and the street\_name column is populated in the database with valid data)
* Adding the street name column to the report to make it viewable
* Trying an assortment of different contact reports as the base report to start from

I'm not sure where to go from here and am really not happy with how convoluted civireport is. I'm on the verge of starting to look into third party mysql reporting tools to accomplish this and would rather not if I could avoid it.

Does anyone have any suggestions? What determines whether or not a column appears in the sorting tab?

# Answer
Well, I started to give an answer, then started digging, and eventually found a bug that affects this particular situation. I've reported it as reporting#6 and submitted a fix.

It turns out that `address_name` is defined twice, accidentally. The first time it's correct; the second time is incorrect, and prevents the address name from being sortable.

I've submitted a fix, which should be in the 11/7/2018 release (CiviCRM 5.7) - but for now, open `CRM/Report/Form.php` in your CiviCRM root and delete lines 5517-5522. Note how `street_name` is also defined earlier, with `is_order_bys` set to TRUE, which makes it available for sorting.

To answer your other questions:

* Custom fields will be available for sorting (and in reports generally) if the "Searchable" option is selected for the field.
* There's no shame in connecting a third-party MySQL reporting tool to CiviCRM! If you use Drupal, you already have a great one in Views; other folks like Tableau and Pentaho BI. A dedicated reporting tool will always be a great choice.

Some additional thoughts:

* Not every report uses this function to determine the fields to include! In olden days, each report defined its own address fields; now the best practice is to use this function. This fixes a bunch of reports, but not 100% of them. Notably, it fixes "Constituent Sumamry" and "Walk List".
* Check out the Walk List report, aka "Survey Report (Detail)", since I suspect you're doing a walk list.
* If you ARE doing a walklist, upgrade to CiviCRM 5.5+, because there's a bug fix that lets you sort by odd/even street numbers.
> 3 votes

---
Tags: civireport
---


title: Cloud-based or local network storage

text:
# Question
Title: Cloud-based or local network storage
Maybe I'm just not looking on the correct pages for this issue. Once I download and set up a CiviCRM database, is the actual data saved to a cloud? Or, can I save it all to me local drive or network?

Thanks, G

# Answer
> 1 votes
Please refer to CiviCRM documentation, section on installation here https://docs.civicrm.org/sysadmin/en/latest, CiviCRM database is stored on your hard drive or local network depending on your setup

# Answer
> 1 votes
You can install CiviCRM either on a local server or on a web server off-premise ("the cloud") - off-premise is more common, but not the only option. Note that CiviCRM is web-based software, like WordPress - so you need a web server to run it on. Unless you maintain a server yourself, cloud-based is a much simpler option.

---
Tags: user-account
---


title: Membership sign ups

text:
# Question
Title: Membership sign ups
I'd like to vary membership fields for members from different locations, can anyone help?

Essentially I'd like to vary the fields that members are required to fill in when they sign up from a different country. This is specifically with regard to addresses as UK postal addresses have postcodes whereas other countries like Bahrain do not.

# Answer
> 2 votes
If you are using Drupal then you can use Webform \+ Webform Conditional modules to hide show certain fields.

Else you can add JS to CiviCRM Membership form through extension to hide/show postal code based on country selected.

REF: https://docs.civicrm.org/dev/en/latest/standards/javascript/

---
Tags: drupal, civimember, addresses, postcode
---


title: Create invoices in CiviCase

text:
# Question
Title: Create invoices in CiviCase
We are still evaluating CiviCRM 5.4.1 and CiviCase on Wordpress 4.9.8

Most of our requirements can be filled by CiviCRM and CiviCase.

But one requirement is to have invoices listed and followed up in case summaries.

I found that we can generate invoices in Contributions and Events which would suit our need to generate invoices.

But I can't get them listed in a case summary/activities.

Does anybody know how I could get this to work?

# Answer
> 3 votes
I have two comments:

1. CiviCRM is not really good in invoicing. So my advice would be to do the invoicing part in a seperate system, usually an accounting software might do the job
2. I have made an extension to link Contributions to a case, check it out at: https://github.com/CiviCooP/org.civicoop.casecontribution

May I ask what exactly you want to invoice from the case?

# Answer
> 1 votes
Unfortunately Contribution cannot be linked to Case in current version of CiviCRM (5.4.1) but you can build an extension where you can link contribution to Civicase either by assigning Invoice activity to case or through custom entity table.

HTH

Pradeep

---
Tags: wordpress, civicase, invoice
---


# Question
Title: How to choose which related contact gets the membership by relationship
We are on the latest CiviCRM 5.4.1 and Drupal 7.59. We have setup a membership type for a parent organisation (multi-site) to a child organisation. The relationship gets generated and membership gets associated by relationship which is great. What we are trying to figure out is how does CiviCRM let you choose which organisations receive the membership by relationship?

For example the parent organisation has 5 child organisations but has only paid for 3 related memberships. We can add the max related to 3 which is fine. How can we decide which 3 of the 5 child organisations will get the relationship. When it is organisation to individual membership the primary org membership has a create or delete option.

For parent organisation membership to child org membership it does not show.

Has anyone experienced this issue?

# Answer
> 1 votes
The only way i know that you could do this would be to use a different relationship type

So base the inherited membership off eg "is child org member of"

So a child org that is not a member could have relationship of 'is child org of'

while the 3 that you are talking about could instead/also have 'is child org member of' relationship

if you were happy doing a customisation then you could change the inherited relationship feature and set it to only trigger if a custom field on the relationship is set to 'yes' for example

---
Tags: civimember, relationships
---


# Question
Title: Should participant custom fields be available under events on webform
Custom fields for participants in Civi are not being presented for addition to Drupal Webform. Event registration is selected and working but the custom field set for participants are not showing up for placement on the webform. Is there a reason that they are not included for webform usage?

# Answer
Thank you for asking. This should work - and I just double checked and it is working on one of our live projects:

Webform CiviCRM config:

And the CiviCRM config \[On-line and Custom Fields are on the Participants entity\].

Is it perhaps possible that you've (accidentally) restricted these Custom fields to certain Events only?
> 1 votes

---
Tags: custom-fields, webform-civicrm, participants
---


# Question
Title: Running 2 civicrm instances on 1 database
I have one mySQL database and one Apache webserver. Can I still run 2 separate wordpress/Civicrm environments (like staging and production)?

# Answer
Yes, you can have multiple Civi/CMS instances on the same server. Depending on your preference, when looking at your server, you will see something along the lines of one of the the following structure:

Per comment - editing my response to include database - unless you are setting up a multi-site instance of Civi, you would need a separate database for each CMS instance.
> 1 votes

---
Tags: database, installation
---


# Question
Title: How to clean the Contacts and relevant Users
Though I use Captcha and reCaptcha, I have a lot of dummy users and Contacts which I can identify by the fact that their sort\_name = display\_name = email (or sort\_name contains an "@").

How can I delete those Users and Contacts ?

My original idea was to create a Dynamic Group of those, then delete them after exporting their list to excel to delete the relevant Users. But, how to create such a Dynamic Group (based on what search criteria ?) ?

An alternative would be to create a View (filtered on "sort\_name contains '@'"), then use VBO to add them to a Group : I tried, but could not succeed).

I tried using the Search Builder, but it is broken : I have openned a new post for that : Search Builder is broken (Civi 5.4.0 / Drupal 7.59)

# Answer
You could use Search \> Search Builder and search for Individuals whose First Name and Last Name are NULL (when this is the case, Civi will use the email address as the Display Name), select all of the search results and then create a Smart Group. You would then periodically review the contacts of the smart group by navigating to Contacts \> Manage Groups and then clicking on the Contacts hyperlink to the right-hand side of the group and perform the desired actions.
> 1 votes

# Answer
You can use Search Builder to make Smart Group for contacts where Sort Name like @ and First Name null

Name or Email LIKE - '%@%' ...AND... First Name Is Null ...AND... Contact Type = Individual

But I would then use VBO myself so that you can delete any Drupal users that are orphaned (ie no longer have a related civi contact)

We built a View to do this which I can fire through to you if you have trouble creating it from scratch. Ping me in redmine (gratis)
> 1 votes

---
Tags: contacts, user-account, search-builder
---


title: Setting up geocoding

text:
# Question
Title: Setting up geocoding
The log says the scheduled job ran and worked, but I checked some contacts and see nothing happened. I had it set to run daily. It geocodes just fine on import and upon saving a record.

So, I have some questions.

* How long does it run each time it is triggered? (max exec time?)
* Can I throttle the amount of contacts it attempts to code for each run? I want to avoid it running non-stop and killing the server by overloading it.
* I don't like to have more than one street address field (disabling supplemental 1,2,3) as users do not consistently input the their data right if you give them too many options. However, is it okay to include APT numbers etc in the main street address field and it still geocode reliably? I've done a few tests on records but not with a large sample.

I don't see in the docs clear answers: https://docs.civicrm.org/user/en/latest/initial-set-up/mapping/

Perhaps we can update the docs more on this?

# Answer
> 2 votes
Your questions are not provider specific and you didn't specify one, but if you are using Google, it looks like the documentation you reference is a bit out of date with regards to Google's requirement for API keys: the use of API keys was optional until changes recently went into effect in the Google Maps Platform. This month's Cividesk newsletter includes an article that details what needs to be done for Google APIs to continue functioning properly - you'll find that article HERE.

That said, I copy and paste your questions and intersperse them with my responses below and include links to resources where you should find more detailed instruction:

**Q1:** How long does it run each time it is triggered? (max exec time?)

**A1:** It depends on how you run the cron - the answer to THIS question should point you in the right direction.

**Q2:** Can I throttle the amount of contacts it attempts to code for each run? I want to avoid it running non-stop and killing the server by overloading it.

**A2:** You will find job parameters detailed HERE (including throttle and limiting to specific contact IDs).

**Q3:** I don't like to have more than one street address field (disabling supplemental 1,2,3) as users do not consistently input the their data right if you give them too many options. However, is it okay to include APT numbers etc in the main street address field and it still geocode reliably? I've done a few tests on records but not with a large sample.

**A3:** The basic rule of thumb is to specify addresses in accordance with the format used by the national postal service of the country concerned. Additional tips on address formatting can be found HERE. CiviCRM includes an optional plugin for interfacing the the United States Postal Services (USPS) Address Standardization web service, details of which you will find HERE.

---
Tags: geocoding
---


# Question
Title: Upgraded to 5.4, Donor Report fails with bad sql. Status_id is missing
Upgraded from 4.6.38 to 5.4.0 in a test env. The Donor Report (Summary) and (Detail) both fail on this piece of sql

```
 SELECT id, title
 FROM civicrm_batch
 WHERE item_count >= 1
 AND status_id !=
 ORDER BY title

```

Clearly the status\_id is missing.

I then upgraded to 5.5.0 hoping maybe that would fix it, nope.

civicrm\_batch has no rows so I'm guessing it queries it for some batch id gets back null and sticks that into the query.

I tried to create some batches both open and closed for all the possibilities I think there are. That didn't help.

# Answer
> 3 votes
This error will occur if you have missing/inactive Batch Status. To check navigate to CiviCRM \>\> Administer \>\> System Settings \>\> Option Groups. Search for **Batch Status** and then click on **options** link besides it.

You should see 'Data Entry' if not then you will need to add it as it is required by CiviCRM or enable it if its disabled.

> **Note from Paul:** It existed and was enabled; however, it had a value of 0 as did Reopen and Export. I looked at a demo and saw they have other values. Just hitting the Edit in order Data Entry, Reopen, Export and saving caused them automatically have the right value. That fixed the issue. Add this info to your answer and I'll check it and up vote it.

HTH

Pradeep

---
Tags: civicontribute, reports
---


# Question
Title: URGENT : Stripe.js token was not passed! Report this message to the site administrator. (on civicrm 4.7.20)
I recently upgraded civicrm from 4.7.16 to 4.7.20 (on Drupal 7.56).

Now, when I use a Contribtion Page to make a payment, I get the following message : "Stripe.js token was not passed! Report this message to the site administrator." (tested on different existing Contribution Pages with same result).

I already had this same message in the past, for webform embedded payments (see Stripe.js token was not passed! (using Webform Integration)), but it was solved by a fix (https://github.com/drastik/com.drastikbydesign.stripe/pull/159/files).

But this time, the problem happens on simple Contribution Pages (which previously worked).

To be complete, since this upgrade, I have had an other problem on webform embedded payments (submitted here : Stripe extension fails with a new account (civi 4.7.20)) :

* old webforms continue to work properly (I don't have this stripe.js message and the payments succeed) (but for how long ?)
* new webforms based upon new stripe Accounts send the payment to an other (existing) account.

May be both problems are linked ?

FYI, I use Stripe Extension 4.7.1 and I am not a programmer

Too late for me to go back to 4.7.16, any help is very very welcome and urgent.

# Answer
Please upgrade to the current github 4.7-dev version. Lots of work went into eliminating "Stripe.js token not passed!" errors that can for **a variety** of reasons. Jacques-Marie, you can reap the benefits of this labor by upgrading.

You already posted the url, but this is it:

https://github.com/drastik/com.drastikbydesign.stripe
> 0 votes

# Answer
Matt Wire has a fork for CiviCRM 5.x here: https://github.com/mattwire/com.drastikbydesign.stripe
> 0 votes

---
Tags: stripe
---


title: Is Civibooking compatible with PHP 7?

text:
# Question
Title: Is Civibooking compatible with PHP 7?
We depend on Civibooking and CiviCRM developers with be ending support for PHP 5X soon. What is the status of Civibooking and PHP 7? I did try to run on PHP 7 a while back and had issues in Civibooking.

# Answer
> 0 votes
I would suggest you try it out whether it works on PHP7. And if you find out it breaks you have two options:

1. Fix it yourself (if you are a developer) and push a *Pull request* to the original developer
2. The other option you have is that you pay a developer to fix CiviBooking.

There is also a third option and that is to ask around in the community whether there are other people willing to contribute to make CiviBooking compatible with PHP 7.

I have one last remark, PHP, CiviCRM are all open source. So there is no supplier who guarantees that stuff keeps working. The End of support of PHP5x does actually not mean a lot, it means that the original developers of php5 will not bring out any new (security) releases of that php version. But others might still do that and no one prevents you to fix your php yourself when you discover a security flaw.

One really last remark, you said you depend on CiviBooking. The other option you have is not to upgrade php 5 to 7 as it brings in a risk for continuity of your primary process in your organization. But if you do not upgrade you have another risk and that is that your php 5 might become insecure at some point in the future.

---
Tags: civibooking
---


title: User Profile Self Update

text:
# Question
Title: User Profile Self Update
I want a user to come to my website and fill out the contact form depending on whether they're individual volunteer or an organization. Once they submit that form, it should create a username/password for the user so that they can visit the site and update their profile or preferences like interested in helping homeless, kids, seniors depending on whether they're individual or organization.

How do I create that form? Where do I begin? What components do I need to enable for this work?

Any help will be highly appreciated.

# Answer
> 1 votes
You have two options for this.

One is to use CiviCRM profiles. There's an instructional video and a section in the profiles documentation on using profiles as a form.

You can also use Webform-CiviCRM integration (if on Drupal) or Caldera Forms with CiviCRM integration (if on WordPress). These will give you more flexibility on the look and feel, and are generally more powerful - but from what you describe, you can use either.

---
Tags: forms
---


# Question
Title: Modifying Default Contact Forms (Individual, Household & Organization)
How can I modify the default contact forms and remove the unnecessary fields and add new fields instead.

# Answer
If you're referring to the contact screens that look like this:  You can add custom fields as per the documentation.

To remove/rearrange fields, install the Contact Layout Editor extension. Note that this extension requires the very latest version of CiviCRM (5.5+).
> 2 votes

# Answer
If you're referring to the "New Individual" etc. form that looks like this:  You can remove some of the fields from \**Administer menu » Customize Data and Screens » Display Preferences. You can't remove all the fields from this screen without coding a custom extension.

You can add fields by creating custom fields. See the documentation for more help on this.
> 1 votes

# Answer
If you're referring to the "New Individual" etc. pop-ups that look like this:

Then at /civicrm/admin/uf/group?reset=1 you should see a tab for Reserved Profiles

You should see the New Individual one there and should be able to add other Fields to that profile
> 0 votes

---
Tags: contacts
---


# Question
Title: How to display custom fields 2 fields in row, instead of new line for each field
I'm new to civiCRM, I tried to search but didn't find an answer, although I feel that my question is naive

# Answer
> 2 votes
This is an argument in favor of using a tool like Webform-CiviCRM integration (on Drupal) or Caldera Form CiviCRM integration (on WordPress). The CMS-based form builder has additional layout flexibility, and both allow you to place fields side-by-side.

If you don't want to use those tools, you can use CSS rules to place the fields side-by-side.

# Answer
> 1 votes
Not a naive question at all - I am a seasoned Civi user and I had to double check to make sure what I'm about to tell you is correct - without customization, there is no way to offer free text fields in multiples per row within the same profile. Radio and Checkbox type custom fields will allow you to dictate how many options should appear per row, but each field will still be listed on its own row. It looks like the data you are collecting is expected to be exact - if not, you might consider using either Radio (select only 1 option) or Checkbox (select all that apply) and offer ranges (a major benefit of using ranges is that they will make filling out the form a much quicker experience for the user): e.g.:

---
Tags: custom-fields
---


# Question
Title: Error Could not find valid session key wordpress
Inside hook\_civicrm\_post, when I comment the below line

> $user\_id = wp\_update\_user( array( 'ID' =\> $user\_id,'user\_email' =\> $objectRef\[Email1\]));

It does not give "Could not find valid key" error but when I uncomment the above line it gives the error

Kindly let me know how I can fix this

```
$user_id  = $uf_match['values'][$uf_match['id']]['uf_id'];
        $data = get_userdata($user_id);
        if ($data->user_mail != $objectRef[Email1]){
         //$user_id = wp_update_user( array( 'ID' => $user_id,'user_email' => $objectRef[Email1]));
        }

```

# Answer
I'm no WordPress expert, but my reading of the codex is that `wp_update_user()` will remove cookies for the logged-in user. The docs say it "Uses: `wp_clear_auth_cookie()`".

I would try to do the same with wp\_insert\_user() instead, it says in the codex that this can update OR create new users.
> 1 votes

---
Tags: wordpress
---


# Question
Title: Network error when viewing individual activities
I can view a profile, view all the activities, but when clicking 'view' to view the details for the individual activity I get 'Network error, unable to reach the server. Please refresh this page in your browser and try again'. Any thoughts? I've restarted the machine, logged in/out etc, I have privileges to access the information, made sure it's a secure connection, everything I can think of. Any help would be great!

# Answer
Symptoms like you describe match the symptoms of a bug in the Activity iCalendar Feed extension, which has been fixed as of extension version 1.5.

If you've got this extension installed, I recommend a) disabling it temporarily to see if this bug could be at fault, and b) upgrading it to the latest version. (Hat tip to V3rmie for creating the ticket for that bug.)
> 2 votes

---
Tags: activities
---


title: Can't install "CiviCRM UK GiftAid"

text:
# Question
Title: Can't install "CiviCRM UK GiftAid"
Getting the following error when installing this extension. Had to enable PHP errors to get this as without all I see is a 500 server error w nothing in the Apache2 logs.

```
Parse error: syntax error, unexpected 'new' (T_NEW) in /var/www/website.vhost/web/wp-content/uploads/civicrm/ext/uk.co.compucorp.civicrm.giftaid-3.0.1/CRM/Civigiftaid/Utils/Contribution.php on line 99

```

# Answer
> 4 votes
Ah, v3 of this extension is incompatible with PHP7: https://github.com/compucorp/uk.co.compucorp.civicrm.giftaid/issues/49

# Answer
> 3 votes
The developers are in the process of fixing this: see

https://github.com/compucorp/uk.co.compucorp.civicrm.giftaid/issues/49

So it will probably be fixed in the next release. If you need to install it sooner, here's how. Find your extension directory (go to **Administer-\>SystemSettings-\>Directories** and you will find the path in there. The abbreviation `[civicrm.files]` usually refers to `sites/default/files/civicrm`). IN your SSH or FTP environment, navigate to there and then open `uk.co.compucorp.civicrm.giftaid/CRM/Civigiftaid/Utils/Contribution.php` for editing. Find every line like this:

```
$batchContribution =& new CRM_Batch_DAO_EntityBatch();

```

In each case, delete the line and replace it with these two lines:

```
$entityBatch = new CRM_Batch_DAO_EntityBatch();
$batchContribution =& $entityBatch;

```

This does not change what the code does but it just changes the syntax to make it compatible with PHP7.

---
Tags: extension, gift-aid-extension
---


# Question
Title: Wordpress CiviCRM site unusable after database upgrade from 5.4.0 to 5.5.1
I'm relatively new to CiviCRM and am trying to get a client set up with the platform. I like it overall, it seems much more usable than most I've touched in the past.

All seemed to be going well until late last week. I had it basically set up on a third-party server. There might have been a resource path issue, or it might be a known testing bug (probably the latter).

Somewhere in there an upgrade was called for by Civi and I decided to give it a try. It appeared to work, but after the DB upgrade step I couldn't get to any Civi pages. I had to completely blow away Civi and start again to get anything displayed. Restoring the db from Backup brought me back to a somewhat usable state, but it wants to upgrade the db. I've tried a couple times with the same result.

I'm limping along right now with a db that says it needs to upgrade, but otherwise seems to work.

Looking around on the forums here, it seems like maybe I should be using an older version. The website seemed to be strongly steering me to 5.\* so I assumed it was stable. I see here, people using 4.7 which I didn't even see on the website (all seemed to be 5.\* and 4.6.\*).

Any thoughts on either fixing this 5.5.1 problem or if I should be finding and running 4.7?

# Answer
> 1 votes
People using 4.7 are out of date - 4.7 is end-of-life. You should definitely go with 5.x for most use cases.

I would check your error logs in the ConfigAndLog directory - then come back here and edit your question to add the relevant logs. In general, there's a troubleshooting page in the documentation, but most of the suggestions aren't applicable to upgrade failures.

---
Tags: upgrade, database, version
---


# Question
Title: The CiviCRM public extensions directory at https://civicrm.org/extdir/ver=5.4.1|cms=WordPress could not be contacted
I'm getting this error pretty regularly lately, specifically after upgrading from 5.4.0 to 5.4.1: The CiviCRM public extensions directory at https://civicrm.org/extdir/ver=5.4.1|cms=WordPress could not be contacted - please check your webserver can make external HTTP requests or contact CiviCRM team on CiviCRM forum.

My dashboard is also pretty frequently showing "Sorry but we are unable to provide this at the moment"

Weird thing is I have another test instance on 5.4.1 and it's working fine. (Both instances in question are running on Amazon Lightsail.)

Are there maybe some directory permissions or something along those lines I need to check? I did some basic checking between the test instance that's working and the one that isn't and didn't see anything obvious.

Thanks for any ideas anyone has.

# Answer
The dashboard issue is a known issue in CiviCRM 5.4. The latest version of CiviCRM solves this. I'm not sure if that would also affect the extensions directory though. Please comment on this answer if it does though!
> 3 votes

---
Tags: extension, dashboard
---


title: Error Upgrading DB to 4.7.18: SQL

text:
# Question
Title: Error Upgrading DB to 4.7.18: SQL
\[Error: Upgrade DB to 4.7.18: SQL\] \[nativecode=1062 \** Duplicate entry 'Chandigarh-1101' for key 'UI\_name\_country\_id'\]

How can I fix the error as given below:

```
INSERT INTO `civicrm_state_province` (`id`, `country_id`, `abbreviation`, `name`) VALUES (NULL, 1101, "CH", "Chandigarh"), (NULL, 1083, "CP", "Central"), (NULL, 1083, "EP", "Eastern"), (NULL, 1083, "NP", "Northern"), (NULL, 1083, "WP", "Western"), (NULL, 1181, "K", "Saint Kitts"), (NULL, 1181, "N", "Nevis"), (NULL, 1190, "E", "Eastern"), (NULL, 1190, "N", "Northern"), (NULL, 1190, "S", "Southern") [nativecode=1062 ** Duplicate entry 'Chandigarh-1101' for key 'UI_name_country_id']
DebugInfo   INSERT INTO `civicrm_state_province` (`id`, `country_id`, `abbreviation`, `name`) VALUES (NULL, 1101, "CH", "Chandigarh"), (NULL, 1083, "CP", "Central"), (NULL, 1083, "EP", "Eastern"), (NULL, 1083, "NP", "Northern"), (NULL, 1083, "WP", "Western"), (NULL, 1181, "K", "Saint Kitts"), (NULL, 1181, "N", "Nevis"), (NULL, 1190, "E", "Eastern"), (NULL, 1190, "N", "Northern"), (NULL, 1190, "S", "Southern") [nativecode=1062 ** Duplicate entry 'Chandigarh-1101' for key 'UI_name_country_id']

```

# Answer
The upgrade for 4.7.18 tries to insert new state in `civicrm_state_province` table. This was done via https://issues.civicrm.org/jira/browse/CRM-19993.

But seems you already have `Chandigarh` in the table due to which mysql finds a duplicate row already present in the database and eventually displays an error. So the question is how this record is already present in your database?

* Have you tried this upgrade for 4.7.18 before and retrying this again? If yes, try getting a backup of the previous version and then start the upgrade process.
* Have you added the new state `Chandigarh` in your DB manually in your previous version? In this case, you can simply delete the `Chandigarh` entry manually from `civicrm_state_province` table and restart the upgrade. It will create the entry for Chandigarh so you'll not lose any state record from your DB.
> 1 votes

---
Tags: upgrade, database
---


# Question
Title: PSA for CiviCRM vulnerability released 7/18/18?
I've received an notice from our Civi support saying that "The CiviCRM Security team has issued a Public Security Advisory regarding a security vulnerability. The fixes to this vulnerability will be released to the public on July 18th."

I was interested in getting some background, but I can't find the PSA. Can someone please point me toward it? Or is Civi just supplying that info to certain people in advance of the PSA being released on 7/18? Thanks!

# Answer
For those who find this question now - you can find the seven advisories here.
> 1 votes

# Answer
Yes this was an advanced notice - the release is due out 18 July 13:00 - 16:00 EST (best current estimate)
> 0 votes

---
Tags: security-advisory
---


# Question
Title: Clean reinstall of CiviCRM Extension GDPR on Wordpress
I've been trying to evaluate the GDPR extension before adopting it fully. I entered some dummy information about Privacy files, which I now wish to delete and start afresh. There doesn't seem to be any easy way of deleting that information. I've tried disabling the extension, uninstalling it and then re-installing it but the information that I originally entered keeps coming back which suggests to me that the information has been stored in the CiviCRM database.

The documentation shows: Removing¶

```
If you no longer wish to use GDPR, you may disable it, or uninstall it.

    Disable - will turn off GDPR’s features, but preserve any data that you have created with it. If you re-enable GDPR later, you'll be back where you left off.
    Uninstall - can be done after disabling, and will completely remove all traces of GDRP, including the data created with it. If you re-install GDPR later, you'll be back to square one, before you ever installed it.

```

The "removal of all traces" hasn't worked for me and as I've said, I want to do a completely fresh install. Has anyone else tried to do this and if so, with what results?

# Answer
> 1 votes
**Taken from a comment by @ParvezSaleh**

The extension does not remove the custom data or activity types when uninstalled. This is a deliberate feature as it's assumed that any data collected to date is important and would be required if an audit takes place.

It would therefore be necessary to manually remove the information from the database.

The extension's settings are stored in the `civicrm_settings` database table as a record with `name` set to `gdpr_settings`.

Other information (activities, custom field data) are stored in various database locations including `civicrm_activity` and `civicrm_value_sla_acceptance_N` (there may be other locations.)

---
Tags: wordpress, extension, gdpr
---


# Question
Title: After creating/saving an activity, re-opening it to edit won't allow links and drop-downs to be changed
We're using 5.4.1 on Wordpress 4.9.8 with php 5.6.34.

The following issue seems to have started with 5.3.x and we still cannot solve it.

When we create an activity, we include:

1. a hyperlink in the details
2. a status using the dropdown box

All works as it should when we create an activity. However, when we choose to **edit** it (wrong hyperlink, change the status, etc.), we are unable to do so.

1. The hyperlink properties box does not come up when clicked
2. The dropdown box will not come up when status is clicked

In both cases the anticipated pop-up windows show up behind the active window, but -- in addition to being the wrong behavior -- they still don't work.

My work-around is to edit in HTML (vs WYSIWYG) and changing statuses via searches and applying changes by profile. But this is time-consuming and not all of our team can easily do it. And it's not how Civi is supposed to work.

We're using Chrome/Windows. I thought we solved it by clearing Chrome's cache (but the result is sporadic at best). We've also tried Firefox with same issue.

Does anyone know what's going on here?

Thanks!

P.S. The correct functionality does appear to be present in 5.6.alpha1 in the demo sandbox. Can anyone verify if this is a known bug? If not, I'm concerned the issue may be our database rather than Civi.

Here are screen shots showing *correct* behavior with *creating* activities. Note that the dropdown box for assigning status and hyperlink box for providing link details pop up in foreground and can be completed and saved:

Here are screenshots of the incorrect behavior after saving this activity and attempting to edit it. Note the dropdown and hyperlink dialog occur behind the activity screen (I've move the Activity screen to reveal them). Even after revealing them, they do not function.

\[

# Answer
> 2 votes
I'm happy to report that the original issue was resolved with an update to 5.5.1. With this update made, the errors illustrated in my original post are no longer occurring.

Because we've long used CiviCRM without this error and first noticed it with 4.7.31 (and consistently with subsequent upgrades), we believe that this new upgrade has returned the functionality enabling us to **again edit activities from a popup window opened from search results.**

@RayWright, thank you for suggesting the java review and screenshots which helped us see that the issue was limited to "pop up" edit windows (i.e., activities opened from searches) rather than full-screen edits (i.e.,activities opened from reports). The latter may especially be helpful as a workaround if future users see this issue.

---
Tags: cache, links, status, bug-reporting
---


# Question
Title: Search Builder is broken (Civi 5.4.0 / Drupal 7.59)
Search Builder is broken : I don't have any "Select field", but only "Select Record Type" and "Operator" (sorry for the image in french) :

You can reproduce this bug on the demo configuration (civicrm.demo.civihosting.com, in 5.0.0), this way : Search Builder \> Select "Individual", then go to Support \> About CiviCRM, and then back : "Select Field" has disappeared : on my configuration, I have the same situation, but directly, without this forth and back operation.

# Answer
best to compare with dmaster.demo.civicrm.org/civicrm/contact/search/builder?reset=1 i think as that will be running on latest code for certain (to avoid reporting a bug that has already been fixed)
> 0 votes

---
Tags: search-builder
---


title: Use map with election boundaries on

text:
# Question
Title: Use map with election boundaries on
I use maps to see where my volunteers are. It would be cool to see them on a map with the electoral boundaries on top. Is it possible to change the “base layer” map from google or wherever to a google map that I had put the ward boundaries on.....?

# Answer
> 1 votes
It is not really possible within CiviCRM. However if you are on Drupal you could create a view and put that view on a map with your own layer.

# Answer
> 1 votes
I think you should find the instructions at How to Map Contacts? helpful particularly the link to another Answer by Karin to this great answer How to put your CiviCRM Contacts on a Leafleft Map in 5min? which we have used and concur it gives us Maps with civi contacts

---
Tags: map
---


# Question
Title: How to allow logged in user to view their own civicrm contact dashboard in wordpress?
I want to allow logged in user to edit own contact details(own) from contact dashboard and edit custom fields(own)

WordPress Version 4.9.8 CiviCRM Version 5.5.1

# Answer
> 2 votes
Giving permission to user 'edit own contact' will be able to update his own details. You can check permission by navigating to CiviCRM \>\> Administer \>\> Users and Permissions \>\> Permissions (Access Control) and then click on Wordpress access control

# Answer
> 0 votes
To View your own contact dashboard

1) Add WordPress Plugin **Members**
2) Go to individual Role's permissions page and then tick Access Civicrm.
3) Visit **Wordpress Access Control** under Users and Permissions as mentioned in answer given above and select following permissions.
\- View my contacts
\- Edit my contacts
\- Access my contact dashboard

---
Tags: wordpress, dashboard, 5.0
---


# Question
Title: Missing Custom Activity Field Data When the Activity is Filed on a Case.
As the title states. Data that I enter into custom activity fields, is saved and

I can view that saved data from the Activities tab in the Contact Summary.

Like this:

But after the activity is filed on a case most of the data fields appear empty when the data is viewed from within CiviCase.

These fields were working fine up until I updated the system to 5.4. It continues after I updated to CiviCRM 5.5.1. on WP version 4.9.8.

How can I troubleshoot/fix this error? I am not able to duplicate this issue on the demo system found at https://dmaster.demo.civicrm.org/.

Not sure if it is related but I'm not able to create a Public Profile to share as that is getting an error, "Identity is invalid, Certificate is Expired".

# Answer
First check the log files (Where are the "ConfigAndLog" and "templates\_c" directories?) and see if there's anything obvious happening there.

Otherwise if you can debug in CRM/Activity/BAO/Activity.php in the copyExtendedActivityData() function that should help track it down. That's the function that gets called from \_convertToCaseActivity() in CRM/Case/Page/AJAX.php to copy the custom data and attachments.
> 1 votes

---
Tags: wordpress, custom-fields, civicase
---


# Question
Title: What does the 'profile_listings_and_forms' permission allow?
I'm currently reviewing the permissions for a CiviCRM/WordPress site and want to make sure that I understand the permissions correctly before changing them.

I've found the documentation on the `profile_listings_and_forms` permission to be a bit unclear so I just wanted to check. Am I right in thinking that this permission is just a shorthand for allowing all four of the other profile permissions?

i.e. `profile_listings_and_forms` = `profile_create` \+ `profile_edit` \+ `profile_view` \+ `profile_listings`

# Answer
Yes, the `profile_listings_and_forms` permission is just a shorthand for allowing all four profile permissions.

`profile_listings_and_forms` = `profile_create` \+ `profile_edit` \+ `profile_view` \+ `profile_listings`

The documentation is being updated to clarify this.

Thanks to MikeMJCO for confirming this.
> 1 votes

---
Tags: permissions
---


# Question
Title: Wordpress Civicrm doesn't seem to generate invoice from other user roles except administrator
CMS: Wordpress 4.9.6

CiviCRM: 5.2.1

I'm trying to generate Invoice with the below url, Which is working fine when I login as administrator. but when I login as actual member to download Invoice from WordPress front end with the same url giving me this error

```
  Sorry, you are not allowed to access this page.

```

( I gave this civi permission

```
CiviCRM: view my invoices
Allow users to view/ download their own invoices

```

to all user roles).

```
http://devsri.mywebsite.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/contribute/invoice&reset=1&id=48657&cid=35509

```

Its working when I give below(CiviCRM: access CiviCRM backend and API)permission

```
"CiviCRM: access CiviCRM backend and API" Master control for access to the main CiviCRM backend and API. Give to trusted roles only.

```

But I cant give this permission to a member just to download Invoice. In drupal its working with "CiviCRM: view my invoices" permission. I wonder if its a bug in Civi Wordpress??

Did anyone experience this? or Am I missing anything here?

TIA

# Answer
I found the problem here. actually there is some issue with CiviCRM Wordpress codebase because its always failing to get wordpress user id.

Below checkDownloadInvoice function using drupal `global $user;` to get logged in user id for wordpress as well.

```
CRM_Core_Permission::checkDownloadInvoice

public static function checkDownloadInvoice() {
    global $user;
    $cid = CRM_Core_BAO_UFMatch::getContactId($user->uid);
    if (CRM_Core_Permission::check('access CiviContribute') ||
      (CRM_Core_Permission::check('view my invoices') && $_GET['cid'] == $cid)
    ) {
      return TRUE;
    }
    return FALSE;
  }

```

for WordPress It should be changed to

```
public static function checkDownloadInvoice() {
    $uid = get_current_user_id();//changed for WordPress
    $cid = CRM_Core_BAO_UFMatch::getContactId($uid);//changed for WordPress
    if (CRM_Core_Permission::check('access CiviContribute') ||
      (CRM_Core_Permission::check('view my invoices') && $_GET['cid'] == $cid)
    ) {
      return TRUE;
    }
    return FALSE;
  }

```

Hope it helps someone in future. :)
> 2 votes

---
Tags: wordpress, civicontribute, civicrm-home
---


# Question
Title: How can I set up anchors in Mosaico mailing?
I am trying to set up anchors in my MOSAICO mailing so that at the top of the mailing I can have links to headers further down. Any advice welcome? (P.s. not a programmer, so please keep it lay!)

# Answer
looks like there is no way to do this via the limited 'what you see is what you get' (WYSIWYG) editor, so this would have to be done in the code of the block you are working in, by clicking onto the source button \< \> And then using the html for an anchor link.

For example your first anchor link can be called 'one'

You would use it as follows. If you had a list of heading points at the top of the email as such.

1) My heading one

2) My heading two

3) My heading three

Then you would put the anchor in like this:

```
<ol>
    <li>
        <a href="#one">My first heading</a></li>
    <li>
        <a href="#two">My second heading</a></li>
    <li>
        <a href="#three">my third heading</a></li>
</ol>

<a name="one">1) </a><p>My section one here</p>
<a name="two">2) </a><p>My section two here</p>
<a name="three">1) </a><p>My section three here</p>

```
> 5 votes

# Answer
Unfortunately, it looks like anchors doesn't work in Mosaico with CiviCRM v5.3.2 with that code above. You get a error message even after clearing your browser's cache: This page isn’t working \[civicrm site\] redirected you too many times. Try clearing your cookies. ERR\_TOO\_MANY\_REDIRECTS

And yes, using email anchors is iffy in general and rethinking the design of the email may be best option (even though anchors may be cool to use).
> 1 votes

---
Tags: mailing, mosaico
---


# Question
Title: back-end checkboxes not displaying after switch to Shoreditch
After switching to the shoreditch theme, the checkboxes on our back-end site are not displaying appropriately in all situations.

When listing Contacts from a search, the checkboxes that should be in the left column only show up if you click in that column within a few seconds after the page loads. If you wait a bit, they do not show up at all.

When merging contacts, the checkboxes to select what data to merge do not show up at all.

I haven't exhaustively looked at every instance, but Checkboxes display appropriately when listing a Contribution search.

I can replicate this behavior on both Chrome and Safari. CSS shows the following in /media/civicrm/custom\_ext/org.civicrm.shoreditch-master/css/custom-civicrm.css?r=65LNz:

```
.crm-container input[type=checkbox], .crm-container input[type=radio] {
    display: none;}

```

This css file is so large that I'm cautious about just unsetting the display property, not knowing exactly what cascade that might cause. Anyone have a clue about this?

Further, as part of the extension, I assume any edits to this file will be overwritten on the next update.

Is there a location where I can set up my own custom css file for Civi (other than my global CSS.) while still using the Shoreditch theme? (We've been using a custom civi css file up to now, but that's not an option with Shoreditch.)

# Answer
I've discovered that the Shoreditch README states that "At the moment the theme is being developed to work only in Drupal." The CiviCRM extension page for Shoreditch, however, states, "CMS Compatibility: CMS Independent (CiviCRM-native)". Shoreditch, however, is still required for Mosaico, which **does** work correctly with Joomla.

So, apparently, my expectations that Shoreditch will work correctly as the Civi theme with my Joomla installation are incorrect, and I'll move back to my custom css.

It would be helpful if the extension page would clarify what Shoreditch is expected to do and not do for non-drupal users.
> 2 votes

---
Tags: css, shoreditch
---


# Question
Title: Drupal Rules: Send email then Contact Custom Field Value was updated
There are two different "Reactions on Event" if you create a Drupal Rule: "CiviCRM Contact has been updated" and "Custom field has been updated" (which is clearly about someone edits Field, not value attached to Contact).

What kind of conditions should be set to get value of a Contact's custom field altered?

# Answer
It turned out Jaap Jansma - CiviCooP was right, CiviRules ( and Email Api for sending emails - a missing piece from my previous attempts ) can do the job nicely. CiviRules can handle any Contact change nicely. Kudos to Jaap Jansma - CiviCooP!
> 1 votes

---
Tags: drupal, drupal-rules
---


title: Batch Update Permissioned Relationships

text:
# Question
Title: Batch Update Permissioned Relationships
We have a specific contact/organization relationship type that should be a permissioned relationship for the contact to edit the organizations record. When we converted to Civi many of these contacts did not get the permissioned relationship check box checked. Is there a way to update the Permissioned Ralationship check box for this specific relationship type in bulk?

# Answer
Unfortunately, there is no way to batch update relationship via the user interface b/c relationships are reciprocal. Using the Import Contacts wizard and selecting "Update" doesn't allow you to designate a relationship as permissioned either.

If you have a programmer on hand, this type of update would be easy to do using an SQL query directly on the database:

Assumptions:

* Relationship Type ID = 4 (in my environment, this is the ID for Employee/Employer)
* Contact A = Individual
* Contact B = Organization

Query:

UPDATE `civicrm_relationship` SET `is_permission_a_b`= 1 WHERE `relationship_type_id`= 4

Alternatively, if you have sufficient permissions, you could use API Explorer as documented HERE, but this should only be done by someone who has good knowledge of the CiviCRM database structure.

Good luck!
> 2 votes

---
Tags: permissions, relationships
---


title: 2 Drupal Sites and 1 CiviCRM

text:
# Question
Title: 2 Drupal Sites and 1 CiviCRM
I am looking for some advice on whats the best approach to implement two Drupal sites with different domain names + designs and link them to one CiviCRM.

I know multi-site for CiviCRM is on option but the process to install does not seem very straightforward. The two options I can think of are:

A. Two Separate Drupal sites with Two CiviCRM codebases linked to One CiviCRM Database

B. One Drupal Multi-site installation (sub-sites) with One CiviCRM installation & Codebase.

Can anyone tell me the pros and cons and which one offers more flexibility in the long run considering all the upgrades and improvements for CiviCRM and Drupal.

Thanks.

# Answer
There is a third option. You can use two drupal sites and a third site for civicrm.

On your Drupal sites use CiviMRF module to connect to your CiviCRM site.

I wrote a blog on how to do this: https://civicrm.org/blog/jaapjansma/using-civicrm-form-processor-extension-to-handle-form-submissions-from-an-external

Personally I would go for this option, because you keep your CRM seperate from your website. A website might require changes/redesign over time while a CRM needs to be stable and stay the same over time. And this way you can easily change/redesign your website without the fear of breaking anything in your crm.
> 1 votes

---
Tags: installation, multisite
---


# Question
Title: How do I create a new folder for reports?
How do I add a new folder to the Reports menu, then move some of my custom reports to that folder? Thanks!

# Answer
Go to administer \> custom data and screens \> navigation menu \> add a new menu item.
> 2 votes

---
Tags: reports
---


# Question
Title: CiviCRM 5.4, Unable to create case type (angular validation error)
On fresh Install Civi 5.4, Core expect to have new option group called "Activity default assignee", but upgrade script not executed and not updated the option group table with "Activity default assignee" options.

which cause null result in "Default Assignee" drop down on New case type and "Save" button has disabled because angular validation error.

# Answer
> 5 votes
This is due to the change made in this PR - https://github.com/civicrm/civicrm-core/pull/11998.

I raised this on Mattermost some time ago. See https://chat.civicrm.org/civicrm/pl/d58c9nuowbfemeneizbe57cxqy. It says -

> Seems default assignee is a required field on Case Type Form(as per this change). Was this intentional? I was unable to save https://dmaster.demo.civicrm.org/civicrm/a/#/caseType/1 until I filled out default assignees for all the activities listed under standard timeline ♂

But unfortunately haven't got any reply for the same.

To fix this -

* Remove the `required` word from this line of the PR and the following element. You should be able to save case type without selecting any value in the default assignee.

OR

* Add values to the default assignee for all the activities.

# Answer
> 0 votes
I created the feature.

How come the upgrader didn't run? Did something break? Do you have a specific error message available?

I didn't set the main select as required, but it seems that since the options are missing, then the required field that is supposed to be hidden shows up and stops you from saving the case type.

I'll create a new PR that will handle missing options for this field, but it would be good to understand why the options are not available in the first place.

Please feel free to message me with any details you may have.

# Answer
> 0 votes
**Short answer**: The problem affects new clean installs on 5.4/5.5 but shouldn't affect upgraded sites. To quickly fix a new site, you can run cv as follows:

```
cv ev 'CRM_Upgrade_Incremental_php_FiveFour::addActivityDefaultAssigneeOptions();'

```

**Long answer**: As Jitendra pointed out, the change stems from #11998, which updated both the code/UI and the database. Of course, the PR went through some testing and passed. What gives? The testing focused on taking *an existing database* (perhaps a real site; perhaps just a local dev site) and *applying the change on top*. The PR worked because it defined an upgrade procedure for the database. However, in a *clean-install*, the database doesn't use the upgrade procedure. As a quick-fix, you can manually update the database. As longer term, we should issue a new version which automatically updates the database.

---
Tags: civicase
---


# Question
Title: Upgrade to CiviCRM 4.3 failing on DROP FOREIGN KEY
I have successfully upgraded many other CiviCRM installations over the years, but I've been unable to work my way through this issue so far.

* Ubuntu 14.04
* MySQL 5.7.23
* Apache/2.4.7
* PHP Version 5.6.37
* Drupal 7.59
* CiviCRM 4.2.20

I am trying to upgrade CiviCRM 4.2.20 to 4.3.11. Ultimately the goal is to get to 4.6 LTS. I have tried repairing the CiviCRM schema (*this database has only 2 custom fields*), and I've also tried the `SET foreign_key_checks = 0;` work around on importing the db, but I've still been unsuccessful at upgrading. I always hit this error at the stage of:

> \[Error: Upgrade DB to 4.3.alpha1\]
>
> ALTER TABLE civicrm\_membership\_type DROP FOREIGN KEY FK\_civicrm\_membership\_autorenewal\_msg\_id \[nativecode=1091 \** Can't DROP 'FK\_civicrm\_membership\_autorenewal\_msg\_id'; check that column/key exists\]

I found a helpful thread somewhere that suggesting that MySQL 5.5 may have been the culprit, so I upgraded to MySQL 5.7, and still get the exact same error regardless of MySQL version. I have a fresh export and backups, so every time I try something it is with a fresh working version of the database on 4.2.20. Any help is greatly appreciated!

Thank you,
--Tony

**Update** Based on Jon G's suggestion I tried commenting out the offending lines in `CRM/Upgrade/Incremental/php/FourThree.php`, reloaded a fresh database for upgrading, but still continued to receive the exact same error. The only difference this time being, after I hit refresh to try and force the upgrade to continue, then another message occurred:

> ALTER TABLE civicrm\_premiums ADD COLUMN premiums\_nothankyou\_position int(10) unsigned DEFAULT '1' \[nativecode=1060 \** Duplicate column name 'premiums\_nothankyou\_position'\]

I couldn't grep any more lines to comment out of the `FourThree.php` upgrade file, and wasn't sure how this would affect database integrity. The suggested threads (CRM-12458, CRM-11260) seem to relate, but I was ultimately unable to use the information to solve this issue, admittedly due to the lack in my technical understanding.

# Answer
This appears to be identical to CRM-12458. Which is unusual - most cases where you'd get this error were solved in CRM-11260 but there are still edge cases that can cause this.

I would read those links in full - but my guess is you should edit `CRM/Upgrade/Incremental/php/FourThree.php`. Remove the four highlighted lined at this link \- that is, lines 883-886.

Since you're dropping a foreign key constraint that doesn't exist, there should be no difference as a result of removing these lines. Note that you may have to remove some of the following lines if you get similar errors.
> 1 votes

---
Tags: upgrade, database
---


# Question
Title: Total amount not populating for online form
I am building out my first front end form and the total amount field is not populating. We are running on Joomla 3.8.12 and CiviCRM 5.5.1.

http://dev.victoryliving.org/index.php/donate

Please help, thank you!

# Answer
From what I can see, it looks like you're not using a price set - so it's actually a mystery why "Total Amount" appears in the first place. You don't have anything to total! I just confirmed on a test site that I don't normally see "Total Amount" on a contribution page that doesn't require it.

If you could edit your question to display a screenshot of the price configuration for this contribution page, perhaps someone will notice something amiss.
> 1 votes

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


title: event income reports

text:
# Question
Title: event income reports
I'm not getting the results that I expect from the event income reports. I've used the "No-show" status for people who have paid but don't turn up to the event. However the report only seems to included the income for participants with a status that is "Counted". That's right for the attendee numbers, but not for the finance. If I set the "No-Show" status to be "Counted" then I assume the figures will come right, but it won't show the numbers actually at the event. I can't think of a way round this.

# Answer
> 1 votes
I think that this is simply not covered. You can read more related threads on SE question How to create a contribution or event report that indicates amount of payment and balance owed and at the old forum on Event Income Report Misleading - need to look at actual contributions, not fees.

How can we get reports with real event payment status and no expected incomes? This is a very common request from our users that we have yet to respond.

---
Tags: civireport
---


# Question
Title: civiCRM tab is not showing on top right corner of content?
I want a civiCRM tab on content of drupal. I install drupal 7 and civicrm 4.7.

# Answer
You will need to install and enable webform civicrm module to integrate civicrm fields with webform.

HTH

Pradeep
> 3 votes

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


title: Filter Constituents on "Do not trade?"

text:
# Question
Title: Filter Constituents on "Do not trade?"
Before I add a custom field to handle this, I thought I'd make sure I'm not missing something.

When I go to Contact Reports -\> Constituent Summary, it appears you can include and filter on all the "Do not" privacy settings EXCEPT "Do not trade."

Is there a way to add the ability to filter on "Do not trade?" Any idea why that one in particular is left out?

Thanks.

# Answer
People build reports based on their clients requirement and if they think this is going to help others in the community they contribute code either in the form of sending PR to core or release as an extension publicly.

I think (but not confident) Extended reports extension does provides some additional filtering and reports, its worth trying if it meets your need. Else you can use alterReportVar hook to add filter to reports.

Hope i answered your question!

Pradeep
> 4 votes

---
Tags: contacts, reports, privacy
---


title: CiviMembership not on Administer Menu

text:
# Question
Title: CiviMembership not on Administer Menu
My CiviCRM does not seem to have CiviMembership. It is not listed on the administer menu on the top menu.

How do I proceed if I want to use CiviMembership?

# Answer
> 7 votes
Go to administer \> system settings \> components and enable it.

---
Tags: civimember
---


# Question
Title: Use the API to loop through contacts and copy field value
Been playing with the API and see how to query for a result set but not the appropriate way to get a result set and update it batch style(over 4000 contacts in this case).

My goal is to gather all contacts with an empty custom field value and copy the text value for 'current employer' into that field.

This is in php using the 'class.api.php'. If there is a more appropriate way to achieve this I am open to suggestions.

# Answer
I think you can use chain api to do this. Try using below snippet

```
$result = civicrm_api3('Contact', 'get', [
  'sequential' => 1,
  'return' => ["current_employer_id"],
  'custom_1' => ['IS NULL' => 1],
  'employer_id' => ['IS NOT NULL' => 1],
  'api.Contact.create' => [
    'id' => "\$value.id",
    'custom_1' => "\$value.current_employer_id"
  ],
]);

```

(Replace custom\_1 with custom field id from your system.)

HTH

Pradeep
> 2 votes

---
Tags: api
---


# Question
Title: Membership Form without Contribution Request
Is there a way to make a membership signup form that does not ask for a donation?

# Answer
Ben,

You can create **zero** membership fee membership type and include it on contribution page and turn off 'CONTRIBUTION AMOUNTS SECTION ENABLED' under Amounts tab of contribution page.
> 3 votes

---
Tags: civicontribute, civimember
---


# Question
Title: Good resource for learning civicrm and drupal
I want to learn civiCRM and drupal. Please tell me some good resources and tutorial with example.

Thanks in advance.

# Answer
There are lots of tutorials available for CiviCRM. Here are some of the links that were useful for me while i was training someone 2-4 years ago.

You can also look to past CiviCRM conferences. A lot of presenters upload their notes to the session pages or visiting local events if they are held nearby your places.

Similarly you can find lots of videos and documentation on drupal.

If you have good knowledge of PHP, MYSQL, Javascript then try to submit a patch for open issues or feature request.

HTH

Pradeep
> 6 votes

# Answer
I would recommend http://codekarate.com for Drupal.

For CiviCRM the online documentation is excellent.

https://docs.civicrm.org/user/en/latest/
> 3 votes

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


# Question
Title: Where does the PID value come from in the event self-cancellation link?
In event registration confirmation emails, there is a link to manage (cancel/transfer) your own registration, if that box is ticked in the event setup. This is great! I want to add this to the reminder emails as well, but I can't work out what the 'PID' refers to in the link:

`https://example.org/civicrm/?page=CiviCRM&q=civicrm/event/selfsvcupdate&reset=1&pid=[number]&cs=[string]`

...where \[number\] is a number and \[string\] is a long string.

So `cs` is obviously the user's checksum, but what is `pid` in this context? It's not the event ID. I'm hoping I can grab this from a smarty tag somehow.

I'm on WordPress 4.9.8 and CiviCRM 5.4

# Answer
In the Event self-service update form referenced in your link the URL fragment "PID" refers to the Participant ID (as correctly identified by Pradeep Nayak).

The mechanism for obtaining this and other information in a Smarty tag can be achieved using the CiviCRM API within Smarty as outlined in the docs here: https://docs.civicrm.org/dev/en/latest/api/usage/#smarty

The built-in API Explorer can assist in determining how to retrieve the information you require from the API and provides Smarty code for your use based on the queries you build.

The code for the "selfsvcupdate" form is here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/Form/SelfSvcUpdate.php. See Line 216 for a direct link to the retrieval and lookup of the PID value from the URL.

**Generic Example**

```
{crmAPI var='result' entity='Participant' action='get' event_id=9 contact_id="user_contact_id"}
{foreach from=$result.values item=participant}
  {$participant.id}
{/foreach}

```

*The code above will retrieve participant ID for the event with ID 9 for the currently logged in user.*

**Scheduled Reminder Example**

Scheduled reminders are missing the necessary tokens to make this easy - after a bit of experimentation this code works - but it may be a bit fragile. It is however portable (limited static information, no hardcoded IDs)!

```
{capture assign=eventID}{event.event_id}{/capture}

 Event ID = {$eventID}<br /> // DEBUG Statement - DO NOT USE IN PROD

{capture assign=contactID}{contact.contact_id}{/capture}

 Contact ID = {$contactID}<br /> // DEBUG Statement - DO NOT USE IN PROD

{capture assign=participantID}{crmAPI var='result' entity='Participant' action='get' event_id=`$eventID` contact_id=`$contactID`}{$result.id}{/capture}

Participant ID = {$participantID}<br/> // DEBUG Statement - DO NOT USE IN PROD

{if $participantID}
{capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participantID`&{contact.checksum}"  h=0 a=1 fe=1}{/capture}
{/if}

{if $selfService }
<a href="{$selfService}">{ts}Click here to manage your registration.{/ts}</a>
{/if}

```
> 3 votes

# Answer
I believe PID is the participant ID registered of an event. This is the primary id from civicrm\_participant table.

HTH

Pradeep
> 3 votes

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


# Question
Title: Cant find a way to access the CiviCRM $form object in Drupal
I'm having trouble accessing the CiviCRM $form object on a Drupal site running CiviCRM.

In Drupal, I can use hook\_form\_alter() anywhere in code and make changes to any form object in Drupal. I'm trying to do the same thing for a CiviCRM form, but none of the functions or hooks seem to give me access to the $form object.

Also, I'm attempting to do this from a custom script with Drupal and CiviCRM bootstrapped. If someone could point me in the right direction, I would be most grateful.

\[EDIT:\] I've tried this, but can't get any data back for anything...

```
define('DRUPAL_ROOT', $_SERVER['DOCUMENT_ROOT']);
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

eval(`cv php:boot`); // to bootstrap CiviCRM according to their documentation

function mycustomhook_civicrm_buildForm($formName, &$form) {
    dpm($form);
    dpr($form);
    kpr($form);
    var_dump($form);
    print_r($form);
}

```

What am I missing?

# Answer
@soupmagnet Welcome to CiviCRM world!

You can alter the form elements or add your own form element to any CiviCRM forms using CiviCRM buildForm hook. The documentation provided good example on how to do it. Please implement this hook either in CiviCRM extension or Drupal module.

HTH

Pradeep
> 2 votes

---
Tags: drupal, forms
---


title: Mailing template not picking up images

text:
# Question
Title: Mailing template not picking up images
Drupal: 7.59 CiviCRM 5.3.2 After Upgrading to 5.3.2 my mail temaplates are no longer showing the images (logo signature) I checked the path in the template and they are correct but the generated PDF shows 'image not found' Also I do not get a editor for the template just the raw HTML

Any suggestions?

Thanks

# Answer
> 1 votes
The issue seemed to have been caused by an automatically created .htaccess file in the Resource Image folder. This is being automatically generated but I don't know by what. The contents of the automatically generated file was Order allow,deny Deny from all This prevented the image file from being access. As a quick fix I renamed the file and a new file was there again in less than a minute. I edited the file to allow access and that resolved the issue. Though I don't understand where the htaccess file is created from, this can be marked as resolved. Thanks

# Answer
> 0 votes
It sounds like there's something in your Resource URL that's off. I would open the web browser's Developer tools (press F12) and go to the Network tab. I expect that when you go to the template editing page, you'll see some 404 errors on the Network tab. Compare the URLs being loaded to what the actual file location is and you may have your answer. Don't forget to check for http:// on pages that should be https:// and vice versa.

---
Tags: upgrade, message-templates, images
---


# Question
Title: Contact Layout Editor menu item not available
I installed the new Contact Layout Editor extension, but I am not finding the new menu item, which should be at Administer / Customize Data and Screens.

Joomla 3.8.12 Civi 5.5.1

(Aside: in this process, I discovered that the extension created a new SQL table as MyISAM, which threw a warning in Civi. Easy enough to change the table to InnoDB, but it seems like a new extension should be using InnoDB by default. See https://github.com/civicrm/org.civicrm.contactlayout/issues/14. Fixing the engine did not solve the problem of the missing menu.)

# Answer
> 4 votes
I had the same problem but fixed it - the problem was that I didn't have the pre requisites installed *before* installing the extension. One of them I installed afterwards. So, I disabled then uninstalled the contact layout extension, then re-installed it. Then the menu item appeared as 'Contact Summary Layouts' as the last item on the 'Customise Data and Screens' menu.

---
Tags: extension, contact-layout-editor
---


# Question
Title: How to avoid a duplicate membership for same contact
When I connect a contact to same membership type, the system displays a warning message that it is a duplicate membership for the same contact, but still allows to to perform the action. Then I get two active records for the contact with same membership. How can I avoid it in such way that the system will block the ability to create more that one active record for same membership type?

# Answer
> 3 votes
I suspect the OP needs to avoid the creation of double backend membership with the same type. Something which would look like -

This could be a bug(not sure) as this doesn't happen when registered through contribution pages. I don't think there is any setting in civi UI which would avoid this, but it is possible with a small extension(learn here) where you need to check for double membership type registering for a single contact id.

# Answer
> 1 votes
It sounds to me like a staff training issue rather than a software issue. The way you describe the problem, your staff are going to create a new membership, then when a big warning box pops up telling them that it already exists, they ignore it and carry on anyway.

If staff training doesn't solve the problem (e.g. you are using a revolving door of volunteers and there is no way to train them) then you probably shouldn't be giving them access to your CRM at all. Instead, you could set some Webforms to let them enter data for you without the power to create duplicate memberships.

---
Tags: civimember
---