Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-07-07T05:03:19Zhttps://lab.civicrm.org/dev/core/-/issues/2456Explore use of JWTs for authentication2023-07-07T05:03:19ZcolemanwExplore use of JWTs for authentication(*Migrated from a totten comment on another thread about simulating permissions in afform and searchkit*)
## JSON Web Tokens: Microsoft example
(*This example demonstrates the data-flow. Many symbols/URLs are edited to improve readabil...(*Migrated from a totten comment on another thread about simulating permissions in afform and searchkit*)
## JSON Web Tokens: Microsoft example
(*This example demonstrates the data-flow. Many symbols/URLs are edited to improve readability/intuition.*)
A "JSON Web Token" (JWT) is a building-block for an access-control system. (Analogy: JSON serves a purpose like XML... but JSON is easier to encode/decode/remix/improvise. Similarly, JWT serves a purpose like ASN.1/X.509... but JWT is easier to encode/decode/remix/improvise.)
Microsoft uses JWT for their web-service APIs - and also for email APIs, like MS Exchange Online. When Civi talks to MS Exchange Online, it uses JWTs. In this process, a user "Alice" (`alice@example.com`) starts out in Civi web UI. We redirect her to `https://login.microsoftonline.com`, where she clicks a button to say "Yes, trust CiviCRM", and (long-story-short) MS sends us an access token.
This access token looks like a long, random password (`aSdF12.34QwErTy.DvORak`), and we can use it to make REST calls. For example, we might request a copy of Alice's user profile:
```
GET https://api.microsoft.com/about-me HTTP/1.1
Authorization: Bearer aSdF12.34QwErTy.DvORak
```
```
HTTP/1.1 200 OK
Content-type: application/json
{"email": "alice@example.com", "first_name": "Alice", "last_name": "Alison", ...}
```
Again, it looks like a password, so one can plug it into many different systems. We can use it to connect to IMAP or SMTP servers.
But it's not really a password. It is encoded JSON. If you clean it up, then it looks like this:
```js
{
"issuer": "login.microsoftonline.com",
"user": "alice@example.com",
"scopes": ["imap", "smtp", "profile"],
"expires": "2021-04-08 12:16:20"
}
```
This says that `login.microsoftonline.com` (the master security service at Microsoft) is vouching for us. We're approved to access a few services (`"scopes":["imap", "smtp", "profile"]`) on behalf of a particular person (`"user": "alice@example.com"`). When we connect to `api.microsoft.com` or IMAP or SMTP, the server parses the JWT, validates the signature cryptographically, and then gives us access.
The fields (`user`, `scopes`, etc) determine access control. If we try to access any other API -- editing Alice's address book, deleting Word docs, generating maps, etc -- then it will reject us. That's because our `"scopes"` do not include `address_book`, `manage_docs`, or `mapping`.
The token format doesn't *have* to be based on JSON or JWT. Civi's email hashes are a fine example of a token that doesn't use JSON. However, JSON is flexible and easy to parse. If you're designing a protocol, you have a lot of latitude to pick and choose which fields to include. Additionally, because it's standard, it's easier to inspect/debug. (Got a failed request? Decode the JWT and see if anything looks wrong.)
## JSON Web Tokens: Why
Why would someone like Microsoft adopt an access-token pattern like JWT?
Because they are actually running many distributed apps - and, when you get to a certain scale (#apps/#devs/#users), it gets hard to think straight (or run performantly) if they are linked-up one-by-one using a shared session.
Ordinarily, one would expect the demands on a self-hosted PHP app to be gentle enough to address with a straight-forward session/global variable (`$session->get('userID')`; `global $user`). There's a lot of mileage there. However, with the complexity of supporting multiple CMSs with different routing/session/identity mechanisms -- and with the goal of doing targeted permission escalations/changes/bypasses -- I'm not so sure. Civi is not positioned to be as simple as a singular PHP app - maybe it's more like a distributed app (where access+identity messages are coordinated among many different components - Drupal, Joomla, WordPress, Civi QF, Civi APIs, etc)
## Browser (JS) apps and alternative permissions
OK, so how would you use JWT to accomplish alternate permissions in a Civi/JS/Angular/API app?
Recall that the page-load goes a bit like this:
```
GET https://example.org/civicrm/search HTTP/1.1
Cookie: SESS=abcd1234
GET https://example.org/civicrm/ajax/api4/SavedSearch/get?name=foobar HTTP/1.1
Cookie: SESS=abcd1234
GET https://example.org/civicrm/ajax/api4/Contact/get?complexCriteria=... HTTP/1.1
Cookie: SESS=abcd1234
```
In each request, the permissions are determined by the cookie. But you don't want those permissions. So... don't use the cookie. Use something with different permissions - like a JWT.
```
GET https://example.org/civicrm/search HTTP/1.1
Cookie: SESS=abcd1234
GET https://example.org/civicrm/ajax/api4/SavedSearch/get?name=foobar HTTP/1.1
Authorization: Bearer aSdF12.34QwErTy.DvORak
GET https://example.org/civicrm/ajax/api4/Contact/get?complexCriteria=... HTTP/1.1
Authorization: Bearer aSdF12.34QwErTy.DvORak
```
During the initial page-view, you have to construct and output the token. This is where you decide what kind of actions will be permitted. Maybe it looks like:
```php
$token = Civi::service('crypto.jwt')->encode([
'exp' => time() + 3600,
'scopes' => ['api4/SavedSearch/get', 'api4/Contact/get'],
]);
Civi::resources()->addSetting('apiAuthToken', $token);
```
or maybe:
```php
$token = Civi::service('crypto.jwt')->encode([
'exp' => time() + 1800,
'scopes' => ['SavedSearch:foobar'],
]);
Civi::resources()->addSetting('apiAuthToken', $token);
```
or:
```php
$token = Civi::service('crypto.jwt')->encode([
'exp' => time() + 3600,
'contactId' => 1234,
'savedSearch' => 'foobar',
'perms' => ['access AJAX API']
Civi::resources()->addSetting('apiAuthToken', $token);
```
This is a very generic/flexible way to think about changing permissions while supporting AJAX apps.https://lab.civicrm.org/dev/core/-/issues/2457Notice: A non well formed numeric value encountered when choosing "other amou...2023-07-09T19:01:32ZDaveDNotice: A non well formed numeric value encountered when choosing "other amount" on contribution page using non-US settings`Notice: A non well formed numeric value encountered in CRM_Price_BAO_LineItem::format() (line 317 of .../web/sites/all/modules/civicrm/CRM/Price/BAO/LineItem.php).`
Haven't looked further yet. Set the settings to non-US money formats a...`Notice: A non well formed numeric value encountered in CRM_Price_BAO_LineItem::format() (line 317 of .../web/sites/all/modules/civicrm/CRM/Price/BAO/LineItem.php).`
Haven't looked further yet. Set the settings to non-US money formats and then visit a contribution page and choose other amount and fill it in, e.g. `12,34`, then on the next page you get the notice. Everything still works though.https://lab.civicrm.org/dev/core/-/issues/2458Feature Request: API endpoint to trigger rebuild paths2021-03-14T14:07:46ZhescoFeature Request: API endpoint to trigger rebuild pathsOverview
----------------------------------------
As a devops engineer responsible for automating the installation, upgrade, and migration of CiviCRM, I want an API endpoint which I can invoke with the cv utility to run the rebuild path...Overview
----------------------------------------
As a devops engineer responsible for automating the installation, upgrade, and migration of CiviCRM, I want an API endpoint which I can invoke with the cv utility to run the rebuild paths script, accessible through the gui on the drupal platform at: /civicrm/admin/setting/updateConfigBackend?reset=1
Current behaviour
----------------------------------------
Currently, performing this operation requires that
I visit a webpage on the running installation, at:
/civicrm/admin/setting/updateConfigBackend?reset=1 leanup Caches, then a >_Reset Paths button.
Proposed behaviour
----------------------------------------
I can already use `cv flush` to accomplish the first task.
I next need a new option to `cv` which will invoke this process,
and to have that process documented at `cv -h`.homotechsualhomotechsualhttps://lab.civicrm.org/dev/core/-/issues/2459Changing a custom field from multiple choice to Text breaks the API2021-03-16T14:41:38ZJonGoldChanging a custom field from multiple choice to Text breaks the APIOverview
----------------------------------------
Changing a custom field from a multiple choice (Radio, Checkboxes, etc.) to a free-entry text box works, until you try to write to the custom field via the API.
Reproduction steps
------...Overview
----------------------------------------
Changing a custom field from a multiple choice (Radio, Checkboxes, etc.) to a free-entry text box works, until you try to write to the custom field via the API.
Reproduction steps
----------------------------------------
1. On a demo site, go to **Administer » Customize Data and Screens » Custom Fields**.
1. In *Constituent Information*, edit the *Most Important Issue* field to have a *Field Input Type* of **Single-line input field (text or numeric)** and save.
1. Attempt to use APIv3 `Contact.create` to write a value to the field that wasn't in the original set of multiple-choice values.
Current behaviour
----------------------------------------
API Error - your value isn't an accepted value for this field.
Expected behaviour
----------------------------------------
A custom field with a data type of "String" and HTML type of "Text" should take any alphanumeric value.
Comments
----------------------------------------
Changing the HTML type doesn't remove the Option Group ID. While arguably the API code should ignore that, it seems more important that the data be correct.5.37.0JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/2460Ordering of theme CSS files2023-07-30T05:03:20Zaydunsaidan.saunders@squiffle.ukOrdering of theme CSS filesOverview
----------------------------------------
Change the ordering of CSS files so that theme files can easily override core files.
Current behaviour
----------------------------------------
A theme can declare itself through a `myex...Overview
----------------------------------------
Change the ordering of CSS files so that theme files can easily override core files.
Current behaviour
----------------------------------------
A theme can declare itself through a `myextension.theme.php` file which is handled by the civix boilerplate using `hook_civicrm_themes()`. If the theme is active it causes the theme's CSS files to be loaded in place of the default Greenwich theme.
Other CSS files like `contactSummary.css` are loaded after the theme's CSS file making it difficult to override.
Proposed behaviour
----------------------------------------
Change the order so that theme CSS files are loaded after other core CSS so that theme files can do their job more easily.
Example
-------
`contactSummary.css` has:
```
#crm-container div.crm-summary-display_name {
font-size: 19px;
padding-bottom: 10px;
}
```
`civicrm.css` (from Finsbury Park) has:
```
#crm-container div.crm-summary-display_name {
font-size: 1.4rem;
margin: 30px 0 20px;
line-height: 1.4rem;
}
```
The current ordering results in the theme's font-size being overridden by core.
Comments
----------------------------------------
Can someone point me to where the theme's CSS gets added to the page?https://lab.civicrm.org/dev/core/-/issues/2461Boolean custom values can't be of type boolean2021-03-16T02:13:04ZJonGoldBoolean custom values can't be of type booleanOverview
----------------------------------------
The CustomValue APIv4 fails if you pass in a boolean with a value of `TRUE` or `FALSE`.
Reproduction steps
----------------------------------------
* Create a multi-record custom field s...Overview
----------------------------------------
The CustomValue APIv4 fails if you pass in a boolean with a value of `TRUE` or `FALSE`.
Reproduction steps
----------------------------------------
* Create a multi-record custom field set.
* Create a boolean custom field.
* Try writing to that custom field with a value of `TRUE` or `FALSE`. Note that this isn't possible with API Explorer, because that will pass the *string* `"TRUE"` or `"FALSE"`.
Current behaviour
----------------------------------------
```
Error
value: is not of the right field data type: Boolean
```
Expected behaviour
----------------------------------------
Value saves correctly.
Comments
----------------------------------------
This happens because `CRM_Utils_Type::escape()` does a `preg_replace` on Boolean fields, assuming they're strings. And on APIv3, that would be correct. On APIv4 we can pass an actual Boolean, which fails because it can't be parsed as a string.
I'm not sure if this belongs more appropriately in `CRM_Utils_Type::escape()` or `CRM_Utils_Rule::boolean()`. I'll let more knowledgeable folks bikeshed that.5.37.0JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/2462Membership end date cannot be edited as "empty" (for lifetime Membership Types)2023-10-23T05:03:23Zsluc23Membership end date cannot be edited as "empty" (for lifetime Membership Types)Overview
----------------------------------------
When manually editing and overriding a Membership with "Active" status, the end date cannot be set as **empty** for lifetime membership types. It keeps the old end_date value
Reproductio...Overview
----------------------------------------
When manually editing and overriding a Membership with "Active" status, the end date cannot be set as **empty** for lifetime membership types. It keeps the old end_date value
Reproduction steps
----------------------------------------
1. Edit a *Cancelled* membership
2. Set **Status Override**: *Override Permanently* / **Status**: *Current*
3. Set **Membership Expiration Date**: *- empty -* (it's a*lifetime* Membership Type)
4. Save
5. The **Membership Expiration Date** remains the old value, it's not set as *empty*
![civicrm_membershipenddate](/uploads/d3477600cfbf6ac54a0232d1c79e2f97/civicrm_membershipenddate.gif)
*It can be reproduced as well as editing a Membership already overridden with Current status, just trying to clean end_date*
Current behaviour
----------------------------------------
The **Membership Expiration Date** remains the old value, it's not set as *empty*
Expected behaviour
----------------------------------------
The **Membership Expiration Date** must be empty
Environment information
----------------------------------------
Tested in Drupal 7.78 / CiviCRM 5.35.0
Comments
----------------------------------------https://lab.civicrm.org/dev/core/-/issues/2463Feature to file emails on multiple case ids provided in the url not working2021-03-29T18:18:17ZDaveDFeature to file emails on multiple case ids provided in the url not workingI don't use this feature, and the ability to use multiple case ids appears to have originally been added for CiviHR, but this came up while looking into something else.
After https://lab.civicrm.org/dev/core/-/issues/1750, what happens ...I don't use this feature, and the ability to use multiple case ids appears to have originally been added for CiviHR, but this came up while looking into something else.
After https://lab.civicrm.org/dev/core/-/issues/1750, what happens now is multiple activities are created if there were multiple recipients. The code at https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/Form/Task/EmailTrait.php#L453-L457 loops thru all the case ids in the url and files the activity on them. However, after #1750, the activity id being used here is only the last activity created, because it's the one from [here](https://github.com/civicrm/civicrm-core/blob/9a518a43e3296153eae8a1bb22bcdc350aebea9a/CRM/Activity/BAO/Activity.php#L1180) which is now within the loop, but it's not returned until [after the loop](https://github.com/civicrm/civicrm-core/blob/9a518a43e3296153eae8a1bb22bcdc350aebea9a/CRM/Activity/BAO/Activity.php#L1206). So that would be the first problem, and is technically a regression in 5.36.
However, for a single case id it's not necessary anyway to do the filing loop in EmailTrait.php since it was already filed on the case by the api call at https://github.com/civicrm/civicrm-core/blob/9a518a43e3296153eae8a1bb22bcdc350aebea9a/CRM/Activity/BAO/Activity.php#L984.
However*2, if you have multiple case ids the problem is it doesn't even get to the first problem because that api call fails because `CiviCRM_API3_Exception: "case_id is not a valid integer"`. That might have broke at https://github.com/civicrm/civicrm-core/commit/f7f1cc3b179536bcf2b3e8d1c49a481c155fc933 but I haven't confirmed and possibly hasn't been working for a long time.
@jamienovick1 Does CiviHR still use this feature to set multiple case ids in the url for email activities?5.37.0https://lab.civicrm.org/dev/core/-/issues/2464Fix Drupal Base 'isFrontEndPage' Returns Wrong Value After Saving A Settings...2021-03-29T20:13:19Ztunbola@compucorp.co.ukFix Drupal Base 'isFrontEndPage' Returns Wrong Value After Saving A Settings PageOverview
----------------------------------------
This [PR](https://github.com/civicrm/civicrm-core/pull/18397) fixed the way civicrm tells a civicrm page from a non civicrm page.
However when a settings page such as Civicase settings (...Overview
----------------------------------------
This [PR](https://github.com/civicrm/civicrm-core/pull/18397) fixed the way civicrm tells a civicrm page from a non civicrm page.
However when a settings page such as Civicase settings (civicrm/admin/setting/case), Mailing settings (civicrm/admin/mail) and most of the setting pages are saved, the `CRM_Utils_System_DrupalBase::isFrontEndPage` function reports that the `civicrm/admin` page redirected to after a setting is saved is a frontend page which could have a significant impact on functions that rely on this. For example, the shoreditch theme [relies on this function](https://github.com/civicrm/org.civicrm.shoreditch/blob/master/shoreditch.php#L188) to know whether the shoreditch JS and CSS assets need to be included for a particular page. This wrong value makes the shoreditch theme not to be applied after saving the settings page and the page is not shoreditch themed and loses the styling. Refreshing the page a second time however fixes the issue but this glitch needs to be fixed.
Reproduction steps
----------------------------------------
1. On a site with the shoreditch theme active, edit a settings page and click save. The user is directed to the Civicrm admin page with shoreditch styles not applied at all. Refreshing the page a second time however brings back the expected styling.
Current behaviour
----------------------------------------
![Administer_CiviCRM___c8008_2021-03-17_14-14-56](/uploads/200d1e52f00a157e825b71a85a4d9053/Administer_CiviCRM___c8008_2021-03-17_14-14-56.png)
Expected behaviour
----------------------------------------
![Administer_CiviCRM___c8008_2021-03-17_14-15-12](/uploads/7b62014d903561e081bb0281871c60c8/Administer_CiviCRM___c8008_2021-03-17_14-15-12.png)
Technical Details
----------------------------------------
In the Post Process function for the Admin Setting form class which is the base class for most settings page, this [line](https://github.com/civicrm/civicrm-core/blob/master/CRM/Admin/Form/Setting.php#L115) clears the db cache including the `civicrm_menu` table. When the form is redirected to a new page after saving, the civicrm initialization calls the `civicrm_html_head` function which calls this line in the function `https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/DrupalBase.php#L662`, because the menu table has been cleared, the `$item` variable is empty and the given path is returned as a frontend page, as a result, necessary shoreditch styles are not added.
Solution will be to add call the form's menu rebuild function [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Admin/Form/Setting.php#L120) to rebuild the menu table after it is cleared, same as is done for few of the forms e.g [the URL setting form](https://github.com/civicrm/civicrm-core/blob/master/CRM/Admin/Form/Setting/Url.php#L85) which is why the few forms that implement this does not have this issue.
Will put up a PR to fix this. Just documenting this here.5.37.0https://lab.civicrm.org/dev/core/-/issues/2465On pages where a button triggers a download, submitOnce prevents the Done or ...2023-07-10T05:03:24ZDaveDOn pages where a button triggers a download, submitOnce prevents the Done or other buttons from workingSome examples:
1. ~~Thank-you letters for contributions.~~ I was thinking of [this comment](https://lab.civicrm.org/dev/core/-/issues/2372#note_53791) but I think that got skipped being added because of this problem, i.e. the problem pre...Some examples:
1. ~~Thank-you letters for contributions.~~ I was thinking of [this comment](https://lab.civicrm.org/dev/core/-/issues/2372#note_53791) but I think that got skipped being added because of this problem, i.e. the problem prevents adding submitOnce there.
2. In CDN Tax Receipts after you download.
3. Financial batch exports (although here the submitOnce is drupal 9's submitonce, not civi's, but it's the same thing).
4. Contact exports (again drupal 9's, not civi's).
What happens after you download is that any other buttons on the page are frozen, and while you can just go to another page, it obviously isn't working as intended, and for some people they really want a Done button.
Here's two ideas:
1. Make these Done/Cancel buttons into `<a>` links instead. They aren't the type of button where double-clicking causes a problem, so don't need the submitOnce protection.\
In a few cases this might not trigger the complete quickform cycle, but does it matter if the purpose of the button is to just leave the page?
2. Provide a way in CRM_Core_Form::addButton to opt-out for specific buttons, but since the submitonce protection is a `<form>` property this seems like it would be adding in some awkward code, and it's new code that is hard to write tests for, and would also need something special for drupal 8/9.https://lab.civicrm.org/dev/core/-/issues/2466Can't export link custom fields2021-03-22T11:56:31ZtschuettlerCan't export link custom fieldsOverview
----------------------------------------
It is currently not possible to export custom fields of type link with length above around 110 chars. The added HTML markup pushes the length of the string above 256 chars in the export c...Overview
----------------------------------------
It is currently not possible to export custom fields of type link with length above around 110 chars. The added HTML markup pushes the length of the string above 256 chars in the export column for this field.
I'm not aware, that this is a recent regression.
Reproduction steps
----------------------------------------
1. Create a custom field `url` of type **Link**.
1. Add a reasonably long `url` to a contact (e.g. `https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg`).
1. Export this Contact outputting the custom field `url`
1. Got an error "**Fatal error: DB error**".
Current behaviour
----------------------------------------
Export fails if it contains long links.
```
Mar 18 17:47:44 [error] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => exceptionHandler
)
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] =>
INSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `custom_23`)
VALUES (1,'<a href=\"https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg\" target=\"_blank\">https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg</a>')
[nativecode=1406 ** Data too long for column 'custom_23' at row 1]
[type] => DB_Error
[user_info] =>
INSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `custom_23`)
VALUES (1,'<a href=\"https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg\" target=\"_blank\">https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg</a>')
[nativecode=1406 ** Data too long for column 'custom_23' at row 1]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="
INSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `custom_23`)
VALUES (1,'<a href=\"https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg\" target=\"_blank\">https://stage.example.org/system/files/webform/way_too_long_url_that_still_fits_in_a_link_custom_field_but_fails_to_export.jpg</a>')
[nativecode=1406 ** Data too long for column 'custom_23' at row 1]"]
)
Mar 18 17:47:44 [debug] $backTrace = #0 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#3 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#4 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...", "DB_Error", TRUE)
#5 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, "\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...", "1406 ** Data too long for column 'custom_23' at row 1")
#7 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
#8 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#9 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query("\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#10 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#11 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(454): DB_DataObject->query("\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#12 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(1565): CRM_Core_DAO->query("\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...", TRUE)
#13 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Export/BAO/Export.php(365): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_tmp_d_export_4cf7fb7cd8210f2fe06326f57a33263f (`id`, `c...")
#14 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Export/BAO/Export.php(199): CRM_Export_BAO_Export::writeDetailsToTable(Object(CRM_Export_BAO_ExportProcessor), (Array:1), (Array:1))
#15 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Export/Form/Map.php(142): CRM_Export_BAO_Export::exportComponents(TRUE, (Array:1), (Array:7), "`sort_name` asc", (Array:1), NULL, 1, " contact_a.id IN ( 202 ) ", "civicrm_contact", 0, 0, (Array:6), "AND")
#16 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Form.php(526): CRM_Export_Form_Map->postProcess()
#17 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#18 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Contact_Export_Form_Map), "next", "Next")
#19 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Export_Form_Map), "next")
#20 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Export_Form_Map), "next")
#21 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Controller.php(347): HTML_QuickForm_Page->handle("next")
#22 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Invoke.php(313): CRM_Core_Controller->run((Array:4), (Array:0))
#23 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:13))
#24 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#25 /opt/buildkit/build/dmaster/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:4))
#26 /opt/buildkit/build/dmaster/includes/menu.inc(527): civicrm_invoke("contact", "search", "advanced")
#27 /opt/buildkit/build/dmaster/index.php(21): menu_execute_active_handler()
#28 {main}
```
Expected behaviour
----------------------------------------
Successfull export of long links.
I can think of two options:
1. Keep exporting the URL with HTML markup: Enlarge the field for links in the temporary table for exports.
1. **Breaking change** Just export the URL without markup
* I currently can't think of a reason to have HTML markup in the CSV.
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
Does not seem to be related:
* __Browser:__ _Firefox 86.0.1_
* __CiviCRM:__ _Master_
* __PHP:__ _7.4_
* __CMS:__ _Drupal 7.78_
* __Database:__ _MySQL 8.0.23_
* __Web Server:__ _Apache 2.4_
Comments
----------------------------------------
Problem seems to be identical to the one solved in dev/core#1787.5.37.0tschuettlertschuettlerhttps://lab.civicrm.org/dev/core/-/issues/2467[Meta] XLTS Angular JS longer-term-support2022-12-20T18:24:57Zhomotechsual[Meta] XLTS Angular JS longer-term-support@JoeMurray raised in chat that [AngularJS goes EoL in December](https://chat.civicrm.org/civicrm/pl/cm6jqmcex3n39ekf3zzx4tiree) there is a company [XLTS](https://xlts.dev/angularjs) providing extended LTS support through 2026. I've send ...@JoeMurray raised in chat that [AngularJS goes EoL in December](https://chat.civicrm.org/civicrm/pl/cm6jqmcex3n39ekf3zzx4tiree) there is a company [XLTS](https://xlts.dev/angularjs) providing extended LTS support through 2026. I've send them an enquiry asking how much they are likely to look to charge given the open-source nature of CiviCRM to see if, perhaps, they'd be willing to "donate" the XLTS to us.
We lose nothing by asking!JoeMurrayJoeMurrayhttps://lab.civicrm.org/dev/core/-/issues/2468Deprecated function Redis::delete()2021-03-19T15:54:36ZwouterhDeprecated function Redis::delete()Overview
----------------------------------------
We receive a notification on flushing CiviCRM cache
```
Deprecated function: Function Redis::delete() is deprecated in CRM_Utils_Cache_Redis->delete() (line 148 of /var/www/html/vendor/c...Overview
----------------------------------------
We receive a notification on flushing CiviCRM cache
```
Deprecated function: Function Redis::delete() is deprecated in CRM_Utils_Cache_Redis->delete() (line 148 of /var/www/html/vendor/civicrm/civicrm-core/CRM/Utils/Cache/Redis.php).
```
Reproduction steps
----------------------------------------
1. Setup environment like below
1. Flush CiviCRM cache
Environment information
----------------------------------------
* __CiviCRM:__ 5.35.1
* __PHP:__ 7.4.15
* __CMS:__ Drupal 8
* __Redis__ 5.3.3
Comments
----------------------------------------
_I'll provide a patch._5.37.0https://lab.civicrm.org/dev/drupal/-/issues/158Page not found after installing extension in Drupal 8 and Drupal 92021-03-26T09:27:08ZjaapjansmaPage not found after installing extension in Drupal 8 and Drupal 9After you install a new extension (for example data processor) in a Drupal 8 or Drupal 9 environment the pages of this extension could not be found.
A work around is to clear the Drupal caches afterwards.
**Related PR**: https://github...After you install a new extension (for example data processor) in a Drupal 8 or Drupal 9 environment the pages of this extension could not be found.
A work around is to clear the Drupal caches afterwards.
**Related PR**: https://github.com/civicrm/civicrm-core/pull/19888https://lab.civicrm.org/dev/core/-/issues/2469Export of custom multiple choice options to CSV files limited to 32 characters2023-07-18T16:44:17ZbkeevilExport of custom multiple choice options to CSV files limited to 32 charactersA user is trying to export data from an advanced query on custom fields to a CSV file using the "Export contacts" action. This fails with a backtrace which is attached below. The error message is:
```
#6 /var/www/libertarian/vendor/pear...A user is trying to export data from an advanced query on custom fields to a CSV file using the "Export contacts" action. This fails with a backtrace which is attached below. The error message is:
```
#6 /var/www/libertarian/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, "\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...", "1406 ** Data too long for column 'custom_49' at row 13")
```
The `custom_49` field referred to in the error is a select list with a set of multiple choice options, some of which are up to 55 characters long.
The bug is that the temporary table that is being constructed to service the export to CSV is constructing the column as VARCHAR(32) while the text value of the multiple choice options in civicrm_option_value is a VARCHAR(512)
### Details
If I select the schema of the table `civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7` it reports the table structure as:
```
CREATE TABLE `civicrm_tmp_d_export_c3a74c8fb66b720f55e2661dab58716b` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`last_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`first_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`nick_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`street_address` varchar(96) COLLATE utf8_unicode_ci DEFAULT NULL,
`city` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(254) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`sort_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_61` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_50` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_51` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_68` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_58` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_49` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_street_address` (`street_address`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
```
Indeed it is trying to insert the text value of an option into a temporary table and several of those text options are over 32 characters in length.
```
SELECT label,CHAR_LENGTH(label) as length FROM civicrm.civicrm_option_value WHERE (option_group_id=103) AND (CHAR_LENGTH(label) > 32)
```
returns
```
| label | length |
|---------------------------------------------------------|--------|
| 003 - Aurora–Oak Ridges–Richmond Hill | 37 |
| 005 - Barrie–Springwater–Oro-Medonte | 36 |
| 035 - Haliburton–Kawartha Lakes–Brock | 37 |
| 039 - Hamilton West–Ancaster–Dundas | 35 |
| 040 - Hastings–Lennox and Addington | 35 |
| 052 - Leeds–Grenville–Thousand Islands and Rideau Lakes | 55 |
| 061 - Mississauga East–Cooksville | 33 |
| 073 - Northumberland–Peterborough South | 39 |
| 102 - Stormont–Dundas–South Glengarry | 37 |
```
The full backtrace may be relevant:
```
backTrace
#0 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
#1 /var/www/libertarian/vendor/pear/pear-core-minimal/src/PEAR.php(944): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/libertarian/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#3 /var/www/libertarian/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#4 /var/www/libertarian/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...", "DB_Error", TRUE)
#5 /var/www/libertarian/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 /var/www/libertarian/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, "\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...", "1406 ** Data too long for column 'custom_49' at row 13")
#7 /var/www/libertarian/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
#8 /var/www/libertarian/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#9 /var/www/libertarian/vendor/civicrm/civicrm-packages/DB/DataObject.php(2696): DB_common->query("\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#10 /var/www/libertarian/vendor/civicrm/civicrm-packages/DB/DataObject.php(1829): DB_DataObject->_query("\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#11 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(457): DB_DataObject->query("\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#12 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(1563): CRM_Core_DAO->query("\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...", TRUE)
#13 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Export/BAO/Export.php(365): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_tmp_d_export_1d387c75256673080ad64346b3c095c7 (`id`, `l...")
#14 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Export/BAO/Export.php(199): CRM_Export_BAO_Export::writeDetailsToTable(Object(CRM_Export_BAO_ExportProcessor), (Array:100), (Array:14))
#15 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Export/Form/Map.php(142): CRM_Export_BAO_Export::exportComponents(TRUE, (Array:118), (Array:8), "`sort_name` asc", (Array:14), NULL, 1, " contact_a.id IN ( 1546,1415,641,27,1688,1504,1701,42,650,626,56,1509,1537,15...", "civicrm_contact", 0, 0, (Array:11), "AND")
#16 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Form.php(513): CRM_Export_Form_Map->postProcess()
#17 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#18 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Contact_Export_Form_Map), "next", "Next")
#19 /var/www/libertarian/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Export_Form_Map), "next")
#20 /var/www/libertarian/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Export_Form_Map), "next")
#21 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(347): HTML_QuickForm_Page->handle("next")
#22 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:4), (Array:0))
#23 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13))
#24 /var/www/libertarian/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#25 /var/www/libertarian/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke((Array:4))
#26 /var/www/libertarian/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke((Array:4))
#27 [internal function](): Drupal\civicrm\Controller\CivicrmController->main((Array:4), "")
#28 /var/www/libertarian/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array((Array:2), (Array:2))
#29 /var/www/libertarian/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#30 /var/www/libertarian/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#31 /var/www/libertarian/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext((Array:2), (Array:2))
#32 /var/www/libertarian/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#33 /var/www/libertarian/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#34 /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#35 /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#36 /var/www/libertarian/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#37 /var/www/libertarian/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#38 /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#39 /var/www/libertarian/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#40 /var/www/libertarian/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#41 /var/www/libertarian/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)
#42 /var/www/libertarian/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#43 {main}
```https://lab.civicrm.org/dev/drupal/-/issues/159Deprecated notice for pcpStatus (Personal Campaign Pages)2024-03-13T19:06:44ZPradeep Nayakpradpnayak@gmail.comDeprecated notice for pcpStatus (Personal Campaign Pages)```
CRM_Contribute_PseudoConstant::pcpStatus, use Function pcpStatus will
be removed.
Array
(
[civi.tag] => deprecated
)
CRM_Contribute_PseudoConstant::pcpStatus, use Function pcpStatus will
be removed.
Array
(
[civi.tag] => dep...```
CRM_Contribute_PseudoConstant::pcpStatus, use Function pcpStatus will
be removed.
Array
(
[civi.tag] => deprecated
)
CRM_Contribute_PseudoConstant::pcpStatus, use Function pcpStatus will
be removed.
Array
(
[civi.tag] => deprecated
)
```
We get this notice logged [from Views CiviCRM integration code](https://github.com/civicrm/civicrm-drupal/blob/7.x-master/modules/views/components/civicrm.contribute.inc#L1228).https://lab.civicrm.org/dev/core/-/issues/2470Add system check for CIVICRM_CRED_KEYS2023-07-09T05:03:25ZAndie HuntAdd system check for CIVICRM_CRED_KEYSThe crypto changes in 5.34 are helpful, and I like the direction for how new installs work. However, in a year or so, we're going to start assuming `CIVICRM_CRED_KEYS` is set since all of the buildkit sites have it, all the new sites ha...The crypto changes in 5.34 are helpful, and I like the direction for how new installs work. However, in a year or so, we're going to start assuming `CIVICRM_CRED_KEYS` is set since all of the buildkit sites have it, all the new sites have it, and many of us will have gone back through sites to set it. However, there will be a good chunk of sites lacking it, and most of them will have no idea. If we start encrypting more values in the database, we could find a lot of edge cases or needlessly unhandled sites because of this.
I am really thankful for all of the communication in dev/core#2258, [PR 19239](https://github.com/civicrm/civicrm-core/pull/19239), the [docs](https://docs.civicrm.org/sysadmin/en/latest/setup/secret-keys/), and [CIVI-PSA-2021-01](https://civicrm.org/advisory/civi-psa-2021-01-storage-crypto-api). However, despite all that, I don't think it's apparent to the typical site admin that they could/should make a simple edit to their settings file in order to support encryption of SMTP passwords and other values. Each of the communications has (rightly) focused on more urgent or relevant situations as the feature rolled out.
The good news is that this should be a simple thing to check for on a site: is `CIVICRM_CRED_KEYS` set. I propose that this be a system check and that a `NOTICE`-level message be generated if it's missing. The message could even suggest a line to include.
- *Why `NOTICE`?* Lacking `CIVICRM_CRED_KEYS` isn't a big problem right now, but it does mean that your site has diverged from how a standard, newly-installed site is configured. That means it shouldn't be `WARNING` or higher, but it's not a mere `INFO`-level item: if we thought it was good to lack `CIVICRM_CRED_KEYS`, we wouldn't bother setting it on install.
- *Don't people get annoyed by system checks?* Yes, but that's because many have historically been too alarmist or confusing. This is at least as significant as being on PHP 7.2, [which generates a `NOTICE`](https://github.com/civicrm/civicrm-core/blob/e149971400579d26e7c2c163f1d1573aaf23b898/CRM/Utils/Check/Component/Env.php#L42).https://lab.civicrm.org/dev/drupal/-/issues/160No dashboard displaying after installing and configuring CiviCRM with Backdrop2021-05-03T14:54:29ZcedeweyNo dashboard displaying after installing and configuring CiviCRM with BackdropI just installed CiviCRM on my Backdrop CMS site and walked through the configuration checklist.
When I click on the CiviCRM admin menu link I am taken to an essentially blank page. It seems like I must be missing a configuration or per...I just installed CiviCRM on my Backdrop CMS site and walked through the configuration checklist.
When I click on the CiviCRM admin menu link I am taken to an essentially blank page. It seems like I must be missing a configuration or permission setting, but I can't find what that might be. I am logged in as user 1 (administrator).
Also, when I hover over the CiviCRM menu item, no subpages appear in a dropdown as I have seen on other CiviCRM sites.
![civicrm-no-dashboard-no-menu](/uploads/ee163fe2b83d699e94b2185e85da0e5c/civicrm-no-dashboard-no-menu.png)https://lab.civicrm.org/dev/core/-/issues/2471Email Greeting Update Job performance issue2023-07-23T05:03:22ZmclarkeEmail Greeting Update Job performance issueOverview
----------------------------------------
Recently tried to update all the email_greeting's on a large number of contacts. I ran into significantly long queries (10+ secs), that locked `civicrm_contact` table for updates! This ca...Overview
----------------------------------------
Recently tried to update all the email_greeting's on a large number of contacts. I ran into significantly long queries (10+ secs), that locked `civicrm_contact` table for updates! This caused very slow operation on production site and in a some cases timeouts.
Example use-case
----------------------------------------
1. Cleared all the `email_greeting_display` to NULL
1. Swapped in a new Default Email Greeting ID
1. Ran the `update_greeting` job with `ct=Individual gt=email_greeting force=0 limit=1000`
Current behaviour
----------------------------------------
Very poor performance on job run:
1. Very slow
1. Locks table for updates.
Proposed behaviour
----------------------------------------
Make it fast!
Tracked down the code to here: https://lab.civicrm.org/dev/core/-/blob/master/CRM/Contact/BAO/Contact/Utils.php#L1010
Ran an EXPLAIN on this SQL query and it is a table scan. Mystery explained.
I applied a tweak to the query that appears to fix the issue (at least for my paramters). Indeed I stole the idea from lower down in that very function.
adding `WHERE id IN (" . implode(',', $allContactIds) . ")` (after the huge CASE statement) to the main update query appears to remove the table scan and prevent the table locking.
Not sure this is a decent general solution, but just wanted to offer it!
Thanks!!
Comments
----------------------------------------https://lab.civicrm.org/dev/core/-/issues/2472DB error on Contribution Details2023-07-11T05:03:29ZyashodhaDB error on Contribution DetailsSteps to replicate :
- Go to _Contribution Details_
- In sorting tab, set _Contribution Status_ asc/dsc and in filter _Contribution OR Soft Credit?_ to _Both_
![Screenshot_from_2021-03-23_10_26_02](/uploads/2f0ba79c0657555c06f73db79acf8...Steps to replicate :
- Go to _Contribution Details_
- In sorting tab, set _Contribution Status_ asc/dsc and in filter _Contribution OR Soft Credit?_ to _Both_
![Screenshot_from_2021-03-23_10_26_02](/uploads/2f0ba79c0657555c06f73db79acf8397/Screenshot_from_2021-03-23_10_26_02.png)
![Screenshot_from_2021-03-23_10_26_17](/uploads/09810cb980275a522883f17fe43297f2/Screenshot_from_2021-03-23_10_26_17.png)
- Run the report, and DB error appears!
![error](/uploads/3ab78a1a830f1076bd8aca48c21f76e4/error.png)