title: Trouble saving changes to a report

text:
# Question
Title: Trouble saving changes to a report
EDIT: This question turned out to be, in practical terms, something different than I originally thought I was asking. I am changing the title so that others will find the answer more easily in the future.

I've got CiviCRM 5.10.4 running on Drupal 7.66, and one particular function ("Subscriber Donor Report") is blowing up on an underlying SQL error. I turned on debugging, and following is what I see. Looks like a hard-core internals problem that I could never deal with on my own. Incidentally, this problem has persisted across several updates of Civi (since 5.4 maybe?) and also Drupal (at least since 7.60). Is there any hope? Could this possibly be caused by some weird data in the db? I wouldn't normally think so. Thanks.

```
Database Error Code: The used SELECT statements have a different number of columns, 1222
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
(SELECT * FROM civicrm_tmp_e_dflt_0441f87ccf495b6b8c955d3a4407fde6)
UNION ALL
(SELECT * FROM civireport_contribution_detail_temp2) [nativecode=1222 ** The used SELECT statements have a different number of columns]
    [type] => DB_Error
    [user_info] => CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
(SELECT * FROM civicrm_tmp_e_dflt_0441f87ccf495b6b8c955d3a4407fde6)
UNION ALL
(SELECT * FROM civireport_contribution_detail_temp2) [nativecode=1222 ** The used SELECT statements have a different number of columns]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
(SELECT * FROM civicrm_tmp_e_dflt_0441f87ccf495b6b8c955d3a4407fde6)
UNION ALL
(SELECT * FROM civireport_contribution_detail_temp2) [nativecode=1222 ** The used SELECT statements have a different number of columns]"]
)

```

```
#0 <path>/sites/all/modules/civicrm/CRM/Core/Error.php(190): CRM_Core_Error::backtrace()
#1 <path>/sites/all/modules/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 <path>/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#3 <path>/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#4 <path>/sites/all/modules/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...", "DB_Error", TRUE)
#5 <path>/sites/all/modules/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 <path>/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...", "1222 ** The used SELECT statements have a different number of columns")
#7 <path>/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 <path>/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#9 <path>/sites/all/modules/civicrm/packages/DB/DataObject.php(2415): DB_common->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#10 <path>/sites/all/modules/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#11 <path>/sites/all/modules/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#12 <path>/sites/all/modules/civicrm/CRM/Core/DAO.php(1413): CRM_Core_DAO->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...", TRUE)
#13 <path>/sites/all/modules/civicrm/CRM/Report/Form.php(3710): CRM_Core_DAO::executeQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...", (Array:0))
#14 <path>/sites/all/modules/civicrm/CRM/Report/Form/Contribute/Detail.php(568): CRM_Report_Form->executeReportQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp3  DEFAULT CHARACTE...")
#15 <path>/sites/all/modules/civicrm/CRM/Report/Form.php(2816): CRM_Report_Form_Contribute_Detail->beginPostProcessCommon()
#16 <path>/sites/all/modules/civicrm/CRM/Report/Form.php(3473): CRM_Report_Form->beginPostProcess()
#17 <path>/sites/all/modules/civicrm/CRM/Report/Form.php(886): CRM_Report_Form->postProcess()
#18 <path>/sites/all/modules/civicrm/CRM/Core/Form.php(585): CRM_Report_Form->preProcess()
#19 <path>/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#20 <path>/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Report_Form_Contribute_Detail), "display")
#21 <path>/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Contribute_Detail), "display")
#22 <path>/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#23 <path>/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#24 <path>/sites/all/modules/civicrm/CRM/Report/Page/Instance.php(89): CRM_Utils_Wrapper->run("CRM_Report_Form_Contribute_Detail", NULL, (Array:0))
#25 <path>/sites/all/modules/civicrm/CRM/Core/Invoke.php(309): CRM_Report_Page_Instance->run((Array:4), NULL)
#26 <path>/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#27 <path>/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#28 <path>/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:4))
#29 <path>/includes/menu.inc(527): civicrm_invoke("report", "instance", "4")
#30 <path>/index.php(21): menu_execute_active_handler()
#31 {main}

```

# Answer
Although it's not ultimately an answer to why the code is blowing up, the simplest solution to my problem was found in the report's settings. Under the `Sorting` tab, the report was set to sort on `Contribution Status`. This is what caused the blow up. If I set it to sort on another column, like `Contact Name`, the report runs fine.

So now I have another, hopefully much simpler, problem: I cannot resave the report with the new sort setting. Really? You can't change the options in a report definition and then save them? I looked in the (apparently old) docs, which show clearly an `Update Report` button, which no longer exists. I also found this, which presumably was correct at the time, but didn't remain in the UI long. I don't have a `Save` item under my Actions menu. This is, at best, terrible UX. Can someone enlighten me? Or is the answer implicit in the above comment: reports are write-only, and if you need to make a change, you redo it from scratch?
> 3 votes

# Answer
Check Drupal permissions at `http://site/admin/people/permissions`. It might be "CiviReport: save Report Criteria".
> 3 votes

---
Tags: drupal, mysql, sql
---


# Question
Title: CiviCRM & Joomla Username Check Availability
I am trying to get CiviCRM (5.3.0) and Joomla (3.8.10) working with the Username Check Availability link. I have checked the code and found the following:

`<a id="checkavailability" href="#" onclick="return false;"><strong>Check Availability</strong></a>`

I cannot figure out if I turned something off or is there a problem with the Joomla integation? The accounts are being created in Joomla when registering by using a Profile.

Any suggestions would be appreciated.

Thanks.

# Answer
> 1 votes
It appears that the CiviCRM 5.12.3 and Joomla 3.9.5 combination, the issue is fixed.

---
Tags: profile, joomla
---


# Question
Title: Is it possible to write a report to send a weekly digest of people who have filled in a webform survey
I would like to send a report once a week to a client with everyone who has filled in a survey in the last week and has a particular tag.

IN civireport I can see I can filter by activity subject but the field activity date only has last 12 months, custom date, null, not null. I would like "last 7 days".

Also I can only see group not tag. I'm wondering if civireport can do this?

Thanks!

# Answer
Are you using the *Activity Details Report*? It has a filter on activity data *Last Seven Days including today*. See:

In order to filter on a tag, you can create a smart group that contains all the contacts with the tag. That gives you the option to use the Group filter.
> 2 votes

---
Tags: civireport
---


# Question
Title: Error viewing/editing/deleting contributions, error log included
Recently did an upgrade to all parts of our Civi install. Our build is run fully on a local machine (localhost) on an XAMPP stack, now updated to drupal 7 and latest production CivCRM version.

I'm having trouble viewing, editing, or deleting some contributions. It seems new ones that I enter where FinancialType doesn't equal Check are not behaving well. If I try to view, edit, or delete them, I get a yellow box error

One of parameters (value: ) is not of the type Integer

This affects new contributions I enter and ones that are dated prior to the software upgrades. The error log for the most recent occurrence is pasted below. Thanks for any assistance!

```
Apr 25 09:20:21  [info] $Fatal Error Details = Array
(
    [message] => One of parameters  (value: ) is not of the type Integer
    [code] =>
)

Apr 25 09:20:21  [info] $backTrace = #0 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(381): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Utils/Type.php(554): CRM_Core_Error::fatal("One of parameters  (value: ) is not of the type Integer")
#2 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1518): CRM_Utils_Type::validate("", "Integer")
#3 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1396): CRM_Core_DAO::composeQuery("SELECT ft.id, ft.total_amount FROM civicrm_financial_trxn ft INNER JOIN civic...", (Array:2), TRUE)
#4 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/BAO/FinancialTrxn.php(98): CRM_Core_DAO::executeQuery("SELECT ft.id, ft.total_amount FROM civicrm_financial_trxn ft INNER JOIN civic...", (Array:2))
#5 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(4030): CRM_Core_BAO_FinancialTrxn::getBalanceTrxnAmt("64601")
#6 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Contribute/Form/AbstractEditPayment.php(741): CRM_Contribute_BAO_Contribution::getPaymentInfo("64601", NULL, TRUE)
#7 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution.php(248): CRM_Contribute_Form_AbstractEditPayment->assignPaymentInfoBlock()
#8 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Form.php(585): CRM_Contribute_Form_Contribution->preProcess()
#9 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#10 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_Contribution), "display")
#11 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution), "display")
#12 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#13 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(323): CRM_Core_Controller->run()
#14 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(374): CRM_Contribute_Page_Tab->edit()
#15 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(309): CRM_Contribute_Page_Tab->run((Array:4), NULL)
#16 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#17 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#18 /Applications/XAMPP/xamppfiles/htdocs/drupal/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:4))
#19 /Applications/XAMPP/xamppfiles/htdocs/drupal/includes/menu.inc(527): civicrm_invoke("contact", "view", "contribution")
#20 /Applications/XAMPP/xamppfiles/htdocs/drupal/index.php(21): menu_execute_active_handler()
#21 {main}

```

# Answer
I think its because the financial type you used while creating contribution don't have 'Accounts Receivable Account is' and 'Expense Account is' account attached to it.

To check you can navigate to Administer \>\> CiviContribute \>\> Financial type.

Besides Financial type click on 'Accounts'

Check if you can see 'Accounts Receivable Account is' and 'Expense Account is'in the list

If not then click on 'Assign Account' button and then create a 'Accounts Receivable Account is' and 'Expense Account is' account

Cheers

Pradeep
> 3 votes

---
Tags: civicontribute, error
---


# Question
Title: Nothing happens when selecting any "Actions" dropdown options
After upgrading to 5.12.1 (and then 5.12.3), none of the dropdown options under "Actions" work. For example, when conducting an Advanced Search and selecting, "Print/Merge Documents" or "Export Contacts," nothing happens.

Here is the console error:

```
main-menu.js?r=dBZqC:66 Uncaught TypeError: Cannot read property 'trim' of undefined
    at isQuickSearchOnGoing (main-menu.js?r=dBZqC:66)
    at HTMLDocument.<anonymous> (main-menu.js?r=dBZqC:99)
    at HTMLDocument.dispatch (jquery.min.js?r=dBZqC:3)
    at HTMLDocument.r.handle (jquery.min.js?r=dBZqC:3)
    at Object.trigger (jquery.min.js?r=dBZqC:3)
    at HTMLInputElement.<anonymous> (jquery.min.js?r=dBZqC:3)
    at Function.each (jquery.min.js?r=dBZqC:2)
    at n.fn.init.each (jquery.min.js?r=dBZqC:2)
    at n.fn.init.trigger (jquery.min.js?r=dBZqC:3)
    at n.fn.init.n.fn.<computed> [as click] (jquery.min.js?r=dBZqC:4)

```

Any insight would be greatly appreciated!

# Answer
The problem was a conflict with the CiviCRM Bootstrap Theme. Disabling the extension resolved the problem.
> 4 votes

---
Tags: wordpress, search, actions
---


# Question
Title: Update particular contribute based on contribute id with civicrm_api3
I am working with civi 5.10. How can i update the conribution table row based on contribute id . I want replace that below code with civicrm\_api3().

```
        db_update('civicrm_contribution') // Table name no longer needs {}
        ->fields(array(
        'contribution_status_id' => $contribution_status_id,
        ))
        ->condition('id', $contrib_data[0]->id, '=')
        ->execute();

```

# Answer
> 2 votes
You can use civicrm api to process CRUD on CiviCRM Database.

To update contribution you can use

```
$result = civicrm_api3('Contribution', 'create', [
  'id' => $contrib_data[0]->id,
  'contribution_status_id' => $contribution_status_id,
]);

```

Cheers

Pradeep

---
Tags: drupal, civicontribute
---


# Question
Title: How can I update the CiviMobile 2.0 extension to the CiviMobileAPI 3.0 extension?
I had v2 of the CiviMobile extension installed on a WP/Civi site for testing to see how the mobile app would perform. I see that a new version of the app and the extension has been released, so tried to update the extension and just keep getting a fatal error. Looking at the log, it appears to be caused by an incorrect default value that the extension is trying to set in the 'civicrm\_contact\_push\_notification\_messages' table:

```
   string(986) "CREATE TABLE IF NOT EXISTS  `civicrm_contact_push_notification_messages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `contact_id` int(10) unsigned NOT NULL,
  `message` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entity_table` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entity_id` int(11) DEFAULT NULL,
  `send_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `is_read` tinyint(4) DEFAULT '0',

```

How can I address this and get the extension installed?

# Answer
I think this might be the issue. As posted here: https://dba.stackexchange.com/questions/132951/cant-default-date-to-current-timestamp-in-mysql-5-5 Versions of MySQL from 5.6.x will support this, but I'm currently running 5.5.62 which does not support CURRENT\_TIMESTAMP as a default option for a DATETIME. It suggests setting the column type as a TIMESTAMP. I wonder if that will break the extension, though? Interesting, as I though CiviCRM was now using TIMESTAMP by default across the board.
> 1 votes

---
Tags: extension
---


# Question
Title: How to allow anonymous user to edit their contact details on CiviCRM?
I have created a profile with following fields First Name Last name Street address Postcode Phone

My plan is to include the profile link to Contribution Receipt template with hash and let the donor update their personal details if any mistake is in his profile. My link looks like this.

https://example.com/civicrm/profile/edit?gid=48&id=8949&11e24e6f361dceacd63ea0120b00c871&reset=1

But when the link is clicked it says , `You do not have permission to edit this contact record. Contact the site administrator if you need assistance.`

This is the permission for anonymous user is set in drupal:

* CiviCRM: profile create
* CiviCRM: profile view
* CiviCRM: profile edit
* CiviCRM: access all custom data
* CiviCRM: access contact reference fields

What am I doing wrong? Can anyone help please? Thanks

# Answer
> 4 votes
The link is missing checksum parameter(cs). It should be

https://example.com/civicrm/profile/edit?gid=48&id=8949&cs=11e24e6f361dceacd63ea0120b00c871&reset=1

Thanks

Pradeep

---
Tags: profile, permissions
---


# Question
Title: Undefined property: CRM_Contact_DAO_Contact::$contact_id in civicrm_entity_contact_user_get()
Following the advice I received in Allow only existing CiviCRM contacts to create own Drupal account, I'm trying to implement Drupal Rules to create an associated Drupal user whenever a CiviCRM contact is added to the 'Web Site Users' group.

I'm running Drupal Core 7.66 and CiviCRM 5.12.3. Trying to get this working I've installed Entity API 1.9, Rules 2.12, and CiviCRM Entity 2.2.

This is the rule I'm using:

Creating a new contact in CiviCRM is correctly creating a new Drupal user, but I'm also getting this error, with no other visible consequences:

> Notice: Undefined property: CRM\_Contact\_DAO\_Contact::$contact\_id in civicrm\_entity\_contact\_user\_get() (line 3671 of /var/sites/c/civicrm.jesusshapedpeople.net/public\_html/sites/all/modules/civicrm\_entity/civicrm\_entity.module).

Should I be concerned? Am I doing something wrong? Is there a fix?

# Answer
With further testing I have established that was caused by a clash with another rule with the same event and weight. Changing the weight on the other rule has removed the error notice.

The other rule (checking for an existing account for the user, and unblocking that rather than creating a new one) still isn't working, but that's another question!

I'm not really clear why the order the rules run in should have made much difference or triggered this error, but happy to have it cleared up for now!
> 1 votes

# Answer
The message is a 'Notice' which can sometimes be ignored. However, looking at the code causing the message the purpose of the function is to load a user entity based on the contact id but the contact id is not set which is fundamental to the purpose of that function.

It would take a bit of debugging to track down where and why that is being called from your rule in a way that causes the contact\_id not to be set - and ideally you would do that. Alternatively providing it is does what you need in creating the Drupal user correctly you could choose to ignore it.
> 1 votes

---
Tags: civicrm-entity, drupal-rules
---


# Question
Title: PCP is still active after contribution page is disabled
The current behavior of civicrm keeps the PCP as active even if the contribution page related to it is disabled.

A real problem with this is you have someone who has made a P2P contribution page who might have no clue the page has been disabled by a site admin and is out promoting the page!

Thoughts on expected behavior?

* Disable PCP manually when CP is disabled.
* Keep PCP as it is and change the error message on PCP load.
* Disable the PCP and send an email notification to the creator.
* The current error is perhaps the correct and enough response to be shown to the user

# Answer
> 1 votes
Ok I was able to confirm this is also happening with Event PCPs - though the error message is a little easier on the eyes - which really helps (the red and black letters on the yellow background you get for 'not available' Contribution PCPs make it look like the site is broken).

Re: Answer as to what should happen may be different for Event PCPs vs Contribution PCPs - I'd be in favour that the PCP remain non-functional. Once you conclude an Event and have done your books/finances on it you want to be able to file it. Same with Contribution PCPs (which will often have a Campaign associated with it). There needs to be a date where you can say with confidence: this Event or this Campaign raised $x;

So my vote would be for option 4 \[a nicer error message\] - you may be able to get that into Core without too many issues.

For our Event PCPs we use Views to get people to their nice looking PCP page - which then with a Donate button links to the donate page that will show the 'currently unavailable' message. That means we have the option to notify donors ahead of time that the Event/Campaign is no longer active by filtering out non-active Events in the View - and in addition: people are naturally promoting their nice looking PCP page - which remains active/functional. But there we could grey out the button.

---
Tags: civicontribute, pcp
---


title: Can't save reports

text:
# Question
Title: Can't save reports
I'm using CiviCRM 4.7.11 on Drupal. For some time now (not sure how many minor versions) it has not been possible to create reports or to save changes to any reports. The button ("Update Report", I believe it used to say) is missing.

This is the case on my live and dev sites. On the dev site I disabled all extensions which did not help. I can't check on demo.civicrm.org as it is currently broken.

# Answer
> 3 votes
There is actually no problem with saving reports, it's just that the UI has changed, and you now need to pick "Save" from the "Actions" menu.

# Answer
> 3 votes
I faced similar issue - only to discover after a bit of digging that a new CMS acl persission "save Report Criteria" - was added in later version of civi and I didnt grant that to the user.

Hope this helps

---
Tags: civireport, reports
---


title: Case Status at a Specific Time

text:
# Question
Title: Case Status at a Specific Time
I'm on Drupal 7 and CiviCRM 5.10 (yes, I'll update to 5.12 this weekend). I have a case with multiple case status: Active, Maintenance, Closed. When case activities are entered in the system, it doesn't seem to save the case status at the time the case activity is entered. For example:

* 4/26/19 Case Opened
* 4/26/19 Client meeting
* 4/28/19 Case status changed from active to maintainence
* 4/30/19 Housing visit
* 4/31/19 Housing visit

If I were to create a Views report of the case activities, I see that the case status for 4/26/19 is labeled "Maintenance" but it should "Active" (which is the case status at the time it was entered).

Does anyone know how I could create a report and pull the case status AT the time of the activities entry?

# Answer
You need to base it on the entire history of activity subjects which is a bit tricky. I'm not sure how to do it in a drupal view.

In pseudocode it would be something like SELECT ChangeCaseStatus activity with MAX(date) earlier than activity date currently being output. If null then Active.
> 1 votes

---
Tags: civicase
---


# Question
Title: Rounding differences between Contribution and Bookkeeping reports
I am using Drupal 7.66 and CiviCRM 5.10.4. There is a small difference between the total of a Contribution report and a Bookkeeping report using the same filters and therefore intended to produce an identical result. However under certain circumstances there are small rounding errors between the two reports.

Take the following example. A payment of $155.00 is paid via a payment gateway in three monthly instalments. The first instalment is $51.68 and shown in the contribution report correctly (as an aside the next two payments will be $51.66).

However in the Bookkeeping report the first payment is shown as $51.67 which is the rounded up value of $155.00 divided by three which gives $51.66 recurring. In the following month the contribution report will no doubt show the payment to be $51.66 and the Bookkeeping report will display $51.67.

This error also finds its way into the Extended Reports extension. I realise that this is not a big issue but it would be nice if the reports displayed identical totals.

# Answer
This looks like an error. The bookkeeping report is based on records in two different tables than the contribution report. From this report it seems the algorithm for ensuring the series sums to the proper figure used by contributions by having one value different is not properly setting the financial line item values. IIRC there have been some recent changes in this area. Please open an issue at https://lab.civicrm.org/dev/financial/issues and assign it to me.
> 2 votes

---
Tags: civireport
---


title: Search for contacts with documents

text:
# Question
Title: Search for contacts with documents
I am in a process of migrating CiviCRM data to a separate database. I am using the **Documenten** extension to store some files attached to my contacts and I would like to find the contacts which have documents attached.

The extension page says it should enable this functionality but I cannot find it. Any advice would be greatly appreciated.

# Answer
It should be at url /civicrm/documents/search.

It looks like you need administer CiviCRM permission to use it.

If for some reason it isn't finding it try rebuilding the menu with /civicrm/menu/rebuild?reset=1

I'm assuming you mean this extension: https://github.com/CiviCooP/org.civicoop.documents/blob/master/documents.php#L95
> 1 votes

---
Tags: search, attachments, document-management
---


# Question
Title: Unwanted user registrations in WordPress
I am using a Profile to create WordPress users when contacts become members and this works fine, except that I have to have "Membership: Anyone can Register" allowed in WordPress Settings \> General

This means that anyone out there on the internet can register from the login page (or possibly with some bots). How can I stop this, while still allowing the creating of accounts for new members?

I'm using WP 5.1.1 and CiviCRM 5.11.0

# Answer
> 1 votes
The CiviCRM WordPress Member Sync plugin can help you do this. It will auto-create a WordPress user when a Membership has been successfully created via a Contribution page.

# Answer
> 1 votes
You'll need to redirect the WordPress signup page (usually to your "become a member" page, though it doesn't have to be) so that there's no way to get to the standard WordPress account creation flow. This can be done at the web server level or via a redirects plugin.

You will need to redirect `/wp-login.php?action=register` to your alternate URL.

# Answer
> 0 votes
Google Recaptcha will do wonders to stop the bots from registering. There are also some honeypot plugins out there.

---
Tags: wordpress, user-account
---


# Question
Title: Twilio extension failure w/ DB Error: unknown error
Twilio extension worked great for the past year, but fails now. Outgoing messages seem unable to reach the Twilio API, though CRON is working. I've tried different versions of PHP with no effect. I've disabled all plugins except Civi, also with no effect. No changes were made to our extension settings or to our Twilio account configuration.

From the Jobs Log:

> Entity: Job Action: process\_sms
>
> Summary
>
> Finished execution of Send Scheduled SMS with result: Failure, Error message: DB Error: unknown error
>
> Details
>
> Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}
>
> Full message: Finished execution of Send Scheduled SMS with result: Failure, Error message: DB Error: unknown error

That's a bit vague, so I installed a working log viewer extension. Seems we're getting one of these every minute when the CRON job executes and fails to connect with Twilio.

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] =>
                    SELECT      civicrm_mailing_event_queue.id,
                                civicrm_phone.phone as phone,
                                civicrm_mailing_event_queue.contact_id,
                                civicrm_mailing_event_queue.hash,
                                NULL as email
                    FROM        civicrm_mailing_event_queue
                    INNER JOIN  civicrm_phone
                            ON  civicrm_mailing_event_queue.phone_id = civicrm_phone.id
                    INNER JOIN  civicrm_contact
                            ON  civicrm_contact.id = civicrm_phone.contact_id
                    LEFT JOIN   civicrm_mailing_event_delivered
                            ON  civicrm_mailing_event_queue.id = civicrm_mailing_event_delivered.event_queue_id
                    LEFT JOIN   civicrm_mailing_event_bounce
                            ON  civicrm_mailing_event_queue.id = civicrm_mailing_event_bounce.event_queue_id
                    WHERE       civicrm_mailing_event_queue.job_id = 807
                        AND     civicrm_mailing_event_delivered.id IS null
                        AND     civicrm_mailing_event_bounce.id IS null
                        AND    ( civicrm_contact.is_opt_out = 0
                        OR       civicrm_contact.do_not_sms = 0 ) [nativecode=1712 ** Index civicrm_mailing_event_queue is corrupted]
    [type] => DB_Error
    [user_info] =>
                    SELECT      civicrm_mailing_event_queue.id,
                                civicrm_phone.phone as phone,
                                civicrm_mailing_event_queue.contact_id,
                                civicrm_mailing_event_queue.hash,
                                NULL as email
                    FROM        civicrm_mailing_event_queue
                    INNER JOIN  civicrm_phone
                            ON  civicrm_mailing_event_queue.phone_id = civicrm_phone.id
                    INNER JOIN  civicrm_contact
                            ON  civicrm_contact.id = civicrm_phone.contact_id
                    LEFT JOIN   civicrm_mailing_event_delivered
                            ON  civicrm_mailing_event_queue.id = civicrm_mailing_event_delivered.event_queue_id
                    LEFT JOIN   civicrm_mailing_event_bounce
                            ON  civicrm_mailing_event_queue.id = civicrm_mailing_event_bounce.event_queue_id
                    WHERE       civicrm_mailing_event_queue.job_id = 807
                        AND     civicrm_mailing_event_delivered.id IS null
                        AND     civicrm_mailing_event_bounce.id IS null
                        AND    ( civicrm_contact.is_opt_out = 0
                        OR       civicrm_contact.do_not_sms = 0 ) [nativecode=1712 ** Index civicrm_mailing_event_queue is corrupted]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="
                    SELECT      civicrm_mailing_event_queue.id,
                                civicrm_phone.phone as phone,
                                civicrm_mailing_event_queue.contact_id,
                                civicrm_mailing_event_queue.hash,
                                NULL as email
                    FROM        civicrm_mailing_event_queue
                    INNER JOIN  civicrm_phone
                            ON  civicrm_mailing_event_queue.phone_id = civicrm_phone.id
                    INNER JOIN  civicrm_contact
                            ON  civicrm_contact.id = civicrm_phone.contact_id
                    LEFT JOIN   civicrm_mailing_event_delivered
                            ON  civicrm_mailing_event_queue.id = civicrm_mailing_event_delivered.event_queue_id
                    LEFT JOIN   civicrm_mailing_event_bounce
                            ON  civicrm_mailing_event_queue.id = civicrm_mailing_event_bounce.event_queue_id
                    WHERE       civicrm_mailing_event_queue.job_id = 807
                        AND     civicrm_mailing_event_delivered.id IS null
                        AND     civicrm_mailing_event_bounce.id IS null
                        AND    ( civicrm_contact.is_opt_out = 0
                        OR       civicrm_contact.do_not_sms = 0 ) [nativecode=1712 ** Index civicrm_mailing_event_queue is corrupted]"] )

```

And here is the corresponding backtrace:

```
 [info] $backTrace = #0 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Core/Error.php(948): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /REDACTED-PLUGINS-PATH/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#3 /REDACTED-PLUGINS-PATH/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#4 /REDACTED-PLUGINS-PATH/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...", "DB_Error", TRUE)
#5 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...", "1712 ** Index civicrm_mailing_event_queue is corrupted")
#7 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#9 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#10 /REDACTED-PLUGINS-PATH/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#11 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#12 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(1125): CRM_Core_DAO->query("\n                    SELECT      civicrm_mailing_event_queue.id,\n          ...")
#13 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(540): CRM_Mailing_BAO_MailingJob::findPendingTasks("807", "sms")
#14 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(199): CRM_Mailing_BAO_MailingJob->deliver(Object(org_civicrm_sms_twilio), NULL)
#15 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Mailing/BAO/Mailing.php(2843): CRM_Mailing_BAO_MailingJob::runJobs(NULL, "sms")
#16 /REDACTED-PLUGINS-PATH/civicrm/civicrm/api/v3/Job.php(380): CRM_Mailing_BAO_Mailing::processQueue("sms")
#17 /REDACTED-PLUGINS-PATH/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(100): civicrm_api3_job_process_sms((Array:1))
#18 /REDACTED-PLUGINS-PATH/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#19 /REDACTED-PLUGINS-PATH/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:9))
#20 /REDACTED-PLUGINS-PATH/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("Job", "process_sms", (Array:1), NULL)
#21 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Core/JobManager.php(146): civicrm_api("Job", "process_sms", (Array:1))
#22 /REDACTED-PLUGINS-PATH/civicrm/civicrm/CRM/Core/JobManager.php(79): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#23 /REDACTED-PLUGINS-PATH/civicrm/civicrm/bin/cron.php(42): CRM_Core_JobManager->execute()
#24 {main}

```

PHP 7.1.22

CiviCRM 5.12.4

WordPress 5.1.1

# Answer
> 1 votes
Drop index **civicrm\_mailing\_event\_queue** (table **civicrm\_mailing\_event\_queue**) then re-create it.

After doing this, run the following check:

```
check table civicrm_mailing_event_queue

```

You should get a message that table status is 'OK'.

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


title: Is CiviPostcode dead?

text:
# Question
Title: Is CiviPostcode dead?
I've tried to sign up for CiviPostcode last week, and was expecting an email to verify my account after signing up. This didn't appear, so signed up again with a different address, but still no account email.

Is anyone aware if the service is still running, and if so, is there a manual account creation process involved?

Thanks!

# Answer
its not dead! We are in the process of migrating it to a new physical platform, which we're hoping to complete this week.
> 3 votes

---
Tags: extension
---


# Question
Title: Directory path problem on 4.7.30 upgrade
On upgrade to 4.7.30 (Joomla) the status message tells me of path problems. For example, that the directories are not writeable or do not exist. When I try to check/set the directories I get RuntimeException: "Cannot resolve path using "cms.root.path"" (full backtrace below), so I cannot access the form to reset directory paths.

Also, there is an error about missing extensions.

This has also seems to affect the Events Listing module in the Joomla front end which gives the message 'Warning Error loading module file (). Please restore the file or disable the module.'

Seems to be same or similar to the problem fixed in 4.7.6

Any advice please?

**RuntimeException: "Cannot resolve path using "cms.root.path""**

```
#0 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Resources.php(476): Civi\Core\Paths->getVariable("cms.root", "path") #1 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Smarty/plugins/function.crmResPath.php(55): CRM_Core_Resources->getPath("cms.root", NULL) #2 /var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%E8/E8B/E8BB6A67%%Path.hlp.php(11): smarty_function_crmResPath((Array:1), Object(CRM_Core_Smarty)) #3 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/Smarty/Smarty.class.php(1270): include("/var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%E8/E8B/E8...") #4 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Smarty.php(194): Smarty->fetch("CRM/Admin/Form/Setting/Path.hlp", NULL, NULL, FALSE) #5 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Smarty/plugins/function.help.php(64): CRM_Core_Smarty->fetch("CRM/Admin/Form/Setting/Path.hlp") #6 /var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%0F/0FF/0FF13161%%Path.tpl.php(9): smarty_function_help((Array:1), Object(CRM_Core_Smarty)) #7 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/Smarty/Smarty.class.php(1911): include("/var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%0F/0FF/0F...") #8 /var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%0C/0CB/0CBEC124%%default.tpl.php(19): Smarty->_smarty_include((Array:2)) #9 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/Smarty/Smarty.class.php(1911): include("/var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%0C/0CB/0C...") #10 /var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%EA/EAA/EAA96A89%%joomla.tpl.php(84): Smarty->_smarty_include((Array:2)) #11 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/Smarty/Smarty.class.php(1270): include("/var/www/clients/client3/web4/web/media/civicrm/templates_c/en_US/%%EA/EAA/EA...") #12 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Smarty.php(194): Smarty->fetch("CRM/common/joomla.tpl", NULL, NULL, FALSE) #13 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(133): CRM_Core_Smarty->fetch("CRM/common/joomla.tpl") #14 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(99): CRM_Core_QuickForm_Action_Display->renderForm(Object(CRM_Admin_Form_Setting_Path)) #15 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Admin_Form_Setting_Path), "display") #16 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_Path), "display") #17 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display") #18 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run() #19 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(283): CRM_Utils_Wrapper->run("CRM_Admin_Form_Setting_Path", "Directories", NULL) #20 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15)) #21 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4)) #22 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm.php(121): CRM_Core_Invoke::invoke((Array:4)) #23 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm.php(40): civicrm_invoke() #24 /var/www/clients/client3/web4/web/libraries/src/Component/ComponentHelper.php(382): require_once("/var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicr...") #25 /var/www/clients/client3/web4/web/libraries/src/Component/ComponentHelper.php(357): Joomla\CMS\Component\ComponentHelper::executeComponent("/var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicr...") #26 /var/www/clients/client3/web4/web/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm") #27 /var/www/clients/client3/web4/web/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication->dispatch() #28 /var/www/clients/client3/web4/web/libraries/src/Application/CMSApplication.php(303): Joomla\CMS\Application\AdministratorApplication->doExecute() #29 /var/www/clients/client3/web4/web/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute() #30 {main}
```
@import url(/administrator/components/com\_civicrm/civicrm/css/civicrm.css); @import url(/administrator/components/com\_civicrm/civicrm/css/crm-i.css); @import url(/administrator/components/com\_civicrm/civicrm/bower\_components/font-awesome/css/font-awesome.min.css); Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. Cannot resolve path using "cms.root.path"

Return to home page.

function toggle( element ) { var parent = element.parentNode; var className = parent.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { parent.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { parent.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } }

# Answer
> 0 votes
this is a known issue in the Joomla sites, I've seen it all the way up to civi 5.11.0 and i only change one path which is in Resource URL's - CiviCRM Resource URL

---
Tags: joomla, upgrade, 4.7
---


# Question
Title: How to change or add a header to the "Print PDF Report" action
I would like to add a header of my logo to "Print PDF Report" action when a search or report is generated. Is it something easily achievable? Thanks

# Answer
> 1 votes
If you go to the "Title and Format" tab on the report, you can edit the html for the Header and Footer. The default footer has an image in the footer. Its in the documentation at https://docs.civicrm.org/user/en/latest/reporting/set-up/

---
Tags: pdf, templates, header-footer
---


# Question
Title: How do I make the menubar a different color on my dev/staging sites
Wouldn't it be nice if I could visually distinguish my various dev/staging sites with a different menubar color for each one?

Is this possible in CiviCRM and if so what version?

# Answer
As of CiviCRM v5.12.1 the menubar color is a configurable setting.

On your main site you can change the color via the UI by visiting **Administer -\> Customize Data & Screens -\> Display Preferences**.

Since this preference is stored in a system setting, you can override it on your various dev/staging sites by adding a line like this to `civicrm.settings.php`:

```
$civicrm_setting['CiviCRM Preferences']['menubar_color'] = '#800000';

```
> 9 votes

---
Tags: developer, menu
---


# Question
Title: How can I generate a report for the financial transaction entered by USERS of certain "drupal Role"?
Finance department wants a weekly report of contributions taken by our shop. I have set up a drupal user role called "Shop" and permissions accordingly, and added staff to that role. But cant figure out how can I generate the report for the contribution specifically created by those staffs of “SHOP”. Any help would be appreciated. Thanks

# Answer
When someone adds a Contribution via the backend (eg Add Contribution) then an Activity is created (Type = Contribution) which will record who added that Contribution.

If you use that fact, and set up your 'users' in a Group either manually or smart group per Aidan's answer, then you might be able to build an Activity based report to show the contributions they added.
> 1 votes

# Answer
You could sync your Drupal role to a Civi group with the CiviGroup Roles Sync module then use the group in the report filter criteria.
> 2 votes

# Answer
If you have sql skills you may be better with an sql query of the log\_civicrm\_contribution table with left joins 'Group' so you can filter to the 'Shop' people, and just look for the 'insert' value in the log table. Then you may be able to join in the other values you are saying you need in
> 0 votes

---
Tags: civireport, roles
---


# Question
Title: CiviVolunteer error after upgrade to Civi 5.11.0 on joomla
Running civicrm 5.11.0 with CiviVolunteer on joomla 3.9.5 PHP 7.1 (as well a second site with the same problem on PHP 7.0) I am running API v4 version 4.3.0 CiviVolunteer 4.7.31-2.3.1

Since upgrading from civi 5.10.0 to 5.11.0 I receive the following error when running the Volunteer Report.

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

From the error\_log file: \[28-Apr-2019 22:08:34 America/New\_York\] PHP Warning: Declaration of CRM\_Volunteer\_Permission::check($permissions) should be compatible with CRM\_Core\_Permission::check($permissions, $contactId = NULL) in /home/\[my account\]/public\_html/media/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/Permission.php on line 151

# Answer
The warning you describe is fixed in the version of CiviVolunteer on github but they haven't tagged a release. The error sounds slightly different & turning on debugging might get more info.

However I logged an issue asking them to tag a release since there are unreleased civivolunteer fixes https://github.com/civicrm/org.civicrm.volunteer/issues/508

You can get the latest civivolunteer code from github in the meantime - https://github.com/civicrm/org.civicrm.volunteer/archive/master.zip and see if that helps
> 4 votes

---
Tags: joomla, civireport, civivolunteer
---


title: Split Data from Wordpress Database

text:
# Question
Title: Split Data from Wordpress Database
On my initial setup, I had installed CiviCRM onto the same database as the Wordpress installation. Now I want to split this as I am migrating the website and would rather backup and have a copy of the CiviCRM installation on its own. Does anyone have any advice on how this could be accomplished? Can I just backup the existing DB and restore to a new instance and it would all just work?

# Answer
> 6 votes
That's really two operations: splitting the combined db to separate WP and Civi ones, and migrating. For the migration part see the manual.

To split the db, you could make a duplicate of the original as the Civi db (dump and load), then in the Civi one delete all the non-civi tables and in the original/WP one, delete all the civi tables. In your `civicrm.settings.php` file find the setting for `CIVICRM_DSN` and change it to use the new database name.

Make sure you keep a backup of your original combined db just in case!

---
Tags: wordpress, upgrade, database, installation
---


# Question
Title: Can I set a daily Scheduled Job to run at a specific time of day?
I have a scheduled job, iATS Payments Recurring Contributions, set to run daily. Currently, the job fires off right after midnight every day. However, we need it to happen later -- say, around 3am.

Cron runs **drush civicrm-api job.execute** twice an hour, triggering any scheduled jobs that are due to run.

I know I can create a separate cron job at the desired time for this particular iATS scheduled job. However the iATS job may still get swept up by the catch-all **civicrm-api job.execute** and run at a different time, right?

# Answer
The solution is to exclude the iATS job from the "normal catch all" cronjob (so don't put it to run automatically daily)

Then add a line on your cron to run it at 3 am

```
0 3 * * * www-data nice -n19 /usr/bin/drush -u 1 -r $drupal_root civicrm-api job.whatever-iats-name auth=0 -y

```

You will need to find what is the name of the iats api job, and put it in the line

and voila, you should have it working now at 3 am
> 5 votes

# Answer
If you want to sue the CURL method, the curl looks like this

> https://example.com/sites/all/modules/civicrm/bin/cron.php?name=admin&pass=yourpass&key=site\_key&job=mail\_report&instanceId=38
> 0 votes

---
Tags: cron-job
---


# Question
Title: Event part payment & multiple registration
We run courses that has different modules. For example

* Module A
* Module B
* Module c

A participant can chose to attend Module A now and pay.

But couple of months down the line would want to sign up for Module B or C.

Issue I am facing is when registering online for 2nd time, its coming up with a message saying "Oops! You have already registered for this course". Is there a way to solve this problem using civievent please?

PS:We cannot use contribution due to policy within organisation not to mix course payments & donation.

# Answer
Tapash,

I believe CiviCRM allows one to register for same event with same email address multiple times, if the setting 'Same email address?' under 'Online Registration' is enabled for the event.

HTH

Pradeep
> 1 votes

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


# Question
Title: Individual Name Fields are not available when adding a new contact
I recently migrated my CiviCRM 4.4.10lts that was running on Joomla to a fresh 5.12.4 install on Drupal 7.66. The LAMP is an Ubuntu 18.04 stack on Azure.

I had to copy my data into the new database manually because of errors in the Cases component that prevented me from upgrading and my old host upgraded their MySql server to a version not supported by my version.

Now, none of the individual name fields are available when creating new individual contacts. If I add a new contact record using the New Individual block it creates a contact without a name. When viewing an existing contact record the names are there but if I attempt to edit them with either the inline editor or the normal contact edit function the names disappear.

There are no errors being thrown in either Drupal or CiviCRM and I have the same results with any theme I use.

I suspect I accidentally overwrote something in one of the tables while moving data but have no idea where to begin. Any help would be greatly appreciated

# Answer
> 2 votes
The Editing contact options are listed from option groups named 'Contact Edit Options'. Check if the options are present in the 'Contact Edit Options' option group. If not then adding options should fix the problem. Unfortunately the UI doesn't allow you at add a new option. But you can add it through api/explorer screen of CiviCRM.

Note: Option Name should be the field name same as column name in civicrm\_contact table eg first\_name, last\_name, middle\_name etc.

# Answer
> 0 votes
Check your profiles - the fields on the new individual form are profile driven - you can see what profiles should be on a new site on the demo site https://dmaster.demo.civicrm.org/civicrm/admin/uf/group?reset=1&selectedChild=reserved-profiles

---
Tags: contacts, fields, missing
---


# Question
Title: CiviEvent sends an invoice copy to every guest
For a paid event set up in Civi 5.10.3 to allow 'Register multiple participants?', every person registered gets a PDF copy of the invoice with their registration confirmation if an email address is supplied.

I can't think of any good reason for this, particularly as the default, as it usually leads to confusion.

Is there any way to suppress this behaviour?

# Answer
> 0 votes
You could have a slightly different profile for the 'lead' person to register vs subsequent participant registrations, in order to identify who should receive the invoice, and then use Civi Rules to send the email /PDF?

This is either instead of the usual receipt email, or as well but that doesn't include the invoice and serves only to confirm the booking for that individual.

---
Tags: civievent, invoice
---


# Question
Title: Accessing fields/data from a lookup field
Does anyone here know about CRM? Accessing lookup field data (composite address field) using JavaScript? Lookup field is on Contact form. Trying to access address of Account entity

# Answer
> 0 votes
I'm not sure I understood exactly what you try to access, but pretty much every entity in civicrm is accessible via an API, and you can easily use it from javascript.

https://docs.civicrm.org/dev/en/latest/api/interfaces/

you can use the api explorer and experiment, once you have succeeded fetching the data, you can copy paste the generated javascript code and add it in your own extension, or wherever you want to put your custom code.

---
Tags: custom-fields, javascript
---


title: How do I use CiviCRM with LDAP?

text:
# Question
Title: How do I use CiviCRM with LDAP?
I tried to get the CiviCRM LDAP integration working.

I used the LDAPcivi 'extension' (GitHub). And got it running quite quickly. But when I tried to connect with Thunderbird I ran into trouble. This is what the server showed me.

```
bind dc=[domain name of civicrm site], dc=[tld]:[password]
searching 100
[ 'title',
  'sn',
  'surname',
  'mozillahomelocalityname',
  'cn',
  'commonname',
  'givenname',
  'mozillahomestate',
  'mail',
  'mozillaworkurl',
  'workurl',
  'labeleduri',
  'o',
  'company',
  'mozillahomestreet2',
  'mozillanickname',
  'xmozillanickname',
  'mobile',
  'cellphone',
  'carphone',
  'modifytimestamp',
  'nsaimid',
  'nscpaimscreenname',
  'telephonenumber',
  'birthyear',
  'c',
  'countryname',
  'mozillahomestreet',
  'postalcode',
  'zip',
  'mozillacustom1',
  'custom1',
  'mozillahomecountryname',
  'st',
  'region',
  'mozillacustom2',
  'custom2',
  'mozillahomeurl',
  'homeurl',
  'mozillaworkstreet2',
  'mozillasecondemail',
  'xmozillasecondemail',
  'facsimiletelephonenumber',
  'fax',
  'description',
  'notes',
  'mozillacustom3',
  'custom3',
  'homephone',
  'mozillausehtmlmail',
  'xmozillausehtmlmail',
  'birthday',
  'street',
  'streetaddress',
  'postofficebox',
  'mozillacustom4',
  'custom4',
  'l',
  'locality',
  'pager',
  'pagerphone',
  'ou',
  'department',
  'departmentnumber',
  'orgunit',
  'birthmonth',
  'mozillahomepostalcode',
  'objectclass' ]
query DN = dc=[domain name of civicrm site], dc=[tld] sub / And
(&(|(cn=*ldap*)(givenname=*ldap*)(sn=*ldap*)(mozillanickname=*ldap*)(mail=*ldap*)(mozillasecondemail=*ldap*)(&(description=*ldap*))(o=*ldap*)(ou=*ldap*)(title=*ldap*)(mozillaworkurl=*ldap*)(mozillahomeurl=*ldap*)))-> searching And for ldap
searching ldap
civicrm_contact_search failed: couldn't parse {"is_error":0,"undefined_fields":["contact_is_deleted","cms","contact_type","sort_name"],"version":3,"count":1,"id":5,"values":[{"contact_id":"5","sort_name":"API, LDAP","display_name":"LDAP API","contact_type":"Individual","first_name":"LDAP","last_name":"API","job_title":"","organization_name":"","contact_is_deleted":"0","current_employer":"","address_id":"","street_address":"","supplemental_address_1":"","city":"","postal_code":"","state_province_id":"","country_id":"","phone_id":"","phone_type_id":"","phone":"","email_id":"","email":"","state_province_name":"","state_province":"","country":"","id":"5"}]}
civicrm_contact_search failed: unknown error

```

So. It actually manages to get a good search result. But somehow it isn't able to send it to Thunderbird. Maybe I'm missing out something obvious!

Hope someone else already got this LDAP thing running, and is able to help me out.

I also opened an issue on GitHub concerning this problem.

Maybe LDAPcivi is too old. I saw it was mentioned a bit more recently on this forum, so I hope that is still usable!

All the best,

# Answer
> 1 votes
For some reason, I didn't receive a notification on the ldap github repo, thanks to raise it here!

I answered on the issue in github, let's follow there?

I never tried civildap on wordpress, I don't know if it's why it has some issue. To exclude some potential sources of the problem, could you change your config file and put:

```
settings.civicrm.action = "get"

```

---
Tags: wordpress, contacts, database, ldap
---


# Question
Title: Best practice for finishing a CiviCRM session? Close browser window? log out? does it matter?
When finished working in CiviCRM, is there a practical difference in terms of the health of my database between simply closing my Civi browser window vs explicitly logging out? We run on drupal...

# Answer
> 1 votes
The server doesn't know that you closed your browser, so it considers that you are still looking at the last page; for a very long time.

The vast majority of users doesn't log out to explicitly inform the server they are out.Your drupal/webserver is going to discard stalled sessions when they stay inactive for too long, so it doesn't have an impact to logout or let the server "auto logout" after a while.

They are tiny differences if you close the browser while editing, as Civi might warn other users that you might still be editing to prevent conflicts (when two users edit the same content at the same time, you might overwrite each other modifications), so here, properly logout -or cancel your edit before closing- does help avoiding that other users wonder if you are still editing it or not.

There might be small security concerns to leave your session open, but assuming your civicrm installation is using httpS (and if not, you really should ssl encrypt your websites), it's not an issue either.

So in a nutshell: it's slightly better to logout, but as it means you will have to login more regularly, you might end up using less Civi -yeah, we are that lazy- I wouldn't advocate to logout, unless you aren't using your regular computer.

If you aren't the only one using the computer, you should always logout (so the next one using it won't be able to access Civi with your account).

X+

# Answer
> 1 votes
To add to the answer above you could consider deleting browsing history when the browser is closed.

This would effect all sites however many businesses use this method, really depends on your use case and how far you want to go.

---
Tags: drupal, database
---


# Question
Title: Reproduce CiviCRM configuration: best practice
I have customized CiviCRM (translation, custom fields, module, view, report, menus, etc.) and I want to reproduce the configuration. What is the best way to go?

# Answer
That's a good question that should have a canonical answer but doesn't.

Here's a recent similar question and answer: method for versioning configuration of civicrm?

I suspect there are other good references out there, please add them here.

Part of the challenge, which is not unique to CiviCRM, is that the definition of "configuration" can be grey in some areas.

Here is a list of tools and techniques that can capture and copy some parts of commonly considered "configuration":

## 1: The civicrm\_domain and civicrm\_setting tables.

You can back up these two tables and then restore them to a different site. This is a hack and could get you in trouble, but worth trying. Between the two of them, you've got most of the core "settings" type values.

## 2: Build your own extension to save your custom fields.

The instructions for building your own extension using civix show you how to generate an extension that saves the configuration of your custom fields.

## 3: civicrm\_report\_instance table

This can be backed up and restored on it's own, it's fairly safe.

## 4: civicrm\_extension table

This is the list of installed extensions with configuration. You'll need to also have the matching extension directory.

## 5.1: Extension: org.civicoop.configitems

This extension allows you to export some site configuration to JSON, which you can package as a related custom extension for your site. (See also Jaap's answer on this question.)

## 5.2: Extension: CiviConfigure (eu.tttp.setting)

There's an extension which appears to be designed to solve this problem for settings (may not handle eg Contribution Pages which are *entities*?), but it's out of date, here:

## 5.3: CiviCRM Config Export (nz.co.fuzion.configexport)

Imports/exports config & entities to YML.

## 6 `bin/csv/export.php`

A script you can use to export option values and tags and such. Assembly requied.

## 7: API

You can use the api to retrieve and set various entities, e.g. using the cv tool.

## 8: CiviCase specific

For CiviCase, one of the original arguments for using external files was for versioning and managing dev/production. You can still use xml files for its config.

...

I've left this as an open community wiki and encourage others to add to this list.
> 14 votes

# Answer
Usually I copy the site that is the best way to ensure all things are correct. But I can imagine that is sometimes cumbersome.

I have therefor used an extension org.civicoop.configitems (https://github.com/CiviCooP/org.civicoop.configitems)

An example configuration is stored in https://github.com/CiviCooP/nl.roparun.generic that configuration could be loaded with the config items extension.

This does not stores everything but at least it is a start.
> 4 votes

# Answer
@bass Can you just make a copy of the civicrm database to initialize your new instance? Unless your issue is to 'merge' this configuration into another existing instance, in which case all comment so far do apply.

@japp Congrats on a well rounded extension. What are the pros/cons of this extension vs the managed entities mechanism (https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_managed/)?
> 1 votes

---
Tags: configuration, deployment
---


# Question
Title: How can I include pay-later contributions in a widget thermometer?
I have a contribution page which is collecting live donations and pay-later contributions.

I'm using the contribution page widget to display a thermometer with the total raised by this contribution page.

The thermometer includes donations, but not pay-later contributions.

What can I do to include pay-later contributions in the thermometer, too?

# Answer
> 3 votes
This is actually easy, but totally hidden...

1. At the very end of the code for your widget, find the last `<script>` tag, which looks something like this:

```
<script type="text/javascript" src=""></script>

```

where  is a very long URL.
2. Modify this URL by adding `&includePending=1` to the end.
3. Paste your modified widget code over the old widget code wherever you are using the widget.
4. Observe that pending contributions now affect the thermometer total, even contributions which have already been made.

# Answer
> 1 votes
This is probably included in a later upgrade that I haven't done yet, but I had to add the following to `/sites/all/modules/civicrm/extern/widget.php` to get this @sean-colsen's answer to work:

```
$includePending = isset( $_GET['includePending'] ) ? true : false;
$data = CRM_Contribute_BAO_Widget::getContributionPageData($cpageId, $widgetId, $includePending);

```

---
Tags: contribution-page, paylater
---


title: How do I upgrade flexmailer?

text:
# Question
Title: How do I upgrade flexmailer?
I have flexmailer 0.2-alpha2 installed. Extension directory says 1.0-beta1 is available, but CiviCRM extension manager does not offer that as an update.

How to proceed?

# Answer
> 0 votes
Can you try by downloading the extension from here and replacing it with older one in extension directory and then visit the extension page on click on refresh.

---
Tags: upgrade, flexmailer
---


# Question
Title: Cannot update Smart Groups after upgrade to 5.6.1
After upgrading to 5.6.1, I've discovered that the option to edit the smart group search is missing.

Steps:

1. Contacts-\>Manage Groups
2. Click on Settings beside a group
3. At bottom of screen in 5.6.0 there were the options:

* Contacts in this group
    * Edit Smart Group Criteria

As shown below:

But in 5.6.1 the option isn't displayed:

Is this a bug introduced in 5.6.1?

# Answer
> 0 votes
In 5.6 I experienced problems with smart groups. When I upgraded to 5.6.1 they disappeared.

I'm looking at my Smart Group settings and all is well.

Try cleaning up your caches and deleting the contents of the templates\_c folder.

# Answer
> 0 votes
Make sure you have updated any of your overridden Civi files.

Check your logs files and see if anything obvious flags.

---
Tags: smartgroups
---


# Question
Title: Choosing Payment Method disables Continue/Contribute buttons
Running CiviCRM 5.12.4 and Joomla 3.9.5. I am having a continuing problem with the Payment Method on paid events and registrations. We use Paypal and Pay Later on both profiles/events.

Paypal is the default. Leaving that without changing the payment option, the Continue/Contribute button works as expected. If you make any change to the payment options, the Continue/Contribute button gets disabled.

For online registration I created two profiles, one for Paypal and another for Pay Later. Ok workaround. For the event I cannot do that as we have a maximum number of attendant spaces.

I think this might be Joomla related as I found mention using Drupal, but the workaround doesn't fix the problem.

This is our first paid event and fixing this is critical for us. Any help or suggestions would be greatly appreciated.

Thanks.

Edit: The following error was noted when switching from Paypal to Pay Later.

> TypeError: CRM.loadPage is not a function\[Learn More\] index.php:835:7
>
> ```
> buildPaymentBlock https://www.rbsportsboosters.com/index.php?option=com_civicrm&task=civicrm/event/register&Itemid=1129&id=33&reset=1:835
>
> <anonymous> https://www.rbsportsboosters.com/index.php?option=com_civicrm&task=civicrm/event/register&Itemid=1129&id=33&reset=1:839
>
> ```

```
jQuery 2

```

# Answer
> 0 votes
We are on Joomla 3.95 and CiviCRM 5.9.1. I do not understand why you would need two profiles for your event, as the 'Fee' tab allows both credit card processing and the pay later option. See:

https://docs.civicrm.org/user/en/latest/events/creating-an-event/

---
Tags: joomla, payment-method
---


# Question
Title: Upgrade from 5.11.0 to 5.12. failing database update - solution found
I'm failing because mysql doesn't like characters in a city name:

UPDATE civicrm\_state\_province INNER JOIN civicrm\_country ON civicrm\_state\_province.country\_id = civicrm\_country.id SET civicrm\_state\_province.name = 'dolnośląskie' WHERE iso\_code = 'PL' AND abbreviation = 'DS'

If fails with "ncorrect string value: '\xC5\x9Bl\xC4\x85s...' for column 'name' at row 3\]"

Running civicrm under Joomla 3.9.5.

Solution below.

# Answer
> 1 votes
It was my table and column collation settings. Both were latin1\_swedish\_ci. Evidently this collation does not support the weirdo characters those foreigners use ;^).

I rolled the database back using the backup I made (ALWAYS glad I make a backup before upgrading!!!). Then using phpMyAdmin I edited the table civicrm\_state\_province to have a collation of utf8\_general\_ci. I then re-upgraded the civicrm installation and all went well.

---
Tags: upgrade, database
---


# Question
Title: Spark Hosting Integration with Existing Wordpress Site
I have an existing Wordpress Site. I would like to know how do I integrate my Spark hoested site with my Wordpress site. The documen

# Answer
Check out this answer to a similar question and see if it answers your question: https://civicrm.stackexchange.com/a/27915/181
> 1 votes

---
Tags: cms-integration
---


# Question
Title: Version 5.11.0, Event custom fields not carried over to repeat events
We use version 5.11.0 and we're still having this issue. Is it possible to see if a solution has been introduced?

# Answer
> 2 votes
I think this is now fixed and should be part of 5.14. You can either wait for 5.14 release or apply patch from here.

Cheers

Pradeep

---
Tags: repeating-events
---


# Question
Title: How to have both credit card and Pay later option in webform
I'm using Webform instead of the core module for a contribution because of conditionals and I don't succeed in finding a way to have the "pay later" option. I only see Stripe payment processor. I tried the webform\_Payment module but this is actually not what I need. How do I do this?

I am using CiviCRM 5.12.3 on Drupal 7.66

Thanks! Guillaume

# Answer
In webform, on the civi tab set the Payment Processor field to 'user selects'.

Then in the Payment Processor component you should be able to set it to static and just offer the two options you need.
> 5 votes

---
Tags: webform-civicrm
---


title: CiviMail Deadlock Issue

text:
# Question
Title: CiviMail Deadlock Issue
I am facing deadlock on civicrm\_acl\_cache. I am sending email to 400,000 users. Many times, deadlock occur and due to system lock website goes down.

Need help from team

# Answer
Consider installing CiviCRM 5.13.1 and enabling multiple MySQL locks. See https://github.com/civicrm/civicrm-core/pull/13854 for details.
> 1 votes

---
Tags: civicrm.settings.php, deadlocks
---


title: Prospect Management & Tracking

text:
# Question
Title: Prospect Management & Tracking
Are there any extensions which allow for Prospect Management & Tracking? I came across a planned extension called "INTEGRATION WITH DONORSEARCH" but it doesn't look like it has been completed yet, though target date was February 15, 2017.

# Answer
You may want to check out CiviProspect. From the README:

CiviProspect provides the core structure for creating/ managing/ converting the fundraising opportunities of an organisation. It can also be used to manage any monetary opportunities such as sales opportunities and event sponsorships.
> 1 votes

# Answer
As I understand it Donor Search just helps you find better matches, but for managing and tracking that's what CiviCRM already does. You would just use contacts and activities, and if you want something slightly more structured there is CiviCampaign.

If what you're really asking about is tools to help you find prospects in the first place, then that's a slightly different question.
> 0 votes

# Answer
I worked on the DonorSearch extension. I spoke to my sponsor last week, who said it was done except for documentation. I would go ahead and install it - I believe DonorSearch allows a free account for CiviCRM users that gives 50 searches per month.

It looks like the 1.1 branch is the most current.
> 0 votes

---
Tags: extension
---


# Question
Title: Is there a best practice or recipe for migrating a two database CiviCRM installation into one database?
I am replicating a Drupal 7 CiviCRM installation into a Pantheon CiviCRM Kickstart site. I have gone through the tedious effort of moving the Drupal content and settings from a default Drupal profile into the CiviCRM Kickstart profile and I have a happy, empty installation of CiviCRM living beside my Drupal site but now I need to move my CiviCRM data into the consolidated database.

I have tried unsuccessfully to export the database with SET FOREIGN\_KEY\_CHECKS=0; and without the cache and domain tables but on my import I am receiving a "Cannot add foreign key constraint" error.

Has anyone come up with a cookbook for making this migration?

Thanks.

# Answer
I managed to resolve this dilemma.

The goal was to move a 2 database Drupal/CiviCRM website into the CiviCRM Starterkit platform which requires that Drupal and CiviCRM use a single database. I was not able to import my database dump into the existing Drupal website because although I had set foreign\_key check to zero, I was receiving a "Cannot add foreign key constraint" error.

My solution was as follows:

1. Download a dump of the CiviCRM database with ignore foreign keys, drop tables, triggers etc.
2. The dump does not include tables for: civicrm\_acl\_cache, civicrm\_acl\_contact\_cache, civicrm\_cache, civicrm\_domain, civicrm\_group\_contact\_cache
3. Remove the drop tables statements before importing. Leave in: IF NOT EXISTS create table.
4. It was important to Truncate tables before each table's data insert statement.
5. When I ran the import shell command the import would stop because the Log Tables didn't exit. They are in the Dump but they were not being created so I ran all of the IF NOT EXISTS create table commands before running the import command.

Once I had accomplished the above 5 items, I was able to run the import and populate the tables. All is well.

I hope this helps anyone else who runs into this challenge.
> 1 votes

# Answer
'Cannot add foreign key constraint' means that the data referencing a column is missing. You can either make sure that you delete orphan data or set null before exporting them or you can `SET FOREIGN_KEY_CHECKS=0;` before importing and then `SET FOREIGN_KEY_CHECKS=1;` once imported.

Cheers

Pradeep
> 0 votes

---
Tags: drupal, database, migration, data-import
---


# Question
Title: iCal feed doesn't work: lots of public events, but "None found"
As I write, our iCal feed page loads "None found" instead of the numerous current and future public events that are in active status on our **Civi 5.13 (WordPress 5.1.1, PHP 7.2.13)** site.

I don't see any WordPress Permissions settings that could hide our public events, especially not while I'm logged in as Admin.

I've disabled all WP plugins (except CiviCRM) and there was no change.

For what it may be worth, the Calendar (com.agiliway.civicalendar) extension works fine. But none of the feed buttons on the Events Dashboard deliver any current or future public events.

Also (thanks Aidan!), **these buttons probably never worked on our site.** If you're curious, the history of (and reason for now ditching) the workaround is detailed below in the Comments.

ALSO ... this from the Civi Log Viewer, and it coincides with loading the Events Dashboard in the Civi Admin. There are no log entries corresponding with loading the HTML listing of current and future public events.

> \[warning\] Deprecated function CRM\_Event\_BAO\_Event::checkPermission, use CRM\_Event\_BAO\_Event::getAllPermissions. Array ( \[civi.tag\] =\> deprecated )

Nothing from the WordPress PHP error log. Where should I look next?

# Answer
> 3 votes
First I'd confirm that the functionality works on another site. You can use a demo site for this, or you can check Google for `inurl:civicrm/event/ical`

OK, so it works for some people! Next check might be to find out if the WordPress path works (`inurl:civicrm/?page=CiviCRM&q=civicrm%2Fevent%2Fical` perhaps? IDK if Google / other search engines support checking for pages with specific query params though, as CiviCRM uses here.)

The next place I'd look would be what generates the iCal feed. Is it coming from an extension or core CiviCRM? Your question didn't say this for sure, so a search for "civicrm/event/ical" on the Git repo will reveal a menu XML entry if it's a core thing. (If not we'd go looking for the relevant extension.)

By searching the civicrm/civicrm-core repo I found that this is core functionality, because the path you're trying to understand has a menu.xml entry which shows up in the results.

Looking at that we can see:

* the permission checked for will be "view event info"
* the page callback class is `CRM_Event_Page_ICalendar`

So you could perhaps add some debug code to that class (start at the `run()` method), and see if this method gets called when a visitor hits your iCal feed.

There's also an open issue on CiviCRM's Gitlab, dev/wordpress#25. That's worth subscribing to, even though the description is different to yours ... the fact that both affected sites are WordPress may be significant.

Where you'd go from there depends on what you find so far, but your question was "where do I look next", so here you go! Good luck :)

---
Tags: civievent, html, calendar
---


# Question
Title: How do I embed a CiviCRM page into a wordpress page?
I'm new to this and trying to get my head around the integration with wordpress. I'm having problems using CiviCRM to integrate with wordpress. I set up a civicontributions page with membership dues etc but when i try to follow the documentation to embed the contribution page into my wordpress page. The documentation asks me to "Click on the CiviCRM icon next to Upload / Insert" but no such icon is available for me, nor do I see an Upload/Insert button.

I've installed WordPress 5.1.1 and CiviCRM 5.13.1 i've disabled all plugins except for CiviCRM and tried different themes.

Any help would be very much appreciated. Thank you very much best regards, David

# Answer
> 4 votes
Are you using the new block editor... in this case you don't see the civicrm button. Easiest solution is to switch to the classic editor. I think the documentation needs updating. Once you know what the shortcodes look like you could just type them in (you would need to know the contribution id)

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


# Question
Title: Can't create new mailing. Gets stuck on "Initializing..."
I am using civiCRM on Wordpress. I have configured my SMTP settings correctly as far as I'm aware. The test email sent fine. But when I got to 'Mailings' \> 'New Mailing' it says 'initializing...' and stops there. Any ideas on how I can create a new mailing?

When I look at 'Draft and Unscheduled Mailings' I see a bunch of unscheduled mailings that haven't worked.

N.B: I commented out this block after following the advice of this thread: http://forum.civicrm.org/index.php/topic,24242.0.html

I am using Bluehost hosting and mail services. CiviCRM 4.6.2

I have tried everything in this post: http://forum.civicrm.org/index.php/topic,35850

Here's the error I get in the console:

```
TypeError: CRM.addStrings is not a function        angular.js?r=NBb6p:11655
    at all.js?r=NBb6p:44
    at Object.forEach (angular.js?r=NBb6p:331)
    at httpSuccess (all.js?r=NBb6p:39)
    at angular.js?r=NBb6p:9408
    at processQueue (angular.js?r=NBb6p:13248)
    at angular.js?r=NBb6p:13264
    at Scope.$get.Scope.$eval (angular.js?r=NBb6p:14466)
    at Scope.$get.Scope.$digest (angular.js?r=NBb6p:14282)
    at Scope.$get.Scope.$apply (angular.js?r=NBb6p:14571)
    at done (angular.js?r=NBb6p:9698)

```

Thanks for your help

# Answer
Sounds like a basic javascript problem. Wordpress plugins are sometimes to blame. See troubleshooting javascript in CiviCRM.
> 3 votes

# Answer
I have the same error after upgrading from 4.6.0 to 4.6.2 (problem still exists after an upgrade to 4.6.3). It's an error with paths on IIS loading resources.

FYI this is a duplicate of AngularJS issues with Drupal 7 + CiviCRM

The issue tracker shows that this will be fixed in version 4.6.4: https://issues.civicrm.org/jira/browse/CRM-16499

There's a pull request here, with an interim patch: https://github.com/civicrm/civicrm-core/pull/5863

Confirming this fixed my 4.6.3 install
> 2 votes

# Answer
This error might relate to HTTPS config of the site.

* I have CiviCRM sites in Aegir, HTTPS managed also in Aegir, and mailing works.
* Other sites but same CiviCRM version, are beyond Cloudflare and HTTPS are managed by Cloudflare and Pound, but not Aegir. In this case, I have the same issue with mailing: initialising never ends, but all the other part of CiviCRM is OK. Workaround here to run on plain HTTP, which is hardly acceptable.

CiviCRM version is 5.12.
> 0 votes

---
Tags: civimail, wordpress, email
---


# Question
Title: Can't change help_post text in Price Set using the civicrm_buildAmount hook
There are several fields I expect to be able to change in the buildAmount hook that just won't change for me. One example:

```
function myext_civicrm_buildAmount($pageType, &$form, &$amount) {

      $feeBlock =& $amount;

      foreach ( $feeBlock as &$fee ) {

          if ( !is_array( $fee['options'] ) ) {
            continue;
          }

      // My debug-to-file function prints the original value as expected
      // fdebug($fee['help_post']);

      $fee['help_post'] = 'New help text';

      // My debug-to-file function prints the new value as expected
      // fdebug($fee['help_post']);

      // But the value in the price set, when rendered, does not change

      }
}

```

The help\_post text remains as originally set in the price set. Why?

# Answer
> 0 votes
Just as a thought i think you may need to set $amount = $feeBlock right at the end as your modifying $amount

# Answer
> 0 votes
I would probably do:

```
foreach ($feeBlock as $feeBlockId => $fee) {
   .....
   $feeBlock[$feeBlockId]['help_post'] = "blahblah"
}

```

---
Tags: hooks, price-sets
---


# Question
Title: A problem I have with getting a box on my home page for visitors to sign up for a mailing list?
I am running CiviCRM under WordPress on a local host

I have set up a Group named "Mailing List" with "Join Our Mailing List" as the description.

Under Group Type "Mailing List" is checked - and I've tested with "Access Control" both checked and unchecked. Visibility is set to "Public Pages". Reserved Group? is unchecked. Is Active? is checked.

I can enter contacts in the back end on Word Press and they appear as contact in CiviCRM, but there is no box on the front end --something that will appear to a user who is not logged in -- in which a user can enter himself as a contact. What must I do to get a box in "Public Pages" where a visitor can enter his name and email address and have this information become part of the CiviCRM mailing list group?

# Answer
As peterdnz says, the documentation is at https://docs.civicrm.org/user/en/latest/email/set-up/ (Using a Profile). For WordPress I think the easiest way to display a form publicly is by using a shortcode. After preparing a WordPress Page, click the CiviCRM button above the editor. For Page Type select Profile. On the next drop-down that appears, select the name of the profile that you have created. Select Edit on the radio button option just below the drop-downs, so that you give users access to edit data in your database (i.e. to add their email address and name to your database). Click Insert Form and the shortcode will be added to the editor. Hope this helps
> 1 votes

---
Tags: contacts
---


# Question
Title: Auto-filing e-mails on Cases: Mail content not shown under details and attachment with extension .unknown created
I am trying to set up a workflow with CiviCase to automatically file clients' responses on their respective cases.

According to the documentation, mails arriving in the e-mail-to-activity-Mailbox, containing the pattern \[case #123\] in their subject line, get automatically filed under the respective case (123 in this case) as an activity ('Incoming E-mail').

This is all working fine so far regarding the overall process. However, the contents of the incoming mail is not visible in the 'details' section of the activity. An attachment with the mail gets created, but with the extension '.unknown'. I can download this attachment, manually select a program to view it (e.g. a text editor) and (only) the body of the mail gets displayed as plain text, the header info seems to be stripped off. This behavior happens for html mails as well as plain text mails.

What I originally expected was something like a plain text representation of the mail under details, the same way as it is handled with outgoing mails. And the attachment should ideally contain the unaltered and entire mail, including the header information (date/time, recipients) and have a filename extension which could be recognized by a mail client after download (e.g. .eml).

My main question for now: Is this the intended behavior (then I can arrange to live with it, since I am quite happy with the overall process) or am I missing some configuration settings somewhere?

(Using CiviCRM 5.13.1 and Wordpress 5.1.1)

# Answer
> 2 votes
Regarding the ".unknown", you can update the list of extensions it recognizes at Administer - System Settings - Safe File Extensions.

Regarding the rest that isn't how it used to work. Not sure if something's changed recently or maybe there is something unusual about those emails. You say it's both html and plain - are all the emails coming from the same source or different types of sources, e.g. MS Exchange, gmail, etc.

UPDATE: https://lab.civicrm.org/dev/core/issues/940

---
Tags: email, civicase, activities
---


# Question
Title: I cannot find Participant Count and Max Participants in Edit Price option for price sets WordPress
In Drupal, I have the option in a price set, price option to limit the number of people who can book at a certain price.

I do not see this option in a wordpress install (civi version 5.13)

Do I need to turn this option on somewhere?

# Answer
> 3 votes
My mistake.. I had configured the price set as a contribution, not an event fee.

---
Tags: wordpress, price-sets
---


# Question
Title: How do HTTPS settings interfere with CiviMail?
I have CiviCRM sites (5.12 and 5.13 on Drupal 7 with Aegir 3) where the behaviour of CiviMail initialisation (and the admin status page) depends on particular HTTPS setup: finishes or loops infinitely.

How HTTPS setup influences this behaviour? How to configure HTTPS on Cloudflare to avoid interference with CiviMail?

* When HTTPS managed by Aegir, the mailing initialisation works.
* When HTTPS are managed by Cloudflare and Pound, but not Aegir, mailing initialising never ends. Workaround here to run on plain HTTP, which is hardly acceptable.

The status page for CRM administrators also behave differently, it point to some Angular issues.

(update) Error in console:

```
Blocked loading mixed active content “http://example.com/sites/example.com/files/civicrm/persist/contribute/dyn/angular-modules.87ce61fa6dc174d5e3e11f666ca386e5.json”[Learn More] a:1:778
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ jquery.min.js:4:26272
Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead jquery.min.js:2:21
WARNING: Tried to load angular more than once. jquery.min.js:320:189

```

**Solved**: this D7 patch has solved the issue. More info here.

# Answer
It sounds like you have "http://" hard-coded into your URLs. Check your `BASE_URL` in `civicrm.settings.php` (and search the whole file for "http://" while you're there), and check the **Administer » System Settings » Resource URLs** menu to ensure that your resource URL doesn't include "http://".

Finally, check if you have any extensions that have the text `hook_civicrm_getAssetUrl`, which suggests that they may be changing the Asset URL.
> 1 votes

---
Tags: drupal, civimail, angular, aegir
---


# Question
Title: Can't access custom fields used in event registration
Versions:

* Drupal 7.63
* CiviCRM 5.9.1

## Custom Fields:

* Created custom fields with Field Type of Autocomplete-Select with lookup for following fields:

+ Institution
    + Area of Study
    + Year of Graduation
* Used for: Participants (Role): Attendee

> Attendee is a type of participant for an event type, alongside other types

+ Custom Data Set is active
    + Custom Data Set is public

Custom fields are to be used by CiviEvent attendees to self select as part of event registration, this information is saved against their contact entry.

## Drupal Permissions

* "CiviCRM: access all custom data" is active for Anonymous User role

## Problem

When typing in a valid value for the custom field, such as "Accounting" for "Area of Study" the following error of "Loading Failed" is displayed for an unauthenticated user.

This lookup works fine with the following Drupal Role Permission assigned:

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

I've been unable to find more information about the security implications of this setting, and the wording of this setting concerns me when thinking to giving it to Anonymous Users.

I'm trying to get the balance of functionality without leaving the system too open, but I'm unsure why I need to expose access to the backend and API to get this working.

When the following Drupal permission is modified: (thanks @petednz)

* "CiviCRM: access AJAX API" is active

+ The error message in a cell such as "Area of Study" upon searching an area such as "Accounting" is "None Found" (error has light great background instead of red background per image above)
* "CiviCRM: access AJAX API" is inactive

+ The error message in a cell such as "Area of Study" upon searching an area such as "Accounting" is "Loading Failed" (error has red background per screenshot above)

# Answer
> 1 votes
I'm working on this with @zoog and can confirm that the autocomplete only works when 'CiviCRM Backend and API' permission is granted to anonymous. However changing it to an ordinary select works without this permission. Seems independent of 'access AJAX API' which remains granted. What do you think @petednz-fuzion - have you got autocomplete work for anonymous?

---
Tags: civievent, custom-fields, permissions
---


title: Limit relationships

text:
# Question
Title: Limit relationships
Is it possible to limit the number of relationships a contact might have?

For example, an organisation might have a "Secretary" relationship with an individual.

There can only be one of those.

So I don't want extra secretary relationships added to the organisationby accident.

Thanks as always.

# Answer
As Pete has said, you can't do that with core Civi. An alternative approach would be to create a 'Secretary' custom field on the Organisation as a Contact Reference. That will ensure you can only have one.
> 2 votes

---
Tags: relationships
---


# Question
Title: Event registration email comes from number@servername address
I'm adding an event registraion internally

Find contact record\> Go to event tab\> register for event

In the confirmation email if I leave the sender as my logged in user details the recipient sees the email address in the number@servername format rather thane firstname.lastname@sitename format

If I send the confirmation from one of the site "from" email addresses training@sitename the recipient sees the address as expected.

If I use the send email action to the same contact using logged in username- from email displays as expected.

D7.66 C5.10.4

Seems to be a similar issue as discussed here Registration confirmation email uses wrong From email address

Anyone seen anything similar?

# Answer
> 1 votes
There was a problem with that: https://lab.civicrm.org/dev/core/issues/713 which was fixed by https://lab.civicrm.org/dev/core/issues/644 which is marked as fixed in 5.11 Upgrading should fix your issue.

---
Tags: civievent, confirmation
---


title: Add custom fields to cases

text:
# Question
Title: Add custom fields to cases
Have managed to add custom fields to contacts, and have tried to do the same for cases. The option seems to be there, but they do not show up on the page for creating a new case.

I can add custom fields to activities within cases, but I would like them for the overall case itself.

Is there any extension to achieve this/ is there some setting I am missing? Thanks.

# Answer
> 2 votes
You need to have selected a case type before the custom fields will appear.

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


# Question
Title: How to remove "Report URL" from emailed PDF reports header?
I would like to remove the link from a report email header. Is it easy to achieve? thanks

# Answer
It seems to be hardcoded (https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Form.php#L3405), but you could use hook\_civicrm\_alterMailParams and do something like (untested - you might have to adjust the regex):

`if ($params['groupName'] == 'Report Email Sender') {
 $params['html'] = preg_replace('/^Report URL.*$/', '', $params['html']);
}`

Another option which is maybe simpler is just completely replace the html in the hook, if you don't really need the other text either:

`if ($params['groupName'] == 'Report Email Sender') {
 $params['html'] = 'Insert your own html';
}`
> 2 votes

---
Tags: email, civireport, reports
---


# Question
Title: Case Type field not available to add to a profile
I would like to make a profile that I can use to change case types and update statuses. The Case Status field is available to add to a profile but Case Type is not. This is true in my instance (Spark) and in the demo at https://dmaster.demo.civicrm.org/.

Is this just something I have to live with or is there a way to make Case Type available for profiles?

# Answer
> 0 votes
Case Type isn't really a field it's a whole set of configuration items. I don't think you can do batch case type updates in core. There might be an extension (e.g. https://civicrm.org/extensions/webform-civicrm-integration) but I don't remember seeing if it had something for this.

---
Tags: profile, civicase
---


# Question
Title: Can nomination be part of the workflow for CiviCase?
Historically, I've used CiviCRM for events and member management. I've never used CiviCase, but I think this situation probably calls for CiviCase. Any insight will be helpful.

In short, the client has asked for a form which allows a contact to nominate another individual to received funds from the organization relief fund. I want to record both the contact submitting the form and the eventual recipient and then the actions that client performs within their own workflow. I don't have that yet, because I was just handed a paper form to add to the system.

Am I in the right ballpark, to use CiviCase instead of just posting a profile form to go to the association? Will CiviCase allow me to track the submitter and the recipient more easily? Any insight is much appreciated.

# Answer
> 2 votes
I'm not sure you need CiviCase but it sounds like it could fit. You might also want to take a look at CiviGrant. For the form you might want to also look at https://civicrm.org/extensions/webform-civicrm-integration, especially if you're using cases since then it can generate a case from the form.

If not using cases, regular activities have both a submitter and "with contact" field to track submitter and recipient, or if you want to keep those fields for other purposes they can have custom contact reference fields.

The answer might also depend on what kind of reporting you need. For example cases might make it easier to count groups of related activities as one, e.g. if the same person gets nominated for funds again the next year.

---
Tags: contacts, civicase
---


# Question
Title: ContributionDashboard correct amount not equal CiviReport
Stripe.com shows we received a donation of $15. It correctly shows on the Civi Contribution Dashboard. When we run Civi Report, the amount shows up as $30. We have many cases when the report and the dashboard give the correct results. This is the first time when the amounts do not agree. Anybody know what is wrong?

# Answer
I found that the donor had two home phone numbers in her contact info. Removing the second home phone, resulted in the amount not being doubled.
> 1 votes

---
Tags: civicontribute
---