Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core#2979) remove the limit of 15 max values for multiple values… #22214

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

yashodha
Copy link
Contributor

@yashodha yashodha commented Dec 6, 2021

… can also be retrieved from url in reports

Overview

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#L173

Before

params not respected if values exceed 15

After

values till 20 are respected.

Comments

Let me know if the max value is agreeable. It's especially for activity types as we already have a number of activity types that CiviCRM ships with.

@civibot
Copy link

civibot bot commented Dec 6, 2021

(Standard links)

@civibot civibot bot added the master label Dec 6, 2021
@demeritcowboy
Copy link
Contributor

Any idea why it's 15? I don't see anything in this history that explains it. Is there a reason not to just remove the limit completely?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

if (!preg_match('/^(\d+)(,\d+){0,14}$/', $value)) {

//change the max value to 20, ideally remove condition
if (!preg_match('/^(\d+)(,\d+){0,20}$/', $value)) {
// extra check. Also put a limit of 15 max values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yashodha should remove this comment as well then

@yashodha
Copy link
Contributor Author

yashodha commented Dec 7, 2021

@demeritcowboy Yes, ideally no need to keep a max limit. We might be better off removing this condition. This will just result in not respecting the criteria as the value is set to null when the limit is exceeded.

@demeritcowboy
Copy link
Contributor

Maybe there should be some limit to prevent some potential denial of service problem. Anyway I don't have any objections, was just wondering if there was some reason for it being "15". Do you want to remove the comment at line 176?

@yashodha yashodha force-pushed the dev-2979 branch 2 times, most recently from b390cc1 to 7e875c8 Compare December 9, 2021 06:04
@yashodha
Copy link
Contributor Author

yashodha commented Dec 9, 2021

test this please

@demeritcowboy demeritcowboy merged commit c46601a into civicrm:master Dec 9, 2021
@yashodha
Copy link
Contributor Author

@demeritcowboy Thanks for merging this!

yashodha referenced this pull request in cividesk/civicrm-core May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants