Development issueshttps://lab.civicrm.org/groups/dev/-/issues2024-03-15T13:24:20Zhttps://lab.civicrm.org/dev/core/-/issues/4858Contact id quicksearch broken2024-03-15T13:24:20ZAndy ClarkContact id quicksearch brokenContact id quicksearch has broken in 5.67.3, albeit occasionally. User cannot locate any contacts by id at all, and using Drupal 'masquerade I verified this to be the case. The fix was to run the 'Cleanup Caches' option. What may be a...Contact id quicksearch has broken in 5.67.3, albeit occasionally. User cannot locate any contacts by id at all, and using Drupal 'masquerade I verified this to be the case. The fix was to run the 'Cleanup Caches' option. What may be a clue is that this system uses ACLs and although this user would have been restricted by ACLs she would have had access to the contacts she was searching for. As an administrator I could see the contacts when she couldn't which does seem to point to ACLs as the problem.https://lab.civicrm.org/dev/core/-/issues/4847Activity-based SearchKit results for 'restricted' users (via the Related Perm...2024-02-08T21:01:05ZpetednzActivity-based SearchKit results for 'restricted' users (via the Related Permissions Module) are no longer restricting results to only Activities of Contacts the user has access tohttps://chat.civicrm.org/civicrm/pl/wj4t3rrh7ir5uyz7t88c7fuj8o
We are using the "Related Permissions Module" https://civicrm.org/extensions/relationship-permissions-acls
Beyond that all we are doing is
- use relationship A to join X (...https://chat.civicrm.org/civicrm/pl/wj4t3rrh7ir5uyz7t88c7fuj8o
We are using the "Related Permissions Module" https://civicrm.org/extensions/relationship-permissions-acls
Beyond that all we are doing is
- use relationship A to join X (teacher) to Y (school)
- use relationship B to join Y (school) to Z (student)
- give X necessary permissions to see All Activities but not see All Contacts.
This means that in pure civicrm when X logs in they only see their Students and the relevant Activities.
- Add an SK to show My Contacts and confirm that X only sees their Students - PASS
- Add an SK to show My Activities (I can export but it is super simple) and confirm that X only sees Activities where their Students are the Target - FAIL - they now see all Students with specified Activity
This was the query from the above which worked up till last week when we ran a civi upgrade.
```
SELECT a.id AS id, a.subject AS subject, a.activity_type_id AS activity_type_id:label, Activity_ActivityContact_Contact_01.sort_name AS Activity_ActivityContact_Contact_01.sort_name, Activity_ActivityContact_Contact_01.id AS Activity_ActivityContact_Contact_01.id
FROM civicrm_activity a
INNER JOIN (civicrm_activity_contact Activity_ActivityContact_Contact_01_via_activitycontact INNER JOIN civicrm_contact Activity_ActivityContact_Contact_01 ON (Activity_ActivityContact_Contact_01_via_activitycontact.contact_id = Activity_ActivityContact_Contact_01.id)) ON Activity_ActivityContact_Contact_01_via_activitycontact.record_type_id = "3" AND Activity_ActivityContact_Contact_01_via_activitycontact.activity_id = a.id
LEFT JOIN civicrm_value_attendance_record_15 Attendance_record_1 ON a.id = Attendance_record_1.entity_id
WHERE (a.activity_type_id = "51")
AND (Attendance_record_1.week_commencing_124 BETWEEN "20231203" AND "20231209")
AND (a.is_test = "0")
AND (a.is_deleted = "0")
```colemanwcolemanwhttps://lab.civicrm.org/dev/core/-/issues/4625Inconsistent search result when "Modified By" field and apply an action2023-09-26T12:28:52Zthomas_SYSTOPIAInconsistent search result when "Modified By" field and apply an action**Description:**
When apply an action (like "Tag - add to contacts") on a search result using "Change Log->Modified By" field the result scope is lost. Instead the action would be applied to all contacts.
**Steps to reproduce** (tested...**Description:**
When apply an action (like "Tag - add to contacts") on a search result using "Change Log->Modified By" field the result scope is lost. Instead the action would be applied to all contacts.
**Steps to reproduce** (tested on https://d9-master.demo.civicrm.org/):
1. Use the advanced search form with "Change Log->Modified By" = _admin_. The result includes exactly one contact.
2. Choose "Tag - add to contacts" from the action menu.
3. You'll see "Number of selected contacts: 204" (204 are the sum of all contacts.)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/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/4075Profile used for search results: contact type field shows internal name inste...2023-01-12T10:01:14Zaydunsaidan.saunders@squiffle.ukProfile used for search results: contact type field shows internal name instead of labelOverview
----------------------------------------
If you create a profile to use for search results from simple or advanced search and include the contact subtype, the value shown is the internal name, not the label.
Reproduction steps...Overview
----------------------------------------
If you create a profile to use for search results from simple or advanced search and include the contact subtype, the value shown is the internal name, not the label.
Reproduction steps
----------------------------------------
1. At `Administer > Customise Data and Screens > Contact Types` create a type as 'My new type'
1. Edit the name to be 'My changed type'
1. Create/Update a contact to use the type just created
1. At `Administer > Customise Data and Screens > Profiles` create a profile, tick 'Search Views', add `Contact > Contact Subtype` as a field
1. Go to `Search > Advanced Search, set 'Views for Display Contacts' to the profile just created. Do a search that includes the contact you created/updated
Current behaviour
----------------------------------------
The type shows as `My_new_type`
Expected behaviour
----------------------------------------
The type should show as `My changed type`
Environment information
----------------------------------------
* __CiviCRM:__ _5.57.0_ ... but maybe much earlier too.
Comments
----------------------------------------
Note that renaming the type shows the problem more clearly, but even without that, if the subtype was created with a name including a space it will show with an underscore instead of the space.https://lab.civicrm.org/dev/core/-/issues/4056Replace hard-coded call to legacyCustomSearch framework with a hook2023-06-25T18:31:24ZeileenReplace hard-coded call to legacyCustomSearch framework with a hookWe should get the legacy custom search frame work out of our `GroupContactCache` BAO and eventually out of core code (and unhide the extension, with a view to not shipping enabled).
In order to do this I think we need a hook to get the ...We should get the legacy custom search frame work out of our `GroupContactCache` BAO and eventually out of core code (and unhide the extension, with a view to not shipping enabled).
In order to do this I think we need a hook to get the sql when loading a contact group
![image](/uploads/9ca4de13d7127a957e988ccea1a5c43b/image.png)
It might potentially wind up like this
![image](/uploads/6eebfb49b84cb35210c17de5a7eaf5e2/image.png)
I see there is handling for the sql being empty - which seems weird - but we could probably assume that if anything ever needs no sql it is not a custom search
Note that `CRM_Contact_BAO_SearchCustom` could be moved to the extension with the hook once as part of this as nothing else calls it
The other place where the legacy custom search framework returns sql is
![image](/uploads/e99dfdf4ba2fb66ac6e78c9f1cffc3b6/image.png)
Internally the first query calls the same `contactIDs`
![image](/uploads/88c6ff1481188c0f666b6309cb01b25b/image.png)
@colemanw @seamuslee @DaveDhttps://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/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/3735Can't search contact with only number2023-04-01T16:27:00ZPradeep Nayakpradpnayak@gmail.comCan't search contact with only numberContact search by number has stopped working for a few sites, when searching by only number the system searches by id rather than display/sort name. The system has an external identifier attached to sort/display name which helps the staf...Contact search by number has stopped working for a few sites, when searching by only number the system searches by id rather than display/sort name. The system has an external identifier attached to sort/display name which helps the staff to search the contact based on their old legacy number or by contact name. I can see there has been a [recent change](https://github.com/civicrm/civicrm-core/pull/23609) in Civi which would allow doing a search if the number starts with 0 but it is not the case here.
Is it right to say that force search by id should be a config setting which can be turned off on some systems either via UI or in civicrm.settings.php?5.57.0https://lab.civicrm.org/dev/core/-/issues/3718Profile listings fail to show email addresses when their location type Name d...2024-03-09T05:03:24ZspalmstromProfile listings fail to show email addresses when their location type Name differs from its Display NameOverview
----------------------------------------
If you create a location type and have different Names and Display Names, then a profile listing uses it fails to display the data.
Reproduction steps
-----------------------------------...Overview
----------------------------------------
If you create a location type and have different Names and Display Names, then a profile listing uses it fails to display the data.
Reproduction steps
----------------------------------------
1. Create a new location type with Name say TestingTesting and Display Name 'Testing Testing'.
2. Create a listing profile to display that location type.
3. Assign an email address of that type to a user.
4. Use the profile to display that user.
Current behaviour
----------------------------------------
Erik Adams detail viewed:
![image](/uploads/f1cda7c22218f4983bad7b1afadbeec6/image.png)
The email address does not show in the listing:
![image](/uploads/bacb9d89a6156a1504a64b7781be4838/image.png)
Expected behaviour
----------------------------------------
_What should happen._
![image](/uploads/c08545abfca4db63e1e3143ac52698b6/image.png)
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __Browser:__ _MS Edge_ but probably not relevant
* __CiviCRM:__ _ 5.52.alpha1._ It is the Demo system<!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP__ _Whatever Demo is running_
* __CMS:__ _Drupal 9_ the version Demo is running.
* __Database:__ _Whatever Demo is running_.
* __Web Server:__ _Whatever runs Demo_
Comments
----------------------------------------
I have spent a few hours attempting to debug on a local system, but haven't been able to discover where the SELECT statement is being created. What appears to be happening is that the SELECT statement is has the Name of the Location Type as a column, whilst the Profile is expecting the Display Name, so when they don't match, the latter displays nothing.
You should note that if the Name is say Testing_Testing and the Display Name is 'Testing Testing', that the data are displayed. This is because somewhere in the Profile display spaces are replaced by underscores. It is how I was able to obtain the expected behaviour.
I am flagging this up in the hope that someone with more expertise than I can more easily identify where the solution lies.https://lab.civicrm.org/dev/core/-/issues/3495Sorting/paging Advanced Search results corrupts search criteria2022-06-16T05:07:08ZBobSSorting/paging Advanced Search results corrupts search criteriaOverview
----------------------------------------
Certain search criteria fields in Advanced Search which have an implied LIKE operator are corrupted upon sorting by clicking on a column or by advancing to a different page in the results...Overview
----------------------------------------
Certain search criteria fields in Advanced Search which have an implied LIKE operator are corrupted upon sorting by clicking on a column or by advancing to a different page in the results.
Two such fields are:
Contribution Source
Case Subject
Others fields, such as Contact Name, do not exhibit this problem.
Reproduction steps
----------------------------------------
1. Login to https://dmaster.demo.civicrm.org
1. Search | Advanced Search
1. Display results as: Contributions
1. Contribution | Contribution Source = "p"
1. Click Search
1. Note 59 results, displayed search criteria includes "Contribution Source Like %p%"
1. Click the City column heading (or any other column heading), or display page 2 of the results.
Current behaviour
----------------------------------------
There are now 108 results, and the displayed search criteria includes "Contribution Source Like %%"
Expected behaviour
----------------------------------------
The search criteria should not be affected by sorting or paging the results.
Environment information
----------------------------------------
* __Browser:__ _Chrome/102.0.5005.63_
* __CiviCRM:__ _5.50.0_
* __PHP:__ _7.4.29_
* __CMS:__ _Drupal 7.88_
* __Database:__ _MariaDB 10.4.13_
* __Web Server:__ _Apache 2.4.43_
Comments
----------------------------------------
Problem traced to /CRM/Core/Form/Search.php:convertTextStringsToUseLikeOperator() calling trim() on $this->_formValues[$fieldName]. That variable, in the affected cases, is an array rather than a string, e.g. ['LIKE' => 'search_value'].5.52.0https://lab.civicrm.org/dev/core/-/issues/3157Search Builder is gone2022-04-04T15:25:16ZjaapjansmaSearch Builder is goneThe menu item to Search Builder is gone from CiviCRM core.
When navigating in https://dmaster.demo.civicrm.or/civicrm/contact/search/builder?reset=1 it is displayed.
In CiviCRM 5.47.2 the menu item was still available.The menu item to Search Builder is gone from CiviCRM core.
When navigating in https://dmaster.demo.civicrm.or/civicrm/contact/search/builder?reset=1 it is displayed.
In CiviCRM 5.47.2 the menu item was still available.https://lab.civicrm.org/dev/core/-/issues/3140Search for petition activities returns extraneous results2023-12-08T05:03:26ZBobSSearch for petition activities returns extraneous resultsOverview
----------------------------------------
When searching for petition activities in Advanced Search or Activities Search, selecting only a particular petition returns extraneous activities which are not of type Petition.
The ext...Overview
----------------------------------------
When searching for petition activities in Advanced Search or Activities Search, selecting only a particular petition returns extraneous activities which are not of type Petition.
The extraneous activities have the same id number as the petition specified in the search criteria, but they include other activity types, e.g. Contribution, Membership signup, Event Registration.
Reproduction steps
----------------------------------------
1. Go to https://dmaster.demo.civicrm.org
1. Create a petition.
1. Click Search | Find Activities
1. In the Survey/Petition dropdown, select the newly created petition .
1. Click Search
Current behaviour
----------------------------------------
The results include a Contribution, a Membership signup, and an Event Registration.
Expected behaviour
----------------------------------------
The results should include only activities for the specified petition.
Environment information
----------------------------------------
* __CiviCRM:__ _5.49.alpha1._
Comments
----------------------------------------
When searching for Activities, the bug is fairly obvious by a casual inspection of the results table.
When searching for Contacts in Advanced Search, the bug is far more insidious.
While very useful, the very existence of the Survey/Petition dropdown creates an inconsistency or ambiguity in the UI. Given that the search conditions specified by each control are generally ANDed, but the Survey/Petition dropdown is really a subset of the Activity Type dropdown, it's not clear what results should be expected in the case of selecting, for example, Activity Type = "Contribution" along with a specific survey/petition. Do we want this to be an unwritten exception to the rule in which the criteria is ORed instead of ANDed? If the answer is no, then I think the best solution would be to disable the Survey/Petition dropdown unless Activity Type specifies exactly either Petition or Survey. In that case the Petition/Survey box should be enabled and display either Petitions or Surveys. Making this change to the UI provides two benefits:
* Avoids ambiguity in the expected results.
* Produces the expected search results without having to modify the search logic.
An alternative solution would be to leave the UI as is, and modify the search logic to consider the implied Activity Type when selecting an item from the Survey/Petition dropdown. This provides more flexibility when searching, as it would (should?) support ORing additional activity types. While this creates an inconsistency in the UI rules, it is arguably an "intuitive" inconsistency.https://lab.civicrm.org/dev/core/-/issues/3051Getting error when using custom searches2023-02-06T05:42:27ZErikHommelGetting error when using custom searchesOverview
----------------------------------------
When using a custom search (including most of the ones shipped with core but also ones in extensions) I can not select a single row and get this error:
```
User deprecated function: Depr...Overview
----------------------------------------
When using a custom search (including most of the ones shipped with core but also ones in extensions) I can not select a single row and get this error:
```
User deprecated function: Deprecated function CRM_Contact_Selector::fillupPrevNextCache,
use Custom searches should return sql capable of filling the prevnext cache..
in CRM_Core_Error::deprecatedFunctionWarning()
(regel 1044 van /var/www/html/speeltuin/sites/all/modules/civicrm/CRM/Core/Error.php).
```
Investigation shows that the error originates from the `fillWithSql` function in `CRM_Core_PrevNextCache_Sql`. This does not work in combination with the `count()` function in most custom searches. This means the next prev cache is not filled nor does the select option work.
Tested with 5.41.1 and replicated on dmaster.
Reproduction steps
----------------------------------------
1. Click on **Search>Custom Searches** and select Zip Code Range from the list
1. Select 1 as from and 9999 to search for the range
Current behaviour
----------------------------------------
* This error is one in the list of errors:
```
User deprecated function: Deprecated function CRM_Contact_Selector::fillupPrevNextCache,
use Custom searches should return sql capable of filling the prevnext cache..
in CRM_Core_Error::deprecatedFunctionWarning()
(line 1043 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Error.php).
```
* Try to select a single line, only selecting all rows will work
Expected behaviour
----------------------------------------
I should be able to select a single row or a couple of rows and perform actions on the selected ones
Environment information
----------------------------------------
* __Browser:__ _Firefox 95.0 (Linux Mint)
* __CiviCRM:__ _Master/5.41.1
* __PHP:__ _7.3__
* __CMS:__ _Drupal 7.81_
* __Database:__ _MySQL 5.7.7
* __Web Server:__ _Apache 2.4
Comments
----------------------------------------
Although custom searches are slowly being faded out this error breaks existing functionality so I think it is a regression? I think it certainly makes sense to remove the custom searches from future versions and encourage the usage of SearchKit. There are however quite a few extensions out there that use Custom Searches, and the Developer Guide still explains the civix _generate:search_. So I think this should be fixed AND the Developer Guide should be updated with instructions how we actually now want the PrevNext filled and used?
Happy to update the Developer Guide if someone can explain me what is required for the PrevNext new style?https://lab.civicrm.org/dev/core/-/issues/3048Fatal error thrown in Contributions made in Year X and not Year Y custom search2023-11-19T05:03:26ZyashodhaFatal error thrown in Contributions made in Year X and not Year Y custom searchSteps to replicate :
--------------------
- Go to custom search _Contributions made in Year X and not Year Y_
- Enter _Inclusion Date One: Start/End_ and check _First time donor only?_
![demo_cus](/uploads/b03569e02aff60038ac9b4451e52...Steps to replicate :
--------------------
- Go to custom search _Contributions made in Year X and not Year Y_
- Enter _Inclusion Date One: Start/End_ and check _First time donor only?_
![demo_cus](/uploads/b03569e02aff60038ac9b4451e52be74/demo_cus.png)
- Search throws a fatal error
![dmater_error](/uploads/1607d514d535855ec6cfdd24aeadb335/dmater_error.png)
`| DebugInfo | REPLACE INTO civicrm_tmp_e_dflt_b78e21a09342a815fe62cebabffd98d6 SELECT DISTINCT contact_id AS contact_id FROM civicrm_contribution c WHERE c.is_test = 0 AND c.is_template = 0 AND c.receive_date < 2021-01-01 [nativecode=1292 ** Incorrect datetime value: '2019' for column `dmastercivi_g5lis`.`civicrm_contribution`.`receive_date` at row 1]`https://lab.civicrm.org/dev/core/-/issues/3015Undefined Index2023-11-03T05:03:19ZJoeMurrayUndefined IndexOverview
----------------------------------------
_Update multiple participants caused undefined index error on dmaster._
Reproduction steps
----------------------------------------
1. Create custom alphanumeric field for participants,...Overview
----------------------------------------
_Update multiple participants caused undefined index error on dmaster._
Reproduction steps
----------------------------------------
1. Create custom alphanumeric field for participants, eg add Idea to Food Preference custom field set on dmaster.
1. Create profile with just this new field, eg test.
1. Find all participants, select a couple, then choose Update multiple participants search results action.
1. Select profile created above. Click continue.
1. See Notice: Undefined index: size in CRM_Event_Form_Task_Batch->buildQuickForm() (line 108 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Event/Form/Task/Batch.php).
1. Note that the Idea field has a column but there is no field provided to enter data.
Current behaviour
----------------------------------------
![2022-01-03_11-51-42](/uploads/3b007e3aa61eb2b3cc00bd3d10e36360/2022-01-03_11-51-42.png)
Expected behaviour
----------------------------------------
No error. Ability to enter / edit data in Idea field.
Environment information
----------------------------------------
dmaster on mac chrome.EdselopezEdselopez2022-01-05https://lab.civicrm.org/dev/core/-/issues/3005DB Error on smart group with form values stored as html entities2023-11-04T05:03:20ZjitendraDB Error on smart group with form values stored as html entitiesWe're encountering DB errors on some sites for those who have smart group form values stored as `&lt;` or `&gt;`.
It seems these smart groups were created using search builder with >, < as the operator. Eg payment with amount < 30, etc....We're encountering DB errors on some sites for those who have smart group form values stored as `<` or `>`.
It seems these smart groups were created using search builder with >, < as the operator. Eg payment with amount < 30, etc.
To replicate, probably just try hitting `Update Smart Group Counts` button on Manage group page. It errors if form_values has any saved_search entry with `<` or `>` in it.
````
SELECT * FROM `civicrm_saved_search` WHERE `form_values` LIKE '%<%' OR `form_values` LIKE '%>%';
````
If i try creating a new smart group using the operator, it correctly decodes the value before storing it in the database, so probably it just affects the existing groups.
Approach to fix:
- Replace these characters while retrieving the SQL for group contact cache - https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/BAO/GroupContactCache.php#L633 -
return str_replace(['<', '>'], ['<', '>'], "$select {$sqlParts['from']} {$sqlParts['where']} {$sqlParts['group_by']} {$sqlParts['having']}");
Might be Related - https://lab.civicrm.org/dev/core/-/issues/1328 & https://github.com/civicrm/civicrm-core/pull/21556https://lab.civicrm.org/dev/core/-/issues/2997Search Builder (not Search Kit): groups not searched correctly2023-11-01T05:03:24Zaydunsaidan.saunders@squiffle.ukSearch Builder (not Search Kit): groups not searched correctlyOverview
----------------------------------------
In Search Builder, searching for both 'in group' and 'not in group' produces incorrect results.
As [reported in SE](https://civicrm.stackexchange.com/questions/40893/search-builder-fails...Overview
----------------------------------------
In Search Builder, searching for both 'in group' and 'not in group' produces incorrect results.
As [reported in SE](https://civicrm.stackexchange.com/questions/40893/search-builder-fails-in-group-and-not-in-group-search).
![Screenshot_from_2021-12-17_11-18-41](/uploads/10a879d4a29aa0ec727f2ff47c1527e2/Screenshot_from_2021-12-17_11-18-41.png)
NB: this is handled correctly in Search Kit and I doubt anyone will want to put effort into fixing this in Search Builder.
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __CiviCRM:__ _Master (5.46.alpha1)_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->https://lab.civicrm.org/dev/core/-/issues/2979Proposal to remove the limit of 15 max values for multiple values can also be...2021-12-09T16:28:04ZyashodhaProposal to remove the limit of 15 max values for multiple values can also be retrieved from url in reportsWe send the parameters as string so that multiple values can also be retrieved from url in reports
for e.g url like - "memtype_in=in&memtype_value=1,2,3
However, there is a restriction for 15 values esp when you search for activity type...We send the parameters as string so that multiple values can also be retrieved from url in reports
for e.g url like - "memtype_in=in&memtype_value=1,2,3
However, there is a restriction for 15 values esp when you search for activity types which can be numerous. In this this case, if the values exceeds 15 the criteria are not respected.
Proposal to remove the limit of 15 max values.
https://github.com/civicrm/civicrm-core/blob/master/CRM/Report/Utils/Get.php#L1735.46.0yashodhayashodha