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#2066 Extract getSelectedIDs #18768

Merged
merged 1 commit into from
Oct 14, 2020
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 14, 2020

Overview

Minor extraction

Before

Repeated code

 foreach ($values as $name => $value) {
        if (substr($name, 0, CRM_Core_Form::CB_PREFIX_LEN) == CRM_Core_Form::CB_PREFIX) {
          $ids[] = substr($name, CRM_Core_Form::CB_PREFIX_LEN);
        }
      }

After

shared code $ids = $form->getSelectedIDs($values);

Technical Details

There are other classes with the same issues - just picked these 2 for now

Comments

@civibot
Copy link

civibot bot commented Oct 14, 2020

(Standard links)

@civibot civibot bot added the master label Oct 14, 2020
@mattwire mattwire merged commit 644d969 into civicrm:master Oct 14, 2020
@eileenmcnaughton eileenmcnaughton deleted the ids branch October 14, 2020 09:47
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Oct 14, 2020
This is an extension of civicrm#18768

I decided moving the IF into the function & making FALSE a return option was cleaner
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Oct 14, 2020
This is an extension of civicrm#18768

I decided moving the IF into the function & making FALSE a return option was cleaner
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.

2 participants