Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-02-27T22:02:08Zhttps://lab.civicrm.org/dev/core/-/issues/3878SearchKit: Add ability to search and filter by active periods2023-02-27T22:02:08ZfrancescbassasSearchKit: Add ability to search and filter by active periodsOverview
----------------------------------------
Some entities (Relationships, Memberships, Cases, Events, Recurring Contributions) may be defined by a start date and end date that indirectly define a period in which the entity is activ...Overview
----------------------------------------
Some entities (Relationships, Memberships, Cases, Events, Recurring Contributions) may be defined by a start date and end date that indirectly define a period in which the entity is active or not.
This is a proposal to enable the possibility to search for entities active during a specific period via SearchKit and also filter results through related SearchKit Afforms.
Example use-case
----------------------------------------
1. **Relationships:** Search for active volunteers on a specific year
1. **Cases:** Get a pivot report with active cases per week
1. **Events:** Count number of active events on last year
1. **Memberships:** List active members per month
1. **Recurring contributions:** Get a pivot report with the active recurring contributions per month
Current behaviour
----------------------------------------
Currently, search for active relationships it’s only available through Advanced Search and Relationships Report, but it’s not possible to do this search via SearchKit.
![advanced-search](/uploads/dbd57f4abd494fe4225494c7f2faa5ef/advanced-search.png)
![relationship-report](/uploads/1d37472120e4f2cde4b055a0c60b147b/relationship-report.png)
@ayduns, points in [this SE answer](https://civicrm.stackexchange.com/a/41871/104) a way to search for a specific active period.
![searchkit-approximation](/uploads/5d151234bd3093ab422ffd6b057d936c/searchkit-approximation.png)
This it’s good, but not enough. It’s very tricky to build this clause intuitively. And if you create an Afform with this SearchKit you can’t expose start dates and end dates to reproduce this clause.
Proposed behavior
----------------------------------------
Create an “Active period” search field selector available for entities with start and end dates: Relationships, Events, Memberships, Recurring contributions and Cases.
This would allow for example:
1. Click on **Search -> Search Kit**.
1. Search for **Relationships** or **Events**
1. Select **Active Period** in **where** clause
1. Choose options for filter **=**/**is Between** and **Pick Date**/**Date Range**...
Active period selector, like in the image below:
![active-period-field-selector](/uploads/f7bff145d568e35ad01ce87dd0f211f1/active-period-field-selector.png)
Comments
----------------------------------------
Would answer questions like:
[How to search active relationships (e.g) during past year?](https://civicrm.stackexchange.com/q/8315/104)
[Is it possible to get point-in-time membership data?](https://civicrm.stackexchange.com/q/2253/104) [duplicate](How do I determine how many active members there were on a date in the past? [duplicate])
[Create a report or graph of the number of campaigns active in any particular month](https://civicrm.stackexchange.com/q/34465/104)
Will cover the use of this extension [Historic Membership Data](https://github.com/fuzionnz/nz.co.fuzion.historicmembershipdata)https://lab.civicrm.org/dev/core/-/issues/3875Pressing return on additional participants page for event registration goes b...2023-06-03T19:57:34ZlarsssandergreenPressing return on additional participants page for event registration goes back to previous page instead of forwardThere are three buttons on the additional participant page: Go Back, Continue, Skip Participant. Since all three are type="submit", when you press the return/enter key, the first button of type="submit" is clicked, so you go back one pag...There are three buttons on the additional participant page: Go Back, Continue, Skip Participant. Since all three are type="submit", when you press the return/enter key, the first button of type="submit" is clicked, so you go back one page. Contrast with the primary participant registration page, where return does take you to the next page because there is only one button or with a contribution page where return takes you to the confirmation page, again because there is only one button.
The easiest fix would be to change the types of the other buttons to "button". The button type [is set here](https://github.com/civicrm/civicrm-core/blob/c94963f7637912571ce62b33de60f7d5ce640f69/CRM/Core/Form.php#L758) for all buttons as "submit" unless type="reset" is passed to addButtons. So I propose to review button types in use, setting those that make sense as "submit" (next, done, submit, upload, process, etc) and others as "button" (cancel, refresh). Any buttons without a type will be left as "submit" so as to avoid breaking anything.
There is also a class default added to buttons that have isDefault, but it's unclear to me what this does.https://lab.civicrm.org/dev/core/-/issues/3874APIv4 Relationships refused if duplicated2022-11-26T20:59:14ZshaneonabikeAPIv4 Relationships refused if duplicated**Backlog**
I see that @samuelsov already reported this, but the bot closed the issue #451.
**Disabled Relationships**
I came across a scenario where if a Contact Relationship was disabled, and you attempt to create a new one (that ma...**Backlog**
I see that @samuelsov already reported this, but the bot closed the issue #451.
**Disabled Relationships**
I came across a scenario where if a Contact Relationship was disabled, and you attempt to create a new one (that matches dates) it is refused. Ironically, the UI let's me add the Relationship.
+ Create a Relationship with a start / end date
+ Disable relationship
+ Create a new Relationship with the same start / end date via UI (works)
+ Create a new Relationship with the same start / end date via APIv4 (fails with Duplicate Exception)
**Cases**
Today, I came across another scenario where we are using ActivityProfile with CiviRules. The gist is that when someone submits a CiviCase then CiviRules assigned the Case Coordinator to their case. It's the same person each time.
In this scenario, the APIv4 is also refused the submission because of the duplicated Relationship. But really I think it makes sense to have multiple cases open for one person with the same case coordinator managing them all right?
My scenario can be replicated without ActivityProfile
+ Create a Case for test user A and Coordinator X
+ Create a new Case for Test User A
+ Use the APiv4 to setup a relationship to Coordinator X
It should throw an exception Duplicate Relationship on relationship.create.
Thoughts?https://lab.civicrm.org/dev/core/-/issues/3872Search on pledge payments on Find contributions screen2022-09-26T20:24:23ZyashodhaSearch on pledge payments on Find contributions screenIn _Find contributions_, if _CiviPledge_ is enabled, add search on pledge payments.
![se](/uploads/37de92cf4ea25288db09be94e60df203/se.png)
We do have bunch of options for search on contributions that are recurring or not, pay later o...In _Find contributions_, if _CiviPledge_ is enabled, add search on pledge payments.
![se](/uploads/37de92cf4ea25288db09be94e60df203/se.png)
We do have bunch of options for search on contributions that are recurring or not, pay later or not, would be helpful to check if the contribution is a pledge payment or not.
And based on the components enabled, we can have for event/membership as well.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/3871Write-off feature for pledges2022-10-11T13:07:54ZyashodhaWrite-off feature for pledges**Functional specifications:**
On a pledge, in _Edit Scheduled Payment_, we can delete a pledge payment. The total pledge amount is reduced by the amount of the scheduled payment and the balance due is recalculated.
But in this scenar...**Functional specifications:**
On a pledge, in _Edit Scheduled Payment_, we can delete a pledge payment. The total pledge amount is reduced by the amount of the scheduled payment and the balance due is recalculated.
But in this scenario, the pledge status is left as is.
We can also cancel a pledge. All scheduled payments are canceled but the pledge status is set to canceled and the pledge balance and the total pledge amount are not recalculated. So I propose a new feature for the write-off.
- Add the menu option “Write Off” before Cancel.
- All scheduled payments are canceled like for a pledge cancellation.
- Pledge status is changed to Completed.
- Total pledge amount is reduced by the existing pledge balance amount.
- Pledge balance is set to $0.
- An activity of type “Pledge write-off” is created and recorded on the contact.
- Activity Subject=total pledge amount
- Activity Date and time = date and time of the action
- Activity Status=Completed
- Actions available on the activity should be View and File on case only like for the activity type Contribution.
- The option _Write-Off_ is available only for a pledge that has at least one pledge payment. If no pledge payment has been recorded with a pledge, write-off doesn’t make any sense, so we should have only the options to delete or cancel a pledge.
- if pledge status =Pending or Overdue > Show only Cancel and Delete
- if pledge status = In progress > show only Write-Off and Delete
- if pledge status = Completed or Canceled > show only Deleteyashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/3869Cannot update contacts via profile from Search Kit results2023-09-22T02:06:27ZlarsssandergreenCannot update contacts via profile from Search Kit resultsIf you select contacts from Search Kit results and then select Profile Update from the Action menu, you are able to select a profile in the dialog box, but after clicking Continue, the dialog simply closes.
Tested on dmaster (5.55.alpha...If you select contacts from Search Kit results and then select Profile Update from the Action menu, you are able to select a profile in the dialog box, but after clicking Continue, the dialog simply closes.
Tested on dmaster (5.55.alpha1) and 5.49.5.https://lab.civicrm.org/dev/core/-/issues/3868Link contribution view with asssociated entity2023-05-18T23:37:57ZyashodhaLink contribution view with asssociated entityWhen you view a contribution, there's no way to know whether this contribution was done as a part of membership, pledge or an event registration.
I propose provide this additional data. Display this under total amount
e,g
![Screens...When you view a contribution, there's no way to know whether this contribution was done as a part of membership, pledge or an event registration.
I propose provide this additional data. Display this under total amount
e,g
![Screenshot_from_2022-09-23_19-15-29](/uploads/24028770f5b17e20ab40334973061b05/Screenshot_from_2022-09-23_19-15-29.png)
Membership will be a link to membership view page.
(depending on the related entity we display the link)yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/3867Subscription do-not-reply email causing issues with some mail servers connect...2023-11-20T23:59:49Znikola.mladenovicSubscription do-not-reply email causing issues with some mail servers connecting via SMTPOverview
----------------------------------------
We used integration via Contact Form 7 integration to connect Contact Form 7 in order to send data directly to CiviCRM. This works when server is connected to mail() but not via SMTP for ...Overview
----------------------------------------
We used integration via Contact Form 7 integration to connect Contact Form 7 in order to send data directly to CiviCRM. This works when server is connected to mail() but not via SMTP for some servers.
This issue is only present when you use Mailing Event: Subscribe to mailing list as Action in form processor.
The client uses cPanel, which by default has setup to decline all emails that do not exist (ex do-not-reply@domain.com). They do not use catchall. The issue itself is CiviCRM related, not FormProcessor.
When its set to SMTP, it tries to send email stimulating address do-not-reply@domain.com
Since it doesn't exist and SMTP is directly connected to only one email that wont work, as it tries to use that address for Subscribing process. When you send via mail() function you get email from proper email, but since server stimulates it, it doesn't cause a bug in that state.
Reproduction steps
----------------------------------------
1. Connect via SMTP to some cPanel SMTP or similar host that doesn't have catchall/VERP/do-not-reply@domain.com address present
2. Click on Administration -> Automation -> Form processor
2. Create Form processor that only has email for value
3. Add XCM contact matcher to match contact
4. Add type Mailing Event: Subscribe to mailing list
5. Save and Close -> Try out out
Current behaviour
----------------------------------------
When you try to fill out Contact Form 7 and it has SMTP connected, data is submitted but submission itself is not sent to the user.
When you use Try Out option for Form Processor you get error from the system: Unable to send email. Please report this message to the site administrator
In logs you can find this:
`[error] Mailing error: Failed to add recipient: user@website.org [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: 550, response: Verification failed for...`
SMTP and bounce processing is functioning perfectly for newsletter.
Expected behaviour
----------------------------------------
It should by default use SMTP address not ask for do-not-reply@domain.com address as it sends even via SMTP with our hotfix. This causes issues for some SMTP connections, from some hosts. In this case from cPanel which does not have catchall setup or do-not-reply@domain.com address.
Current hotfix for client's needs
----------------------------------------
We made an edit in file civicrm/CRM/Mailing/Event/BAO/Subscribe.php on line 208 on master ('returnPath' => CRM_Core_BAO_Domain::getNoReplyEmailAddress()) to force to use same address as SMTP one and that works when subscription is received.
` 'returnPath' => 'smtp@domain.com',//CRM_Core_BAO_Domain::getNoReplyEmailAddress(), `
Environment information
----------------------------------------
* __Browser:__ _Firefox 105.0/Chrome 105.0.5195.127_
* __CiviCRM:__ _5.47.4_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _Php-7.4_
* __CMS:__ _Drupal-7.91_
* __Database:__ _mysql-8.0.30-0ubuntu0.20.04.2_
* __Web Server:__ _apache2-2.4.41_
Comments
----------------------------------------
Chat link of discussion:
https://chat.civicrm.org/civicrm/pl/1sqat1uwo3befca91akhmdzsre
Creating do-not-reply@domain.com address is also another fix, but its not noted anywhere but it should exist, either fixing this for global use or adding in CiviCRM to report that do-not-reply@domain.com doesn't exists should suffice.https://lab.civicrm.org/dev/core/-/issues/3861add message template id to sendmail function2022-09-23T02:19:02Zmagnolia61add message template id to sendmail functionOverview
----------------------------------------
In trying to use AlterMailParams I ran into this 'bug'. The MessageTemplateID is a field that is used in the email workflow functions, but when manually sending an email using a message t...Overview
----------------------------------------
In trying to use AlterMailParams I ran into this 'bug'. The MessageTemplateID is a field that is used in the email workflow functions, but when manually sending an email using a message template the ID is not passed on.
Reproduction steps
----------------------------------------
1. Send email manually to a contact using a message template
2. the message template ID is not passed from submit function to sendmail function in CRM/Contact/Form/Task/EmailTrait.php
3. AlterMailParams cannot use the message template ID for the kind of mails
Current behaviour
----------------------------------------
Message Template ID is not passed on to send email functions
Expected behaviour
----------------------------------------
Message Template ID is not passed on to send email functions
Environment information
----------------------------------------
- CiviCRM: 5.53.0
- CMS: Drupal 7.92
- PHP: 7.4.30 (fpm-fcgi)
- Database: 10.5.15-MariaDB-0+deb11u1-log engine: InnoDB 10 row format: Dynamic, Compressed
- Webserver: Apache/2.4.54 (Debian)
Comments
----------------------------------------
PR: https://github.com/civicrm/civicrm-core/pull/24583https://lab.civicrm.org/dev/core/-/issues/3860{event.location} token in scheduled reminders doesn't include supplemental lines2022-09-23T15:32:31ZDaveD{event.location} token in scheduled reminders doesn't include supplemental linesWhen composing a scheduled reminder for events there's a choice of token `{event.location}`. If your event location uses the supplemental address lines they are not included in this token.
It's the same in 5.44 so not a recent change.When composing a scheduled reminder for events there's a choice of token `{event.location}`. If your event location uses the supplemental address lines they are not included in this token.
It's the same in 5.44 so not a recent change.https://lab.civicrm.org/dev/core/-/issues/3859Participant's fee amount changes when saving the associated contribution2023-10-12T20:08:01ZJonGoldParticipant's fee amount changes when saving the associated contributionWhen someone registers multiple participants for an event, saving the contribution will change the participant's `fee_amount` for the last participant.
### Replication Steps
* Create a new paid event with online registration (let's say ...When someone registers multiple participants for an event, saving the contribution will change the participant's `fee_amount` for the last participant.
### Replication Steps
* Create a new paid event with online registration (let's say tickets are $5).
* Allow registering multiple participants.
* Register for the event with at least one additional registrant (let's assume one additional person, so $10 total).
* Look at both contact's participant records - their fee amount (on the "Events" tab) will show $5.
* Click **Edit** for the contribution record on the primary registrant and then **Save** with no changes.
### Expected Result
The fee amount on both participant records remains at $5.
### Actual Result
The fee amount on the second participant records changes to $10.
### Analysis
This happens at `CRM_Contribute_Form_Contribution::submit()` [line 1580](https://github.com/civicrm/civicrm-core/blob/76fd5a1cea97f280e24604e741dafa0dad303af5/CRM/Contribute/Form/Contribution.php#L1580).
We call `CRM_Contribute_BAO_Contribution::getComponentDetails()` which claims it "Returns all contribution related object ids" but assumes that there is only one participant (and membership) record tied to a contribution. So it returns the participant ID of the last person registered, and then at line 1611-1614, resaves the participant record with the total amount of the contribution.
### Next Steps
Line 1602 claims we are "updating the line items for participants", and I understand updating the `fee_amount` if the price changes. However, lines 1610-1614 are better out than in - they're more liable to give a wrong answer than a right one. Alternatively, we can limit it to only work on single line item contributions.
The next step would be to deprecate `CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id)` since it can't handle multiple membership/participant records, and replace it with a function that does. Then we can fix the code that calls the deprecated function.
I realize none of this code should be at the form layer - but that's a much larger job.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/3858Email displays twice on Contribution Confirmation/Thank-you pages2023-11-23T07:47:00ZJonGoldEmail displays twice on Contribution Confirmation/Thank-you pagesOverview
----------------------------------------
If you have a profile on your contribution page that includes an email field, the email appears twice on the Confirmation and Thank-You pages.
Reproduction steps
------------------------...Overview
----------------------------------------
If you have a profile on your contribution page that includes an email field, the email appears twice on the Confirmation and Thank-You pages.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Add a profile to the page that contains an email.
1. Submit a contribution.
Current behaviour
----------------------------------------
![Selection_1638](/uploads/e0bfd95675953dadba161aa20e658a99/Selection_1638.png)
Expected behaviour
----------------------------------------
![Selection_1637](/uploads/9c06ec7dc2f1537c860e904ba02f76d4/Selection_1637.png)
Comments
----------------------------------------
When an email field is present in a profile, we correctly hide the email field from the main contribution page. This extends that behavior to the confirmation and thank-you.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/3851Discussion: How to make past unsubscribes visible in the UI2022-10-11T10:38:49ZlarsssandergreenDiscussion: How to make past unsubscribes visible in the UIEdit: Title changed to reflect discussion, which has gone in a different (better) direction.
Sometimes, a contact unsubscribes from a group and is later re-added to the same group. After this happens, we no longer have any record of the...Edit: Title changed to reflect discussion, which has gone in a different (better) direction.
Sometimes, a contact unsubscribes from a group and is later re-added to the same group. After this happens, we no longer have any record of the contact unsubscribing as their group status has been updated to Added with the added date.
It would be useful to be able to check when a contact unsubscribed in order to troubleshoot (are contacts being re-added to groups they have unsubscribed from?), to confirm with the contact manually that they wish to be in a newsletter subscription group and generally to be able to say that the org has a record of the contact unsubscribing. Similarly, if a contact unsubscribes from a group that is later deleted, then there is no longer any record of their having unsubscribed.
So, I propose to add an activity whenever a contact unsubscribes from a group by email:
1. Add an activity type: Unsubscribe.
2. Whenever a contact unsubscribes by email, add an activity of this type with the subject indicating the group unsubscribed from and the mailing from which they unsubscribed: "Unsubscribed from GROUP via MAILING".
For similar record keeping purposes, I think it would make sense to do the same with opt outs, with a new Opt out activity type, with subject: "Opted out from bulk emails via MAILING".
In theory, these changes would be viewable in the change log, but that's only if you have logging turned on and are willing to trawl through many change log entries to try to find the relevant one. An activity would be much more usable and is in line with many other actions that are recorded as activities (like changes to recurring contributions, contributions themselves, membership status changes, event registrations and changes, etc).https://lab.civicrm.org/dev/core/-/issues/3848Multisite: dashlet irregular behavior2022-10-11T10:18:48ZandyburnsMultisite: dashlet irregular behaviorWithin a multisite instance, the `civicrm_dashboard_contact` behavior is a bit odd with a new twist with SK dashlets switching domains in `civicrm_dashboard`. Examining the behavior of both CiviReport dashlets and Search Kit, below:
**C...Within a multisite instance, the `civicrm_dashboard_contact` behavior is a bit odd with a new twist with SK dashlets switching domains in `civicrm_dashboard`. Examining the behavior of both CiviReport dashlets and Search Kit, below:
**CiviReport Dashlets**
If you add a CiviReport to via "Available for Dashboard?", observe that it adds a row in `civicrm_dashboard_contact` for all users of multisite, not just those in your domain, even though CiviReports is domain-aware (this also occurs with SK dashlets). This occurs on all domains generating dashboards.
Within `civicrm_dashboard`, 1 entry exists for the domain it was created on, so there is no linkage for the dashlet to show on any of the domains even though it is added in `civicrm_dashboard_contact`. Therefore, it does not show for those users.
**Search Kit Dashlets**
One feature that would be powerful to have is to have global reports in multisite. Good news is Search Kit is close to achieving this, and I currently use a version of this today. You can create a display and link the page with a relative URL in your CMS nav for instance (e.g. /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fsome-display) and it will be accessible to any domain on your multisite and respect ACL's, etc. However, as with CiviReport, the `civicrm_dashboard` is generated for 1 domain. I have done a test of inserting the SK dashboard (cloning in MySQL) on all domains so users now see dashlet in available dashlets. Once they drag it as an active dashlet, it generates the entry in `civicrm_dashboard_contact.` That's good :)
However, we observe that domain ID 1 where the dashlet was created with Form Builder, switches the domain ID to the last in the array of domains of the civicrm.settings.php file. This occurs before and after generating an entry for all domains. In this case, See below from the `log_civicrm_dashboard` as evidence:
![image](/uploads/238a4a1b9f1f1a052207c16cf5785ce6/image.png)
I have been switching it back to domain ID 1, manually. Observe below that even with domain 57 having an entry for the dashboard, it still switched domain ID 1 dashlet to 57, resulting in duplicate dashlets.
![image](/uploads/fca03a597d44747e818c230c89a04c6e/image.png)
For Search Kit dashlets, the behavior that is not clear cut. It can vary and is dependent on if it is intended to be 1) a dashlet for it's domain only, or 2) a global dashlet for all domains. With this in mind, it would NOT be desirous to generate an entry in `civicrm_dashboard` for all domains, I think this is best left to inserting directly to MySQL if you intend to make a dashboard for more than 1 domain, or some paid development to enable this. It is similar to how `civicrm_navigation` needs to be built when generating a new domain on multisite.
Noting that `uf_match` table, adds an entry for domain ID 1 for people that are not users of domain ID 1. Perhaps this i why it is generating dashlets for these. @haystack just noting this may be related to uf_match behavior. I note that currently I have 352 domain ID 1 `uf_match` entries but not anywhere near that or ever had a cumulative user count near that number, however it is lower than the total users on all other domains:
![image](/uploads/14707cebad86bab3c9f27533f46c3e63/image.png)
Evidence below of 2 entries per user:
![image](/uploads/fb942aa4ad5f8d53159c262920577622/image.png)
Summary of issues:
- [ ] CiviReport / Search Kit dashlets should not generate an entry in `civicrm_dashboard_contact` for users not on it's domain (it's harmless, but also nonsensical)
- [ ] Search Kit Dashlets via Form Builder switch domain ID (High Priority)https://lab.civicrm.org/dev/core/-/issues/3841Core (etc.) extensions should be categorized and filterable2022-10-11T10:11:26ZJonGoldCore (etc.) extensions should be categorized and filterableThe extensions page is getting harder to navigate, and isn't alphabetized by description. Finding an extension can take a while.
We should take a cue from Drupal and add `category` to the `info.xml`, then put extensions into accordions ...The extensions page is getting harder to navigate, and isn't alphabetized by description. Finding an extension can take a while.
We should take a cue from Drupal and add `category` to the `info.xml`, then put extensions into accordions by category.
Like Drupal, I don't think we need a set taxonomy, and even if only core extensions had this, it would be a good UX improvement.
I also realize that we're probably near the point where the Extensions page is built in Form Builder, but the first step is buy-in on the concept, implementation can wait a bit.JonGoldJonGoldhttps://lab.civicrm.org/dev/drupal/-/issues/182Drupal 7 modules not ported to Drupal 9 yet2022-09-09T10:08:56Zluke.stewartDrupal 7 modules not ported to Drupal 9 yetCurrently there are a number of Drupal 7 modules that have not been ported to Drupal 9 as a - comes bundled with CiviCRM - code located within the CiviCRM codebase on install.
This can be seen by comparing
https://github.com/civicrm/civ...Currently there are a number of Drupal 7 modules that have not been ported to Drupal 9 as a - comes bundled with CiviCRM - code located within the CiviCRM codebase on install.
This can be seen by comparing
https://github.com/civicrm/civicrm-drupal/tree/7.x-master/modules
and
https://github.com/civicrm/civicrm-drupal-8/tree/master/modules/
Now a number of these modules it doesn't make sense to run in D9:
Views, CiviCRM OG Sync CiviCRM Engage and possibly others?
Some have a D9 module:
CiviCRM Group Roles has been set up as a stand alone project
https://www.drupal.org/project/civicrm_group_roles
CiviCRM Theme has been set up as part of the civicrm-drupal-8 codebase
CiviCRM Member Roles has been proposed as a PR to the drupal-8 repo but this has been stalled for a while now.
https://github.com/civicrm/civicrm-drupal-8/pull/66
I feel like options for modules here are now:
- A) 🍎 Set up as a stand alone project leave it to Site Builders/Maintainers as to whether to install or not.
- B) 🍌 Set up as a stand alone project but require as a dependency via composer so code gets installed when installing CiviCRM
Do we have criteria for deciding which option in general?
Do we have criteria for deciding which option should be applied in the case of CiviCRM Member Roles?
- C) 🥕 Include within the CiviCRM Drupal codebase via the civicrm/civicrm-drupal-8 project
Do we need a general criteria before deciding approach for CiviCRM Member Roles?
I think probably we would not want to use B unless we wanted something in a separate module that was required for the vast majority of installs of CiviCRM to run?
Given that there has been little appetite for CiviCRM Member Roles perhaps the approach is to split this into it's own module on the basis that most D9 sites to date are probably not using - therefore perhaps this code should not be required to be present on all CiviCRM installs.
However - we still have a lot of sites running D7 - and perhaps the sites that would use Member Roles are mainly running D7?https://lab.civicrm.org/dev/core/-/issues/3836Searching by phone in Advanced Search with a non-default Search Profile retur...2022-11-14T19:16:04ZbrienneSearching by phone in Advanced Search with a non-default Search Profile returns DB Error: no such fieldOverview
----------------------------------------
If a user tries to search by a phone number via Advanced Search and uses a non-default Search Profile that includes a phone number and at least one location field (i.e. city), then the se...Overview
----------------------------------------
If a user tries to search by a phone number via Advanced Search and uses a non-default Search Profile that includes a phone number and at least one location field (i.e. city), then the search produces an error with the message `DB error: no such field`.
Reproduction steps
----------------------------------------
1. Go to **Administer > Custom Data and Screens > Profiles**
1. Click **Add Profile**
1. Enter a Profile Name and check the box next/to the left of *Search Views*
1. Add fields to your Profile. At a minimum, be sure to add **Contacts > Phone > Primary > Phone** and one address field, such as **Contacts > City > Primary**. (I also included first and last name as fields)
1. Go to **Administer > Custom Data and Screens > Search Preferences**. Select the name of your test Profile from the drop down menu for the **Default Contact Search Profile** (roughly halfway down on the settings page).
1. Hover over **Search** on the navbar and click **Advanced Search**
1. Enter a phone number (or even just a number/partial number) and click **Search**
1. At this point, the user will receive an error that states `DB error: no such field`
Current behaviour
----------------------------------------
Instead of returning the results when a user searches by phone number when a non-default Search Profile includes at least one address field, the user receives an error message that the field does not exist. From the SQL displayed in the error message, this happens because the query does not include a statement to join on the address table, but references it in another join statement in the `ON` clause.
```
| Type | DB_Error |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Code | -19 |
| Message | DB Error: no such field |
| Mode | 16 |
| UserInfo | SELECT DISTINCT LEFT(contact_a.sort_name, 1) as sort_name FROM civicrm_contact contact_a LEFT JOIN civicrm_phone `1-phone-1` ON contact_a.id = `1-phone-1`.contact_id AND ( `1-phone-1`.phone_type_id = '1' OR `1-phone-1`.phone_type_id IS NULL ) AND ( `1-phone-1`.is_primary = 1 ) LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_location_type `1-location_type` ON ( ( `1-address`.location_type_id = `1-location_type`.id ) ) WHERE ( civicrm_phone.phone_numeric LIKE '%301%' ) AND ( 1 ) AND (contact_a.is_deleted = 0) [nativecode=1054 ** Unknown column '1-address.location_type_id' in 'on clause'] |
| DebugInfo | SELECT DISTINCT LEFT(contact_a.sort_name, 1) as sort_name FROM civicrm_contact contact_a LEFT JOIN civicrm_phone `1-phone-1` ON contact_a.id = `1-phone-1`.contact_id AND ( `1-phone-1`.phone_type_id = '1' OR `1-phone-1`.phone_type_id IS NULL ) AND ( `1-phone-1`.is_primary = 1 ) LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_location_type `1-location_type` ON ( ( `1-address`.location_type_id = `1-location_type`.id ) ) WHERE ( civicrm_phone.phone_numeric LIKE '%301%' ) AND ( 1 ) AND (contact_a.is_deleted = 0) [nativecode=1054 ** Unknown column '1-address.location_type_id' in 'on clause'] |
```
Expected behaviour
----------------------------------------
When a user searches by phone number via Advanced Search they should not receive an error and instead be directed to the results page of the search.
Environment information
----------------------------------------
* __CiviCRM:__ _Master/5.54.alpha1
Comments
----------------------------------------
[PR #24450](https://github.com/civicrm/civicrm-core/pull/24450) proposes a fix for this issuehttps://lab.civicrm.org/dev/core/-/issues/3835Proposal: Deprecate profile standalone listing mode2023-11-30T17:03:40ZJonGoldProposal: Deprecate profile standalone listing modeProfile standalone listing code is deeply entangled with the query BAOs, and produces weird and wonderful bugs like #3834.
I don't think they're widely used in modern CiviCRM, they seem to have been a stopgap before Views integration, a...Profile standalone listing code is deeply entangled with the query BAOs, and produces weird and wonderful bugs like #3834.
I don't think they're widely used in modern CiviCRM, they seem to have been a stopgap before Views integration, and later for non-Drupal users to get a Views-esque experience. But Search Kit has effectively replaced them - they have feature parity and then some.
I think we can improve the query code if we no longer needed to worry about standalone listing mode.
Proposal:
* Remove the ability to create standalone listings on new installations of CiviCRM.
* Create a check for profiles using standalone listing mode, warning admins if they use it.
We can deprecate this over a long period of time, so the impact should be gentle.
If this proposal is approved, we may also want to consider a function that converts profile listings to SK searches. This will have added utility as we deprecate other uses of profiles (e.g. once SK replaces Advanced Search, Search Profiles will go away).https://lab.civicrm.org/dev/core/-/issues/3833PHP 8.2 Dynamic Properties are deprecated2024-03-22T12:22:59ZBradley TaylorPHP 8.2 Dynamic Properties are deprecatedSee https://wiki.php.net/rfc/deprecate_dynamic_properties.
I see this as a big one, which could require a significant number of fixes for CiviCRM. The RFC has a good example showing what has changed:
```
class User {
public $name;
...See https://wiki.php.net/rfc/deprecate_dynamic_properties.
I see this as a big one, which could require a significant number of fixes for CiviCRM. The RFC has a good example showing what has changed:
```
class User {
public $name;
}
$user = new User;
// Assigns declared property User::$name.
$user->name = "foo";
// Oops, a typo:
$user->nane = "foo";
// PHP <= 8.1: Silently creates dynamic $user->nane property.
// PHP 8.2: Raises deprecation warning, still creates dynamic property.
// PHP 9.0: Throws Error exception.
```
There are many uses of dynamic properties in CiviCRM core which fall into multiple categories:
1. Known undeclared properties. For example `CRM_Activity_Form_Task_Batch` repeatedly references `$_fields` which should just be defined.
2. Dynamic properties. The main example of this is `CRM_Core_DAO`. PHP allows for this use-case by either extending `stdClass` or using the new ` #[AllowDynamicProperties]` attribute. Where possible we should prefer extending `stdClass` which is likely to have better long-term support (i.e. into the PHP 9.x series)
3. Typo's etc. Cases where the property is defined, but later referenced with a different name. These are easy; we just fix the typo (whilst ensuring we don't break any backwards compatiability for plugins using the wrong spelling)
I suggest CiviCRM developers should start to be made aware of this now, to avoid making the problem worse. Incrementally starting to fix the issue, a class or two at a time, seems like a good idea.
In many cases it's not clear why dynamic properties (or declared properties for that matter) are being used instead of a standard variable. This might be a good chance to start annotating properties as either:
- `@api`; designed to be used within hooks, on singletons etc by CiviCRM extensions
- `@internal`; not designed to be used by extensions, and liable to be removed without deprecation.https://lab.civicrm.org/dev/core/-/issues/3832PHP 8.2 utf8_encode and utf8_decode functions deprecated2024-01-11T18:31:16ZBradley TaylorPHP 8.2 utf8_encode and utf8_decode functions deprecatedIn PHP 8.2 (planned to be released this November) `utf8_encode` and `utf8_decode` functions will be deprecated.
https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode
I don't see this causing too many problems for CiviCRM, and mos...In PHP 8.2 (planned to be released this November) `utf8_encode` and `utf8_decode` functions will be deprecated.
https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode
I don't see this causing too many problems for CiviCRM, and most uses are in upstream packages and libraries. However there are some uses in core itself (especially `utf8_decode`) which should be replaced.