Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-08-03T14:23:35Zhttps://lab.civicrm.org/dev/core/-/issues/4463Authentication tokens: session already active - same user2023-08-03T14:23:35Zaydunsaidan.saunders@squiffle.ukAuthentication tokens: session already active - same userOverview
----------------------------------------
If a user clicks an authenticated link a second time the result is an error message stating: `HTTP 401 Cannot login. Session already active.`
See [this chat](https://chat.civicrm.org/civ...Overview
----------------------------------------
If a user clicks an authenticated link a second time the result is an error message stating: `HTTP 401 Cannot login. Session already active.`
See [this chat](https://chat.civicrm.org/civicrm/pl/n4cr3jownifexnjda3k45qhura)
and https://lab.civicrm.org/dev/core/-/issues/4462
Reproduction steps
----------------------------------------
1. Create a FormBuilder form and enable the Token option
1. Send a mail using the form token. This link includes "_authx=Bearer..."
1. Click the link on the received mail. - Should work and creates an authenticated session.
1. Click the link again - fails with `HTTP 401 Cannot login. Session already active.`
Expected behaviour
----------------------------------------
There are two scenarios depending on whether it is the same user. This bug issue relates to the case where the user is the same. See #4464 for handling this where the user is different.
It the user is the same, it should just continue to the form without error.https://lab.civicrm.org/dev/core/-/issues/4462Transactional Authentication (Page-level auth tokens)2024-03-01T19:59:17Zaydunsaidan.saunders@squiffle.ukTransactional Authentication (Page-level auth tokens)Overview
----------------------------------------
Improve the support for transactional approaches in the authentication framework. The current implementation of authentication tokens is more suited to a portal approach than a transacti...Overview
----------------------------------------
Improve the support for transactional approaches in the authentication framework. The current implementation of authentication tokens is more suited to a portal approach than a transactional one.
See [this snippet](https://lab.civicrm.org/-/snippets/92 ) for the background describing how to use authenticated links with forms. This documents the resulting conversation with @totten [here](https://chat.civicrm.org/civicrm/pl/trubx7xwui878nsz3w6ujmf6oc):
(@totten says:) I'd like some language to describe two ways of approaching customized UX for constituents.
- Hypothetical scenario
- You send an email 12 months after a prior donation. You thank the donor for the previous contribution. The message includes some links to update communication preferences, browse past donations, or make a new donation.
- UX Approaches
1. **Transactional Approach / One form at a time / Strict Pageflow / Page-Level Auth**: The email has 3x hyperlinks. Each goes to different form/page. Each link has diff auth code (which confers access to exactly one form).
2. **Portal Approach / Multiple forms at discretion / Open Pageflow / Session-Level Auth**: The email has 3x hyperlinks. All go to pages within the same portal. The user opens the first page which takes their interest. On that page, there are more links (eg via prose or navbar) to go checkout the others.
I don't know a good/simple way to say that one is better than the other. but they are different. I suspect there's some Venn diagram of organizational-scenarios (some better suited to 1; some to 2; some to either 1 or 2)
The current auth-code mechanism is better for "Portal Approach/Open Pageflow" -- and it's worse for Transactional Approach/Strict Pageflow"
(that's not b/c "Open Pageflow" is better -- but at the time of its writing, it was the easier one to support)
From a low-level POV, the auth-codes for them would differ like this:
- For portal/open pageflow, it generates this token -- which is basically a login-token
- -The custom forms use "Role-based" security-(Maybe either security model is ok in this context...)
- For transactional/strict pageflow, you might expect...
- It needs a fine-grained token like this (pseudocode)
```
$bearerToken = "Bearer " . $jwt->encode([
'exp' => $expires,
'sub' => "cid:" . $contactId,
'scope' => 'api4',
'api4.whitelist' => [
['Afform', 'prefill', ['name' =>'xyz']],
['Afform', 'submit', ['name' =>'xyz']],
]);
```
- In PHP, need a mechanism to accept those tokens
- In JS/HTML, need a mechanism to relay that token
- The custom forms use "Form-based" security
See also
--------
- #4463: Authentication tokens: session already active - same user
- #4464: Authentication tokens: session already active - different userhttps://lab.civicrm.org/dev/core/-/issues/4458Error when viewing contact-info profile without "view deleted contacts" permi...2023-08-07T12:11:55ZcolemanwError when viewing contact-info profile without "view deleted contacts" permissionThe change in b7edabe813db467aff6dd1ea083d798089198655 switched the profile to use APIv4 to fetch email id for constructing an email link. The API call looks like this:
```php
$emailID = Email::get()->setOrderBy(['is_primary' => 'DES...The change in b7edabe813db467aff6dd1ea083d798089198655 switched the profile to use APIv4 to fetch email id for constructing an email link. The API call looks like this:
```php
$emailID = Email::get()->setOrderBy(['is_primary' => 'DESC'])->setWhere([['contact_id', '=', $this->_id], ['email', '=', $email], ['on_hold', '=', FALSE], ['contact_id.is_deceased', '=', FALSE], ['contact_id.is_deleted', '=', FALSE], ['contact_id.do_not_email', '=', FALSE]])->execute()->first()['id'];
```
It was reported on SE that this fails for users without "view deleted contacts", however I'm unable to reproduce.
See https://civicrm.stackexchange.com/questions/45313/invalid-field-contact-id-is-deceased-apiv4
This should have already been double-fixed by:
- [Revert "Add permission metadata to contact is_deleted field" #22203](https://github.com/civicrm/civicrm-core/pull/22203)
- [APIv4 - Silently ignore non-permissioned fields instead of throwing exceptions #20724](https://github.com/civicrm/civicrm-core/pull/20724)https://lab.civicrm.org/dev/core/-/issues/4454Proposal: Rename "Scheduled Reminders"2023-10-09T22:42:58ZJonGoldProposal: Rename "Scheduled Reminders"From a UX perspective, "Scheduled Reminders" is a poor name. It has uses far beyond reminders, and it's unintuitive to create a birthday email or "welcome series" of emails using a feature called "Scheduled Reminders".
I don't 100% h...From a UX perspective, "Scheduled Reminders" is a poor name. It has uses far beyond reminders, and it's unintuitive to create a birthday email or "welcome series" of emails using a feature called "Scheduled Reminders".
I don't 100% have a term decided on, though everyone loves a good bikeshed. I considered "Scheduled Messages" or "Scheduled Communications" - but I would expect a scheduled CiviMail or SMS to fall under that label (but maybe so does "Scheduled Reminders"?). "Automated Messages" overlaps with the System Messages. "Scheduled Message Rules" is better but long (if we ignore CiviRules momentarily).
Does anyone else have thoughts? I could live with "Scheduled Messages" as an improvement, but perhaps there's something better.https://lab.civicrm.org/dev/core/-/issues/4452Message Admin doesn't show which message templates have been edited2023-09-18T12:15:28ZlarsssandergreenMessage Admin doesn't show which message templates have been edited~~It looks like Message Admin is now enabled by default, but~~ I've noticed that there is no indication in Message Admin of which templates have been edited or not. This is pretty important info for admins and should be available in the ...~~It looks like Message Admin is now enabled by default, but~~ I've noticed that there is no indication in Message Admin of which templates have been edited or not. This is pretty important info for admins and should be available in the UI.
Compare the old - very clear which has been edited:
![image](/uploads/43963f9cbbf0e08c5f1679056e4a2c35/image.png)
to the new - no indication which has been edited:
![image](/uploads/4a394422a26c4a1536306e96d3c77a7c/image.png)
I can't see anything on the edit page to indicate this either.
Edit: There is also no longer any way to revert a message to the default, other than by manually copying and pasting the template content. I think having the "Revert to default" link is useful, if you made a small change and have decided you no longer need it because there has been an upgrade.
~~Also, I guess the drafting process isn't implemented yet (or not accessible from the UI), so maybe it would make sense to hide the Draft column until that's ready.~~https://lab.civicrm.org/dev/core/-/issues/4448SearchKit HAVING clause does not support relative dates.2023-08-03T12:45:52ZTony Maynard-SmithSearchKit HAVING clause does not support relative dates.## Overview
SearchKit WHERE clauses on a Date field provide a facility for comparing with a relative date, e.g. "\< Before Now 12 Months". The HAVING clause does not, but I am suggesting that it should.
## Example use-case
1. SearchK...## Overview
SearchKit WHERE clauses on a Date field provide a facility for comparing with a relative date, e.g. "\< Before Now 12 Months". The HAVING clause does not, but I am suggesting that it should.
## Example use-case
1. SearchKit search to select Contacts who have not participated in an Event for the last 12 months. Also applies to Activities, Memberships, etc.
## Current behaviour
Can construct a HAVING clause to compare e.g. a MAX Date field with a literal date, but not with a relative date as for a WHERE clause.
## Proposed behaviour
Relative dates should be provided for HAVING as well as WHERE clauses. This is much more user friendly for a packaged search than having to edit the search definition in SearchKit each time.
## Comments
_Anything else you would like the reviewer to note._https://lab.civicrm.org/dev/core/-/issues/4440SearchUI: Find Contributions issues2023-07-21T09:54:27Zaydunsaidan.saunders@squiffle.ukSearchUI: Find Contributions issuesIssues that need addressing for the SearchUI Find Contributions page to match core:
- [ ] Figure out how to handle payments:
- In current version, clicking on amount expands to show payment details and buttons
- [ ] Figure out ho...Issues that need addressing for the SearchUI Find Contributions page to match core:
- [ ] Figure out how to handle payments:
- In current version, clicking on amount expands to show payment details and buttons
- [ ] Figure out how to handle Soft Credits
- Current version has several filter options
- [ ] Figure out how to handle Recurring Contributions
- Current version also searches for these. Maybe better as a separate search?
- [ ] Figure out how to handle PCPs
- (Does anyone use PCPs? If so, what is useful in this search?) Not showing correctly.
- [x] Add contribution totals
- [ ] Some actions missing
- [x] Filters - convert some to Yes/No ([#4415](https://lab.civicrm.org/dev/core/-/issues/4415))
- done by adding 'is null' fields to search. Would be nice to rework if/when 4415 is implemented.
- but this doesn't interact properly with 'Group by' used in the Summary section
- [ ] Filter layout
- Current labels and groupings are for dev purposes, need improvement
- [ ] Add more here ...https://lab.civicrm.org/dev/user-interface/-/issues/53Remove "Save and New" buttons from most places2024-03-14T16:00:22ZbgmRemove "Save and New" buttons from most placesIt might make sense in a few places, but in a lot of places, "Save and New" is clutter.
Opening a financial batch?
![image](/uploads/c9f11710837b0deafe883eb20d08a39d/image.png)
Creating a Contribution Page?
![image](/uploads/4ed0a185...It might make sense in a few places, but in a lot of places, "Save and New" is clutter.
Opening a financial batch?
![image](/uploads/c9f11710837b0deafe883eb20d08a39d/image.png)
Creating a Contribution Page?
![image](/uploads/4ed0a1850a777b39cb0e37b7138b9982/image.png)
(ok, not "save and new", but still, what does "Done" even mean?)
~~Price Sets - Add Field:~~
![image](/uploads/190a2069aab8f49a722f3bf6d5b7e39f/image.png)
~~.. is that "Save and New" really useful? It opens in a popup, so it really only saves 0.5 seconds, but you have to think 0.5 seconds more to click the right button.~~ (edit: there was support to keep it)
And..
- New/Edit Petition
- New/Edit Survey
![image](/uploads/061033c42fbd700e4252b9f111204b07/image.png)
Make it makes sense for:
- New Contribution (in standalone mode)
- ?
![image](/uploads/56ed51a0cbd301b4211603ba1cfdbe85/image.png)https://lab.civicrm.org/dev/core/-/issues/4438Test Contributions cannot be selected by id in SearchKit2023-07-21T09:56:24ZbrienneTest Contributions cannot be selected by id in SearchKitOverview
----------------------------------------
In SearchKit, a test Contribution cannot be selected by id, such as in the `WHERE` clause, as the test does not appear as an option in the autocomplete drop down list. However, this is no...Overview
----------------------------------------
In SearchKit, a test Contribution cannot be selected by id, such as in the `WHERE` clause, as the test does not appear as an option in the autocomplete drop down list. However, this is not a problem in APIv4, where you can type in the id directly into the available text box.
Reproduction steps
----------------------------------------
1. Find or create a test Contribution
* the quickest way to create one would be by using APIv4 with `is_test = Yes` in the `WHERE` clause.
1. Create a SearchKit with Contributions as the primary entity.
1. In the `WHERE` section, select `Contribution ID =` and then type in the id of the test contribution
1. The drop down list will display 'None found'.
Current behaviour
----------------------------------------
A test Contribution cannot be selected by its id from SearchKit, however, it is available in APIv4.
![Selection_160](/uploads/2547cfd47d94f8e48dce669a391c44a8/Selection_160.png)
![Selection_161](/uploads/88a8cf0da71c4114ab4ca47d1f38e6e7/Selection_161.png)
Expected behaviour
----------------------------------------
A test Contribution should be select-able by its id from SearchKit.
Environment information
----------------------------------------
* __CiviCRM:__ 5.63.alpha1https://lab.civicrm.org/dev/core/-/issues/4436Contact prefix not shown in mailing labels2023-07-18T17:56:58ZschorschiiContact prefix not shown in mailing labels## Overview
I tried to insert the contact prefix into the mailing label format. So I selected the "Individual Prefix" from the right drop-down menu and it inserts `{contact.prefix_id:label}` into the mailing label format textbox. However...## Overview
I tried to insert the contact prefix into the mailing label format. So I selected the "Individual Prefix" from the right drop-down menu and it inserts `{contact.prefix_id:label}` into the mailing label format textbox. However, this placeholder is never filled, i.e. it is always empty when creating mailing labels.
## Reproduction steps
1. Administer -> Localization -> Address Settings -> insert "Individual Prefix"/`{contact.prefix_id:label}` into textbox
2. Search contacts, select some from the result list, choose "Mailing labels - print" from the actions menu
## Current behaviour
The contact prefix is never shown on the mailing labels.
## Expected behaviour
The contact prefix should be shown on the mailing label PDF.
## Environment information
CiviCRM version 5.63.1 under WordPress, German language packhttps://lab.civicrm.org/dev/core/-/issues/4434Don't allow uploading attachments to bulk mailings if they exceed the size limit2023-07-21T09:57:50ZDaveDDon't allow uploading attachments to bulk mailings if they exceed the size limitThere's been a couple times on multiple sites where the mailing bounces and it's not clear to the average office staffer why, but it's because they've uploaded a 30MB pdf to the mailing.
It should just not allow doing that in the first ...There's been a couple times on multiple sites where the mailing bounces and it's not clear to the average office staffer why, but it's because they've uploaded a 30MB pdf to the mailing.
It should just not allow doing that in the first place if the config settings have a smaller limit.https://lab.civicrm.org/dev/core/-/issues/4433E2E_Core_PathUrlTest::testGetUrl_WpAdmin() fails because CiviCRM routing is c...2023-07-24T20:52:34ZtottenE2E_Core_PathUrlTest::testGetUrl_WpAdmin() fails because CiviCRM routing is confusingThe gist of the test: it calls `cv url civicrm/contribute?reset=1` and asserts that the URL will open in the WordPress backend UI (aka `/wp-admin/`).
([Full source](https://github.com/civicrm/civicrm-core/blob/8e0dabd20bebe55d5dd725f301...The gist of the test: it calls `cv url civicrm/contribute?reset=1` and asserts that the URL will open in the WordPress backend UI (aka `/wp-admin/`).
([Full source](https://github.com/civicrm/civicrm-core/blob/8e0dabd20bebe55d5dd725f3015c41019cb8dbed/tests/phpunit/E2E/Core/PathUrlTest.php#L94-L117))
The test is failing. There are currently two patches:
* [25476](https://github.com/civicrm/civicrm-core/pull/25476): Automatically choose frontend/backend based on the route metadata
* [26772](https://github.com/civicrm/civicrm-core/pull/26772): Change the test to specifically request backend
Both have issues. So here's a deep-dive into the context.
Background
----------
* CiviCRM runs on Drupal/Backdrop and WordPress/Joomla.
* On WordPress/Joomla, the "frontend" and "backend" are different sub-applications (e.g. `/` vs `/wp-admin/`). The applications have very different URL structures. To make a hyperlink, you first decide which sub-application to target -- and then pick a page within it.
* On Drupal/Backdrop, it's one application, and all URLs have similar structure. To make a hyperlink, you simply identify the page.
* (*Drupal/Backdrop UX can sometimes distinguish frontend/backend -- but it's a visual choice based on local configuration. It's not a structural part of the URL.*)
* CiviCRM's routing system integrates into every UF/CMS, but (internally) it is closer to Drupal's. There is one `civicrm_menu` with all frontend+backend pages.
* On Drupal/Backdrop, CiviCRM's routes pass directly to CMS routes.
* On WordPress/Joomla, CiviCRM's routing integrates with both subapplications (ie "frontend" and "backend").
* CiviCRM stores a flag `bool is_public` for each route.
* CiviCRM includes routes which can be classified as:
* Purely backend (ex: `civicrm/dashboard`)
* Purely frontend (ex: `civicrm/event/register`)
* Purely web-service (ex: `civicrm/payment/ipn`)
* Multi-homed
* Ex: `civicrm/profile/view` has use-cases for frontend and backend
* Ex: `civicrm/ajax/api4/%` has use-cases for frontend, backend, and web-service
* CiviCRM has a function `CRM_Utils_System::url()`
* At first glance, it resembles Drupal's `\url()`. You typically just give the page (e.g. `url('civicrm/foo/bar')`).
* Over time, several additional parameters were added -- notably, the 6th parameter `bool $frontend` and the 7th parameter `bool $forceBackend`.
Problems
--------
* The status-quo invites bugs between CMS's.
* A developer working on Drupal will have trouble recognizing the importance of the 6th and 7th parameters. (*Those params do nothing on Drupal - and they're buried at the end of method.*)
* The status-quo invites bugs between interactive and automatic processes.
* A developer defines a custom token and tests it interactively; then at runtime, the token is sent by an automatic process. But the interactive/automatic split is orthogonal to frontend/backend split. Sometimes, interactive/automatic agree with each other (*both frontend or both backend*), and sometimes they disagree (*one frontend, one backend*).
* Overall, what tends to happen is:
* Developer writes a call like `CRM_Utils_System::url('civicrm/foo/bar')`, and it looks pretty.
* They test, and it works beautifully on their system.
* They publish, and it fails on other systems.
* Someone writes a patch to add 5 more parameters (`url('civicrm/foo/bar', '', FALSE, NULL, TRUE, TRUE)`). And then it's OK.
* The DX is awkward and invites bugs (in core and contrib) -- but it becomes more annoying for `cv` UX.
* If you need a 5th/6th param in PHP code, then you'll eventually figure it out and commit the update to your codebase. Then you forget about it.
* `cv` has some commands to facilitate manual testing and E2E testing (ie `cv url`, `cv http`, `cv open`). These are things that you improvise. Mismatched URLs can be annoying anytime you use these subcommands.
What to do
----------
There are two PRs to fix the test, and honestly - I don't really like either.
* [26772](https://github.com/civicrm/civicrm-core/pull/26772) makes the red mark go away, but it leaves the underlying issue (poor DX for PHP and poor UX for cv).
* [25476](https://github.com/civicrm/civicrm-core/pull/25476) aims to fix the underlying issue, but it's probably too facile. The current metadata can distinguish "purely frontend" pages from "purely backend" pages, but it cannot recognize "purely web-service" or "multi-homed". It probably messes-up some scenarios for those.
* Fixing this probably requires some more aggressive transition in the contract.
* Ex: Improve the routing metadata so that we can distinguish web-service routes and multi-home routes.
* Ex: Define a different class or function for generating URLs (*with a more usable signature*).
* Another option is to leave `civicrm-core` as-is -- and only update `cv`.
* Ex: Give `cv` the mechanism to resolve a frontend/backend based on metadata.
* Ex: Change `cv` to complain if you don't a specify frontend/backend flag.
* Either way, it feels like a bit of a wasted opportunity to only patch `cv` when we know that other users of `CRM_Utils_System::url()` get confused about the frontend/backend flags.https://lab.civicrm.org/dev/core/-/issues/4432Permission system can be bypassed from the search results action menu2023-07-21T09:59:05ZschorschiiPermission system can be bypassed from the search results action menuOverview
----------------------------------------
I created a simple permission structure where a group of CiviCRM users ("Group A") has write access to a group of contacts ("Group B"). (Every logged in user can read all contacts in our ...Overview
----------------------------------------
I created a simple permission structure where a group of CiviCRM users ("Group A") has write access to a group of contacts ("Group B"). (Every logged in user can read all contacts in our system.)
When a contact is now added to "Group B", users of "Group A" see the edit button on the contact and can add/remove the contact to/from groups on the contact detail page. When removing the contact from "Group B", the edit button disappears. So far, everything as expected.
But when using the actions menu from the search results, users can add/remove group assignments of a contact which is not in "Group B".
Isn't this an inconsistency in the permission system? Or am I missing something? How to avoid group membership changes of contacts which are not in "Group B" by users which are in "Group A"?
Reproduction steps
----------------------------------------
1. Create a role, assign it to "Group A" and create ACL "edit" for "Group B".
2. Log in with a non-admin user which is member of "Group A".
3. Search a contact which is not member of "Group B". Select it in the search results and choose "Group - add contact" or "Group - remove contact".
Current behaviour
----------------------------------------
I can change the group membership of this contact from within the action menu of the search result list.
Expected behaviour
----------------------------------------
Group membership changes should be refused since the contact is not member of "Group B".
When opening the contact's detail view, it works as expected, which means I'm not able to change the group memberships there.
Environment information
----------------------------------------
CiviCRM version 5.63.1 under WordPress
[Corresponding question on StackExchange](https://civicrm.stackexchange.com/questions/45266/permission-system-not-working-as-expected)https://lab.civicrm.org/dev/core/-/issues/4431API4: "!=" has unexpected results on NULL fields2023-07-21T09:59:23ZJonGoldAPI4: "!=" has unexpected results on NULL fieldsOverview
----------------------------------------
Using the `!=` operator when some of the values are `NULL` does not return the `NULL` records.
Reproduction steps
----------------------------------------
1. On a demo site (which by def...Overview
----------------------------------------
Using the `!=` operator when some of the values are `NULL` does not return the `NULL` records.
Reproduction steps
----------------------------------------
1. On a demo site (which by default has no contacts with a subtype), search for contacts that are not of subtype "Parent".
E.g.:
```php
\Civi\Api4\Contact::get(TRUE)
->addWhere('contact_sub_type', '!=', 'Parent')
->execute();
```
Current behaviour
----------------------------------------
No results are returned.
Expected behaviour
----------------------------------------
All results are returned, since no record is a Parent.
Comments
----------------------------------------
I thought at some point, `!=` internally generated `!= and IS NOT NULL` but maybe that was somewhere else.
I just learned about the MySQL null-safe equals operator, which would also solve this problem: https://stackoverflow.com/a/44723097/2832108https://lab.civicrm.org/dev/core/-/issues/4428Membership Fee token error in automatic membership renewal messages2023-09-24T22:49:30ZbwheelerMembership Fee token error in automatic membership renewal messagesOverview
----------------------------------------
This is related to another issue, https://lab.civicrm.org/dev/core/-/issues/3805 which was posted in https://civicrm.stackexchange.com/questions/42438/error-on-membership-fee-token-when-u...Overview
----------------------------------------
This is related to another issue, https://lab.civicrm.org/dev/core/-/issues/3805 which was posted in https://civicrm.stackexchange.com/questions/42438/error-on-membership-fee-token-when-using-print-merge-document/42443#42443
Reproduction steps
----------------------------------------
The original ticket has these reproduction steps:
I did a short test on the demo sandbox.
Selected "Find Membership" and selected one record. I then choose Print/Merge Document and added 2 tokens, {membership.id} and {membership.fee} Then clicked "Preview" to see the pdf outcome.
If I use only the token {membership.id} I do not get any error message and the preview is created.
Adding {membership.fee} I get the following error message below.
You can also reproduce the issue by creating an automatic membership renewal message with {membership.fee} in it and trying to send the renewal message.
Current behaviour
----------------------------------------
In the current version of Civi, the code will run but it will show 0.00 for the membership fee instead of the actual membership fee.
Expected behaviour
----------------------------------------
It should show the correct membership fee.
We propose fixing this with the following code. This won't match exactly the latest version of Civi because we're working off 5.58.1 but if it looks good, we'll submit a review with the latest version of Civi.
```diff
+++ b/sites/all/modules/civicrm/CRM/Member/Tokens.php
@@ -61,8 +61,17 @@ class CRM_Member_Tokens extends CRM_Core_EntityTokens {
*/
public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) {
if ($field === 'fee') {
- $membershipType = CRM_Member_BAO_MembershipType::getMembershipType($this->getFieldValue($row, 'membership_type_id'));
- $row->tokens($entity, $field, \CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($membershipType['minimum_fee']));
+ $membershipTypeId = $this->getFieldValue($row, 'membership_type_id');
+ if (empty($membershipTypeId) && isset($row->context['membershipId'])) {
+ $membership = CRM_Member_BAO_Membership::findById($row->context['membershipId']);
+ $membershipTypeId = $membership->membership_type_id;
+ }
+ $membershipType = CRM_Member_BAO_MembershipType::getMembershipType($membershipTypeId);
+ $minimumFee = 0;
+ if ($membershipType) {
+ $minimumFee = $membershipType['minimum_fee'];
+ }
+ $row->tokens($entity, $field, \CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($minimumFee));
}
```https://lab.civicrm.org/dev/core/-/issues/4423Slow contact lookup query in SearchKit2023-07-15T12:58:42ZeileenSlow contact lookup query in SearchKitI think we might be doing something weird when we query for an id in search kit / api4
It takes about 30 seconds to return here - that is what I might expect if I was waiting for it to search without an index (ie a pre-pended wildcard) ...I think we might be doing something weird when we query for an id in search kit / api4
It takes about 30 seconds to return here - that is what I might expect if I was waiting for it to search without an index (ie a pre-pended wildcard) but of course we turned that off using the site setting
![image](/uploads/acb69198d4abda193d10b5e2fd103252/image.png)https://lab.civicrm.org/dev/core/-/issues/4421Scheduled jobs stopped working after an update last week - error in MailingEv...2023-11-23T06:34:09ZTobias KrauseScheduled jobs stopped working after an update last week - error in MailingEventUnsubscribe.phpI realized this morning that the CiviCRM cron job for the scheduled jobs stopped working after we updated last week from CiviCRM 5.61.2 to 5.61.4. Today I updated to the most current version 5.63.1 but the error still exists.
The proble...I realized this morning that the CiviCRM cron job for the scheduled jobs stopped working after we updated last week from CiviCRM 5.61.2 to 5.61.4. Today I updated to the most current version 5.63.1 but the error still exists.
The problem became obvious as the message "Cron job not running" appeared when I logged in this morning (I did not so for the whole last week). When I checked the list of scheduled jobs I found out that the "Bounces fetcher" job run successfully but all the other jobs did not. So I run our cron job task
`/var/www/civi_live/vendor/civicrm/cv/bin/cv api job.execute --user=admin --cwd=/var/www/civi_live/httpdocs`
manually in CLI and got the following error:
```
In MailingEventUnsubscribe.php line 47:
count(): Argument #1 ($value) must be of type Countable|array, null given
```
The following file is the one: vendor/civicrm/civicrm-core/api/v3/MailingEventUnsubscribe.php
Here it is the following code part in the function civicrm_api3_mailing_event_unsubscribe_create:
```
$groups = CRM_Mailing_Event_BAO_MailingEventUnsubscribe::unsub_from_mailing($job, $queue, $hash);
if (count($groups)) {
CRM_Mailing_Event_BAO_MailingEventUnsubscribe::send_unsub_response($queue, $groups, FALSE, $job);
return civicrm_api3_create_success($params);
}
```
CRM_Mailing_Event_BAO_MailingEventUnsubscribe::unsub_from_mailing can return an array or NULL. I am not sure why this error appeared after the last update as neither CRM_Mailing_Event_BAO_MailingEventUnsubscribe::unsub_from_mailing nor civicrm_api3_mailing_event_unsubscribe_create() has changed but it may be related to some other changes somewhere.
When I change this code part to the following the scheduled jobs are finished:
```
$groups = CRM_Mailing_Event_BAO_MailingEventUnsubscribe::unsub_from_mailing($job, $queue, $hash);
if ($groups && count($groups)) {
CRM_Mailing_Event_BAO_MailingEventUnsubscribe::send_unsub_response($queue, $groups, FALSE, $job);
return civicrm_api3_create_success($params);
}
```https://lab.civicrm.org/dev/core/-/issues/4420crmDate support for Date Preferences2023-07-10T06:21:42ZlarsssandergreencrmDate support for Date Preferences[crmDate](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Smarty/plugins/modifier.crmDate.php) only supports Date Formats, not the confusingly separate Date Preferences, which include creditCard format. It would be nice to b...[crmDate](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Smarty/plugins/modifier.crmDate.php) only supports Date Formats, not the confusingly separate Date Preferences, which include creditCard format. It would be nice to be able to use `crmDate:'creditCard'` on Contribution Page Review and Thank You pages, etc.
Or maybe we should use tokens for credit_card_expiration_date instead, @DaveD thinks they support the Preferences.https://lab.civicrm.org/dev/core/-/issues/4412Add something like API 3 Attachments to API 42023-07-06T06:35:00ZlarsssandergreenAdd something like API 3 Attachments to API 4We can't get the full URL for a file from API 4 File and there is no API 4 Attachments, so API 3 must be used — which seems like a significant gap.
Thought this was worth noting as it has come up [twice](https://civicrm.stackexchange.co...We can't get the full URL for a file from API 4 File and there is no API 4 Attachments, so API 3 must be used — which seems like a significant gap.
Thought this was worth noting as it has come up [twice](https://civicrm.stackexchange.com/questions/45209/get-uploaded-file-full-url-via-api-v4/45210) on [SE](https://civicrm.stackexchange.com/questions/45179/civi-crm-apiv4-image-retrieval) recently.https://lab.civicrm.org/dev/core/-/issues/4406SearchKit: make 'inplace edit' conditional2023-07-09T03:06:31Zaydunsaidan.saunders@squiffle.ukSearchKit: make 'inplace edit' conditionalSuggestion: apply conditional rules (like those on the `Style` option) to `In-place edit`
Use case:
On a listing of Participant Status Types, we want to enable in-place edit if the type is not `Reserved`Suggestion: apply conditional rules (like those on the `Style` option) to `In-place edit`
Use case:
On a listing of Participant Status Types, we want to enable in-place edit if the type is not `Reserved`colemanwcolemanw