Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-07-27T01:34:01Zhttps://lab.civicrm.org/dev/core/-/issues/2753Erroneous change detection for system workflow message templates2023-07-27T01:34:01ZfkohrtErroneous change detection for system workflow message templatesAfter updating CiviCRM from `5.37.2` to `5.40.1` and running `cv upgrade:db` afterwards, I receive the following pre-upgrade message:
> The default copies of the message templates listed below will be updated to
> handle new features or...After updating CiviCRM from `5.37.2` to `5.40.1` and running `cv upgrade:db` afterwards, I receive the following pre-upgrade message:
> The default copies of the message templates listed below will be updated to
> handle new features or correct a problem. Your installation has customized
> versions of these message templates, and you will need to apply the updates
> manually after running this upgrade. Click here [1] for detailed
> instructions.
>
> * _Petition - need verification_ - Fix Petition Confirmation email having
> a blank space at the end of url
> * _Personal Campaign Pages - Admin Notification_ - Fix Pledge and PCP urls
> to go to the front end site rather than backend site
> * _Pledges - Payment Reminder_ - Fix Pledge and PCP urls to go to the
> front end site rather than backend site
>
>
>
> Links:
> ------
> [1] https://docs.civicrm.org/user/en/latest/email/message-templates/#modifying-system-workflow-message-templates
But following the guide "[Updating system workflow message templates](https://docs.civicrm.org/sysadmin/en/latest/upgrade/#updating-system-workflow-message-templates)", I cannot identify any templates that were actually changed (and I cannot recall changing them either):
![Message_Templates](/uploads/6f69d43b8d0d80c6826845cec718e817/Message_Templates.png)
Furthermore, I cannot find any `*.msg_template` files for CiviCRM 5.x as suggested by the documentation:
```sh
$ find . -name '*\.msg_template*'
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.6.9.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.5.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.5.0.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.5.alpha1.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.6.3.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.6.alpha4.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.alpha1.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.19.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.14.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.23.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.4.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.11.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.beta8.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.6.alpha1.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.6.10.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.7.beta1.msg_template
./vendor/civicrm/civicrm-core/CRM/Upgrade/4.5.beta2.msg_template
```
It feels like there is something wrong with the "detection" of changes made to the default templates.5.65.0https://lab.civicrm.org/dev/core/-/issues/2752Financial entity permissions2023-11-08T05:03:19ZeileenFinancial entity permissionsI hit an issue where a contact without 'Administer CiviCRM' but WITH 'view all contributions' cannot access a payment search display - [as described](https://civicrm.org/blog/eileen/searching-payments-civi)
I think the VIEW permissions ...I hit an issue where a contact without 'Administer CiviCRM' but WITH 'view all contributions' cannot access a payment search display - [as described](https://civicrm.org/blog/eileen/searching-payments-civi)
I think the VIEW permissions on all financial entities should be 'view all contributions' because otherwise we will keep hitting issues where part but not all of a contribution can be retrieved
@JoeMurray @monish.deb @seamusleehttps://lab.civicrm.org/dev/core/-/issues/2751[regression] Search forms with entities that include File custom fields don't...2021-08-11T00:07:08ZJonGold[regression] Search forms with entities that include File custom fields don't render in Afform Admin screen### Steps to replicate.
* Create a searchkit search for any entity. Create a display. Save.
* Add the display to an afform in the Form Builder admin. Save.
* Create a new custom field of type "File" on the entity.
* Go back to Form Bui...### Steps to replicate.
* Create a searchkit search for any entity. Create a display. Save.
* Add the display to an afform in the Form Builder admin. Save.
* Create a new custom field of type "File" on the entity.
* Go back to Form Builder admin and try to edit the afform.
### Expected Result
Works the same with or without the File custom field.
### Actual result
Doesn't render, the error/backtrace below show up in the logs.
It's because there's no `label_field` defined in the File schema XML - but it's not even clear to me what would be a good label field. We don't even store the filename by itself.
```
Error: Class name must be a valid object or a string in Civi\Api4\Utils\CoreUtil::getInfoItem() (line 63 of /var/www/example.org/vendor/civicrm/civicrm-core/Civi/Api4/Utils/CoreUtil.php)
#0 /var/www/example.org/vendor/civicrm/civicrm-core/ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php(114): Civi\Api4\Utils\CoreUtil::getInfoItem('File', 'label_field')
#1 /var/www/example.org/vendor/civicrm/civicrm-core/ext/afform/admin/Civi/Api4/Action/Afform/LoadAdminData.php(205): Civi\AfformAdmin\AfformAdminMeta::getFields('Contribution', Array)
#2 /var/www/example.org/vendor/civicrm/civicrm-core/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Action\Afform\LoadAdminData->_run(Object(Civi\Api4\Generic\Result))
#3 /var/www/example.org/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(149): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\Afform\LoadAdminData))
#4 /var/www/example.org/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php(232): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\Afform\LoadAdminData))
#5 /var/www/example.org/vendor/civicrm/civicrm-core/api/api.php(85): Civi\Api4\Generic\AbstractAction->execute()
#6 /var/www/example.org/vendor/civicrm/civicrm-core/CRM/Api4/Page/AJAX.php(139): civicrm_api4('Afform', 'loadAdminData', Array, NULL)
#7 /var/www/example.org/vendor/civicrm/civicrm-core/CRM/Api4/Page/AJAX.php(80): CRM_Api4_Page_AJAX->execute('Afform', 'loadAdminData', Array, '0')
#8 /var/www/example.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(313): CRM_Api4_Page_AJAX->run(Array, NULL)
#9 /var/www/example.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#10 /var/www/example.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#11 /var/www/example.org/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke(Array)
#12 /var/www/example.org/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke(Array)
#13 [internal function]: Drupal\civicrm\Controller\CivicrmController->main(Array, 'Afform:loadAdmi...')
#14 /var/www/example.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#15 /var/www/example.org/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/example.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#17 /var/www/example.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#18 /var/www/example.org/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 /var/www/example.org/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#20 /var/www/example.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/www/example.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/example.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/example.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/example.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/example.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/example.org/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/example.org/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/example.org/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#29 {main}
```https://lab.civicrm.org/dev/core/-/issues/2750Events RSS Feed doesn't include Event Date Field2023-09-14T05:03:24ZBarijohnEvents RSS Feed doesn't include Event Date FieldOverview
----------------------------------------
Add Event Date to Event RSS template to allow easy aggregation into external websites.
Example use-case
----------------------------------------
To display events on an external website ...Overview
----------------------------------------
Add Event Date to Event RSS template to allow easy aggregation into external websites.
Example use-case
----------------------------------------
To display events on an external website using the inbuilt RSS feed and CiviCRM Event functionality to reduce duplication of work.
Current behaviour
----------------------------------------
```
<item>
<title>Fall Fundraiser Dinner</title>
<link>https://dmaster.demo.civicrm.org/civicrm/event/info?reset=1&id=1</link>
<description> Kick up your heels at our Fall Fundraiser Dinner/Dance at Glen Echo Park! Come by yourself or bring a partner, friend or the entire family! This event benefits our teen programs. Admission includes a full 3 course meal and wine or soft drinks. Grab your dancing shoes, bring the kids and come join the party! When: January 26th, 2022 5:00 PM through January 28th, 2022 5:00 PM Where: 14S El Camino Way E Collinsville, CT 6022 United States </description>
<category>Fundraiser</category>
<author>development@example.org</author>
<guid isPermaLink="false">CiviCRM_EventID_1_f90c7968e68e8bc667d6d4c8808f6985@dmaster.demo.civicrm.org</guid>
</item>
```
Proposed behaviour
----------------------------------------
Remove author and add Event Start Date and Time.
Comments
----------------------------------------
Currently the default display of the RSS Feed doesn't include the start date of the event which makes it rather pointless as a RSS feed into external websites. I am sure this used to be there but it was rather a long time ago! It has the field of author which I don't feel is a useful field at the expense of start date at least.https://lab.civicrm.org/dev/core/-/issues/2749[regression] Free membership pages fail with "No Payment Processor Selected"2021-08-14T03:55:50ZJonGold[regression] Free membership pages fail with "No Payment Processor Selected"This is a regression from wordpress#109/[PR 20929](https://github.com/civicrm/civicrm-core/pull/20929).
A contribution page configured solely to let users sign up for a free membership now fails with "A payment processor configured for ...This is a regression from wordpress#109/[PR 20929](https://github.com/civicrm/civicrm-core/pull/20929).
A contribution page configured solely to let users sign up for a free membership now fails with "A payment processor configured for this page might be disabled (contact the site administrator for assistance)."
The help text for the `is_monetary` box states, "Uncheck this box if you are using this contribution page for free membership signup..." and my understanding is that this has always been a supported configuration.
Reviewing the code, I think the easiest solution is to revert the fix. The alternative would be to determine at load time if a page has any price fields with a potential value > 0.5.40.2https://lab.civicrm.org/dev/core/-/issues/2748Remove unused token assigns2023-09-19T05:03:18ZeileenRemove unused token assignsWe have a bunch of smarty variables that we spend a lot of code assigning to the the template but which have not been used in the shipped template for some time. We've been scared to stop assigning them 'in case' but we now have code to ...We have a bunch of smarty variables that we spend a lot of code assigning to the the template but which have not been used in the shipped template for some time. We've been scared to stop assigning them 'in case' but we now have code to warn on upgrade about these tokens so we can start removing
Notably the 'relatedContact' tokens removal will also allow some weird code to gohttps://lab.civicrm.org/dev/core/-/issues/2747Expose Contribution token processor2021-09-29T04:58:00ZeileenExpose Contribution token processorThis is just to outline the process I went through / am going through to expose the contribution token processor
1) Unit tests - I added unit tests to cover both the legacy token processing, the token processor, the legacy token declar...This is just to outline the process I went through / am going through to expose the contribution token processor
1) Unit tests - I added unit tests to cover both the legacy token processing, the token processor, the legacy token declarations & the token processor token declarations
2) I used the tests to identify the discrepancies across the 4 functions
3) I resolved pseudo-constant related discrepancies by adding tokens per the syntax discussed in https://lab.civicrm.org/dev/core/-/issues/2650
4) I added upgrade scripts to convert 'wrong' tokens in scheduled reminders
5) I then focussed on missing tokens &, with test cover, added the tokens to each side that were missing
6) with test cover I consolidated the declarations such that they match.
In progress (these are mostly the easy bits left fortunately - most of the work was in ^^)
7) determine whether the final token list is appropriate https://lab.civicrm.org/dev/core/-/issues/2745
8) final cleanup - ie need merges on [~~21048~~](https://github.com/civicrm/civicrm-core/pull/21048) & [21047](https://github.com/civicrm/civicrm-core/pull/21047) & [21046](https://github.com/civicrm/civicrm-core/pull/21046) & [~~21057~~](https://github.com/civicrm/civicrm-core/pull/21057)
9) Add listening - the biggest challenge here has always been clarifying the syntax as there is an undocumented alternative syntax and a not-very-documented-possibly-the-standard syntax - https://chat.civicrm.org/civicrm/pl/pqiz9dh1bbgi3ppx8my1yxo5wa
- this step also involves adding a unit test for the listening version along with the adding the actual fetch - this should be easy as a simple apiv4 get but need to do some mapping on the custom fields as they will come in in v3 syntax
Still to do
10) Add $contributionID as a parameter to `renderMessageTemplate` & add a test it's go. Note that that function is a strictly internal function & is thoroughly tested so we can change the signature 25 times a day if we want - & we specifically don't want that function to get 'extension-poisoned' - hence the lack of flexibility in the signature at the moment
Out of scope but good to do
11) add a couple of calculated tokens - most obviously total_paid_amount and balance_amount - these are acually in, of all places, the event token subscriber, and, more sensibly - the invoice code5.43.0https://lab.civicrm.org/dev/core/-/issues/2746Tokens - formatting syntax2021-11-03T09:24:42ZeileenTokens - formatting syntaxOne of the issues with our tokens is around formatting - or the lack of options around it - consider the following requirements (these are a little artificial but are representative of various requests)
1) I want to insert a birth date ...One of the issues with our tokens is around formatting - or the lack of options around it - consider the following requirements (these are a little artificial but are representative of various requests)
1) I want to insert a birth date in the standard formatting (I think that is 'long date'
2) I want to insert a birth date using short format
1) I want to insert Month of birth into an email, in the language in use
1) I want to add text if someone was born before a certain date
2) I want to use conditional that checks whether the month of birth is higher than today's month
We can visualise these as
```
Hey
Your birthday was on {contact.birth_date}, or for short {contact.birth_date|short}.
You were born in the month of {contact.birth_date|F}
{if {now|m} > {contact.birth_date|m}sorry I missed your birthday {/if}
{if {contact.birth_date|raw} < '1960-01-01'}You are pretty old ya know{/if}
```
Note that similar concerns apply to 'amount' fields where the need for 'raw' amounts is quite common.
Options as I see them are
1) never do anything to support format flexibility
2) define a pseudotoken formatting syntax for them - somewhat like above
3) define a pseudofield formatting syntax for them - this is basically 2 but with dots instead of pipes - we could also use double underscores
4) add a process (I thought we might be able to do this in token smarty but I'm not quite sure) that assigns a smarty token for every resolved token. ie if {contact.birth_date} is resolved then ALSO assign {$contact__birth_date}. Always assign in raw format. This would give template users the option of using smarty variables as interchangeable, more flexible versions. Over time we could alter what is advertised & promote smarty as preferred, if we choose.
**Some notes**
1. I haven't dug into how hard 4 would be - my gut says it is doable but is likely to wind up in the too hard basket if we extend that conversation to other templating engines (eg. twig) - which might be a good reason to look at 2 or 3 instead
1. It turns out that where smarty is enabled 'now' can already be printed out - ie `{$smarty.now|date_format:'%d %b %Y %H:%M:%S'}`. this is interesting because there are at least 3 extensions that make it available as a custom token....
2. Formatting thoughts - smarty uses [strftime formatting](https://www.php.net/strftime) eg. '%d %b %Y %H:%M:%S'. I feel like most of us would be more comfortable with strtotime formatting however, my efforts to understand the difference suggest that it is strftime not strtotime that handles formatting by locale so I feel pretty sure we should use strftime formats + our own standins - ie `dateformatDatetime`, `dateformatFull` `dateformatPartial` `dateformatYear` (we have a few more that we are currently storing strtotime style - ie `dateformatFinancialBatch` `dateformatshortdate` and `dateInputFormat` (brain explodes)
.
@totten @colemanw @seamuslee5.43.0https://lab.civicrm.org/dev/core/-/issues/2745Tokens - contributions - could we show them all?2021-09-29T04:58:14ZeileenTokens - contributions - could we show them all?The tokens available in the contribution tokens is a list of tokens people thought would be handy and wrote in - the list differed between the action schedule & the send letter and in some cases advertised tokens didn't work on one of th...The tokens available in the contribution tokens is a list of tokens people thought would be handy and wrote in - the list differed between the action schedule & the send letter and in some cases advertised tokens didn't work on one of those places. That reconcilliation is complete with https://github.com/civicrm/civicrm-core/pull/21046 merged.
However, we wind up with a list of available tokens that is 'all the fields on the contribution record except for 9 - which are in the screen shot below. I could make a weak case for excluding 'is_template_contribution' and a stronger case for excluding 'contact_id' but not for the others.
![image](/uploads/a8f29423e15b6c5e631da08b780fbcb7/image.png)
Options
1) include all tokens
2) include all tokens but hard-code out contact_id since it is likely to be confused with {contact.id} & potentially {membership.id}
3) include all tokens but add some form of metadata to Contribution.xml like <token>FALSE</token> and add that to contact_id & is_template_contribution (defaults to TRUE if not set)
@totten @colemanw @seamuslee5.43.0https://lab.civicrm.org/dev/core/-/issues/2744Proposal - move the Administer menu to the left of the Search menu, or the al...2021-08-12T18:23:31ZDaveDProposal - move the Administer menu to the left of the Search menu, or the alert popups to the bottomI'm not going to push too hard for this since the menu is customizable already, but I'll state the "problem" to see if I'm the only one:
It's rare that I'll go to just one admin screen in civi and then be done. I'm not talking about ini...I'm not going to push too hard for this since the menu is customizable already, but I'll state the "problem" to see if I'm the only one:
It's rare that I'll go to just one admin screen in civi and then be done. I'm not talking about initial provisioning but going in later to change a couple things. The popup message that comes up after you change anything is ALWAYS covering the next admin menu item I want to click on. Yes green ones go away in a few seconds but then I still get slowed down.
A related annoyance is if I haven't visited a civi page in a certain number of hours then the next time I visit a civi page the status check alert pops up, and virtually every site has something that's a warning (which is a separate issue discussed elsewhere), so it sits there covering the admin menu.
An alternative might be moving the popup to the bottom right instead of the top right.https://lab.civicrm.org/dev/core/-/issues/2743Performance regression in API3 related to campaign_id parameter2021-08-21T16:19:45ZPatrick Figelpfigel@greenpeace.orgPerformance regression in API3 related to campaign_id parameterWe found a performance regression related to API3 calls using the `campaign_id` parameter. It was introduced in 5.36 with [this](https://github.com/civicrm/civicrm-core/pull/19633). A particular workload we have (batching in CiviSEPA, wh...We found a performance regression related to API3 calls using the `campaign_id` parameter. It was introduced in 5.36 with [this](https://github.com/civicrm/civicrm-core/pull/19633). A particular workload we have (batching in CiviSEPA, which creates a few thousand contributions) went from 31 minutes to 116 minutes. This is probably due to the fact that `campaign_id` was previously treated as a PseudoConstant with caching, but is now loaded for every call to `_civicrm_api3_validate_integer` for `campaign_id`. This tends to get called a lot for us.
The issue probably only affect sites with a significant number of campaigns (>3k in our case) that create lots of entities linking to those campaigns using API3, so I'm not sure if there's interest in fixing this.
We went with a [simple hack](https://github.com/greenpeace-cee/civicrm-core/commit/dd22eb22e53dcaf0bf5b47c14c616730fe5d1559) where we only bother loading campaign names if the parameter is not an integer as integers are what our batch processes tend to use (though we do have other code where we pass in campaign names, so the original fix is definitely appreciated and necessary :sweat_smile:). I'm not sure if this has any side-effects on deployments that use numeric campaign names for some reason.
We could introduce caching somewhere in that code path, but I don't think there's much precedent for doing that on the API3 level and it feels a bit like I'd be opening the door to cache invalidation hell.5.40.2https://lab.civicrm.org/dev/core/-/issues/2742Creating a regular group from advanced search displays commas for the type wh...2021-08-07T12:32:45ZDaveDCreating a regular group from advanced search displays commas for the type when looking at the groups listing page1. Advanced Search
2. From the results create a regular group (not smart)
3. Don't check mailing list or access control.
4. Contacts - Manage Groups. See screenshot below. (I thought those were quotes at first but they're commas.)
5. Jus...1. Advanced Search
2. From the results create a regular group (not smart)
3. Don't check mailing list or access control.
4. Contacts - Manage Groups. See screenshot below. (I thought those were quotes at first but they're commas.)
5. Just editing the settings and resaving without changing anything clears it.
6. Not sure when it started. Is in 5.39 and master.
7. Note it doesn't happen if done from basic search.
![Untitled](/uploads/7a5e7709c337488a1989454eec25f391/Untitled.png)5.41.0https://lab.civicrm.org/dev/core/-/issues/2741Group visibility not respected after profile edit submission2023-09-12T05:03:26ZandyburnsGroup visibility not respected after profile edit submissionWhen using a profile in edit mode, my groups show up correctly. However, once I submit and go to the view screen to see what I submitted, it then exposes all the groups I am in, even if they are not set to 'Public Pages'. It should not e...When using a profile in edit mode, my groups show up correctly. However, once I submit and go to the view screen to see what I submitted, it then exposes all the groups I am in, even if they are not set to 'Public Pages'. It should not expose 'User and User Admin' visibility groups. I was using checksum function in this case.
I have less than 10 Public Groups, below is way more than that.
![Untitled](/uploads/1ba9fad0f6c44842aa6dcc8fd10dea9e/Untitled.png)https://lab.civicrm.org/dev/core/-/issues/2740Contact Dashboard: relationships: wrong links appear if "Pledges" not displayed2021-08-09T20:34:01ZAllenShawContact Dashboard: relationships: wrong links appear if "Pledges" not displayed**Description:**
Very surprising behavior on the Contact Dashboard (q=civicrm/user):
If _Display Preferences_ > _Contact Dashboard_ does not include "Pledges", then the links for each relationship under "Your Contacts / Organizations" ...**Description:**
Very surprising behavior on the Contact Dashboard (q=civicrm/user):
If _Display Preferences_ > _Contact Dashboard_ does not include "Pledges", then the links for each relationship under "Your Contacts / Organizations" will not be the expected links "Edit Contact Information", "Dashboard", and "Disable"; instead those links will be to back-office features "View", "Edit", etc.
Reproduced on dmaster:
![anim](/uploads/c7c1cb008684618c6ab1073984226abf/anim.gif)
**Analysis:**
1. These links are defined in `CRM_Contact_BAO_Relationship::getContactRelationshipSelector()` around [line 2035](https://lab.civicrm.org/dev/core/-/blob/master/CRM/Contact/BAO/Relationship.php#L2035), based on the value of `$params['context']`, which ultimately is taken from $_REQUEST
2. On the Contact Dashboard, the relationships content is built via an xhr call to `/civicrm/ajax/contactrelationships?context=...` which will provide that `context` value; this value is set in Smarty template [templates/CRM/Contact/Page/View/RelationshipSelector.tpl](https://lab.civicrm.org/dev/core/-/blob/master/templates/CRM/Contact/Page/View/RelationshipSelector.tpl#L19) using whatever value is assigned to smarty variable `$context`.
3. This $context variable is assigned to the template as 'user' in [CRM_Core_Form_Search::loadStandardSearchOptionsFromUrl()](https://lab.civicrm.org/dev/core/-/blob/master/CRM/Core/Form/Search.php#L500) based on the value in the controller store, which is set to 'user' in [CRM_Pledge_Page_UserDashboard::listPledges()](https://lab.civicrm.org/dev/core/-/blob/master/CRM/Pledge/Page/UserDashboard.php#L33).
If the Pledges section is not included on the Contact Dashboard, then the value of Smarty variable `$context` is never set; therefore it's empty when passed via xhr to `CRM_Contact_BAO_Relationship::getContactRelationshipSelector()`; therefore that method will use the back-office links for each relationship row, instead of the user-context links that are expected on the Contact Dashboard.
**Possible fix:**
A patch equivalent to this one is solving this problem in local dev, simply by specifying `conteext="user"` in the Contact Dashboard when building the relationships section:
```
diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php
index 8cba50b..868f0d1 100644
--- a/CRM/Contact/Page/View/UserDashBoard.php
+++ b/CRM/Contact/Page/View/UserDashBoard.php
@@ -132,6 +132,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page {
$contactRelationships = $selector = NULL;
CRM_Utils_Hook::searchColumns('relationship.columns', $columnHeaders, $contactRelationships, $selector);
$this->assign('columnHeaders', $columnHeaders);
+ $this->assign('context', 'user');
$dashboardElements[] = [
'class' => 'crm-dashboard-permissionedOrgs',
'templatePath' => 'CRM/Contact/Page/View/RelationshipSelector.tpl',
```
However:
1. Before submitting a PR, I'd be curious to hear feedback on what that might break -- i.e., thoughts on where additional test coverage might be warranted.
2. I'm also wondering if there's a better place to set `context`. Seems like it would be safe (and more broadly effective) to define `conteext="user"` throughout the scope of the Contact Dashboard, rather than only when Relationships section is included.5.40.1https://lab.civicrm.org/dev/core/-/issues/3206Cannot save a copy of a report without the "administer reports" permission2023-12-21T05:03:20ZbgmCannot save a copy of a report without the "administer reports" permissionTo reproduce:
* Create a user with the following permissions
* access CiviReport
* access Report Criteria
* save Report Criteria
* Go to an existing report (or a template)
* Refresh the results
* Under Actions, click "save as"
Re...To reproduce:
* Create a user with the following permissions
* access CiviReport
* access Report Criteria
* save Report Criteria
* Go to an existing report (or a template)
* Refresh the results
* Under Actions, click "save as"
Result: javascript error: "TypeError: $refresh_field.html() is undefined"
![report-saveas-2021-08-05_14-45](/uploads/fe812c8f50c77c51a5a010987cd9b86d/report-saveas-2021-08-05_14-45.png)https://lab.civicrm.org/dev/core/-/issues/3224Search Kit doesn't display related contact custom fields2022-04-22T15:51:13ZJonGoldSearch Kit doesn't display related contact custom fieldsIf you have a Search Kit that includes a related contact, displaying the related contact's custom data will actually show the main contact's custom data.
See screenshots below. Teresa has a most important issue of "Education", Santina'...If you have a Search Kit that includes a related contact, displaying the related contact's custom data will actually show the main contact's custom data.
See screenshots below. Teresa has a most important issue of "Education", Santina's is "Social Justice". When I build a search and include both the `Constituent Information: Most Important Issue` and `Contact Related Contacts: Constituent Information: Most Important Issue` columns, they both have the same value.
![Selection_1184](/uploads/ba7c2f496b001f8bd86536d9419b0035/Selection_1184.png)
![Selection_1185](/uploads/d28c833e256a6dcc091d5f1629a124f2/Selection_1185.png)
![Selection_1186](/uploads/65af3fd4f21cb09b60274a700ee2f580/Selection_1186.png)5.42.0https://lab.civicrm.org/dev/core/-/issues/3216dev/report#53: search on relationship and case (2)2023-12-25T05:03:31Zeileendev/report#53: search on relationship and case (2)Unfortunately we had to revert https://github.com/civicrm/civicrm-core/pull/20002 since it was too complicated to fix the regression it causes in time for the release otherwise
Overview
When doing an advanced search with case parameters...Unfortunately we had to revert https://github.com/civicrm/civicrm-core/pull/20002 since it was too complicated to fix the regression it causes in time for the release otherwise
Overview
When doing an advanced search with case parameters set and displaying related contacts. Gives all clients of all the found cases which have this relationship. What we would expect is that related contact is linked to the found cases.
Steps to reproduce
Preparation:
Create a contact Contact A
Create another contact Contact B
Create a third contact Contact C
Create a case of type Housing Support for Contact A
On the case assign the role Benefit specialist is to Contact B
Create a second case of type Adult day care referral
On the case assign the role Benefit specialist is to Contact C
Searching:
Go to advanced search
Click on View contact as related contact
Select Benefit Specialist as relationship type
Go to tab cases and select Housing Support as case type
Expected results
I expected to see only Contact B as that one has a relationship on the case Housing Support.
Actual results
I see both Contact B and Contact C.
Comments
See also the discussion of a similar related topic: https://lab.civicrm.org/dev/report/-/issues/53jaapjansmajaapjansmahttps://lab.civicrm.org/dev/core/-/issues/2739Contribution tasks receive wrong IDs from contact search2021-08-05T20:58:53ZPatrick Figelpfigel@greenpeace.orgContribution tasks receive wrong IDs from contact searchStarting with Civi 5.37, when using Advanced Search with "Display Results As" set to "Contributions" while also using a custom profile for "Views For Display Contacts" (either by selecting it or making it the default in "Search Preferenc...Starting with Civi 5.37, when using Advanced Search with "Display Results As" set to "Contributions" while also using a custom profile for "Views For Display Contacts" (either by selecting it or making it the default in "Search Preferences"), performing any contribution task will use the ID of the custom profile (`uf_group_id`) as the contribution ID, effectively doing things to an unrelated contribution that just happens to have the same ID.
This is due to the form storing `uf_group_id` in the `id` property in the controller, which is later returned as the supposed contribution id in `CRM_Contribute_Form_Task_TaskTrait::calculateIDS()`.
The bug was introduced with 06dec0480c079535cff5c12cf03acab586a247c8 in https://github.com/civicrm/civicrm-core/pull/19904.
I have a potential fix available [here](https://github.com/greenpeace-cee/civicrm-core/commit/6645ca8e24c6951ee7bc9e479637cae51ae017be), not sure if it's the right approach.5.40.0https://lab.civicrm.org/dev/core/-/issues/2738Multi select contact reference field - Activity Details Report fails with Tru...2024-03-28T05:03:25ZDevAppMulti select contact reference field - Activity Details Report fails with Truncated incorrect INTEGER valueWhen running the Activity Details report in CiviCRM 5.36.1 with a contact reference field that is multi select.
![image](/uploads/2848dca8a1bd36ac7fcbdbe6f3068d58/image.png)
Seems related to this change:
https://lab.civicrm.org/dev/cor...When running the Activity Details report in CiviCRM 5.36.1 with a contact reference field that is multi select.
![image](/uploads/2848dca8a1bd36ac7fcbdbe6f3068d58/image.png)
Seems related to this change:
https://lab.civicrm.org/dev/core/-/issues/2123
```
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.gender_id as civicrm_contact_contact_target_gender, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id, activity_civireport.duration as civicrm_activity_duration, activity_civireport.details as civicrm_activity_details, activity_civireport.priority_id as civicrm_activity_priority_id, address_civireport.country_id as civicrm_address_country_id, contact_custom_29_civireport.display_name as civicrm_value_phone_call_in_10_custom_29, value_phone_call_in_10_civireport.category_30 as civicrm_value_phone_call_in_10_custom_30, address_civireport.street_name as civicrm_address_street_name, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_address as civicrm_address_street_address, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code \n
FROM civicrm_activity activity_civireport\n
INNER JOIN civicrm_activity_contact activity_contact_civireport\n
ON activity_civireport.id = activity_contact_civireport.activity_id AND\n
activity_contact_civireport.record_type_id = 3\n
INNER JOIN civicrm_contact civicrm_contact_target\n
ON activity_contact_civireport.contact_id = civicrm_contact_target.id\n
\n
LEFT JOIN civicrm_address address_civireport\n
ON (civicrm_contact_target.id =\n
address_civireport.contact_id) AND\n
address_civireport.is_primary = 1\n
\n
LEFT JOIN civicrm_value_phone_call_in_10 value_phone_call_in_10_civireport ON value_phone_call_in_10_civireport.entity_id = activity_civireport.id\n
LEFT JOIN civicrm_contact contact_custom_29_civireport ON contact_custom_29_civireport.id = value_phone_call_in_10_civireport.referred_to_29 WHERE activity_civireport.is_test = 0 AND\n
activity_civireport.is_deleted = 0 AND\n
activity_civireport.is_current_revision = 1 AND ( activity_civireport.activity_date_time >= 20210801000000) AND ( activity_civireport.activity_date_time <= 20210831235959) AND ( activity_civireport.activity_type_id IN (2) ) [nativecode=1292 ** Truncated incorrect INTEGER value: '\x01730\x01']
"""
4 => "1292 ** Truncated incorrect INTEGER value: '\x01730\x01'"
]
```https://lab.civicrm.org/dev/core/-/issues/2737Search display permissions issue (search kit)2021-08-17T21:07:08ZeileenSearch display permissions issue (search kit)When viewing a configured (table) search display the 'Administer CiviCRM' - or at least 'Administer CiviCRM data' is required. I don't believe that is intentional as the SearchDislay.run action does not require administer CiviCRM - but ...When viewing a configured (table) search display the 'Administer CiviCRM' - or at least 'Administer CiviCRM data' is required. I don't believe that is intentional as the SearchDislay.run action does not require administer CiviCRM - but other api calls (notably SearchDisplay.get) on that page DO require administer civicrm data.
My understanding is a search display should work for 'any user' but not necessarily return results (permission dependent) whereas a search form permits permissions to be overridden
@colemanw as you can tell I'm looking at search kit this week :-)