-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Support saving more than 25 records in Profile.submit api #20744
Merged
monishdeb
merged 1 commit into
civicrm:master
from
deb1990:RSESPRT-64-fix-profile-submit-api
Jul 1, 2021
Merged
Support saving more than 25 records in Profile.submit api #20744
monishdeb
merged 1 commit into
civicrm:master
from
deb1990:RSESPRT-64-fix-profile-submit-api
Jul 1, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Standard links)
|
deb1990
changed the title
RSESPRT-64: Support saving more than 25 records in Profile.submit api
Support saving more than 25 records in Profile.submit api
Jul 1, 2021
Makes sense. @deb1990 are you still working on this PR? |
@deb1990 No, its ready for review now. |
Cool. Tested on local, looks good. Merging now. |
deb1990
added a commit
to compucorp/civicrm-core
that referenced
this pull request
Jul 5, 2021
Included in CiviCRM 5.40.0 PR: civicrm#20744
deb1990
added a commit
to compucorp/civicrm-core
that referenced
this pull request
Jul 5, 2021
Included in CiviCRM 5.40.0 PR: civicrm#20744
erawat
pushed a commit
to compucorp/civicrm-core
that referenced
this pull request
Sep 14, 2021
Included in CiviCRM 5.40.0 PR: civicrm#20744
erawat
pushed a commit
to compucorp/civicrm-core
that referenced
this pull request
Sep 14, 2021
Included in CiviCRM 5.40.0 PR: civicrm#20744
erawat
pushed a commit
to compucorp/civicrm-core
that referenced
this pull request
Sep 14, 2021
Included in CiviCRM 5.40.0 PR: civicrm#20744
erawat
pushed a commit
to compucorp/civicrm-core
that referenced
this pull request
Sep 14, 2021
Included in CiviCRM 5.40.0 PR: civicrm#20744
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
When we try to Save more than 25 records using
Profile.submit
api, only 25 records gets saved. This PR fixes that.Before
Profile.Submit
only saves 25 records.After
Profile.Submit
saves all records.Technical Details
While submitting Profile values, using
Profile.submit
, the following line gets called, which fetches the fields for current profile.https://github.com/civicrm/civicrm-core/blob/master/api/v3/Profile.php#L162
Now, internally the
_civicrm_api3_buildprofile_submitfields
function gets called, which fetchesuf_field
using https://github.com/civicrm/civicrm-core/blob/master/api/v3/Profile.php#L503. Aslimit: 0
is not mentioned here, only the first 25 records get returned. Thats why, all the records sent inProfile.submit
does not get saved.To fix this, the same line has been changed to
$fields = civicrm_api3('uf_field', 'get', ['uf_group_id' => $profileID, 'options' => ['limit' => 0]]);
.Another alternative would be, to send the limit parameter in
Profile.submit
api call itself, but as it is a "Create" api call, and we do not need to send limit parameter for other "Create" api calls in CiviCRM, its best that we do the same in this case also, to keep consistency.