-
Notifications
You must be signed in to change notification settings - Fork 20
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
COH-55: Changed Boolean Conversion Code #32
Conversation
Hello @dkayiwa Requesting an initial review of the changes made |
Thank you @WodPachua for the fix. Are you in position to ensure this works by testing if the purge works. You could use postman for this |
@@ -134,7 +134,7 @@ public CohortMember getByUniqueId(String uuid) { | |||
|
|||
@Override | |||
public void purge(CohortMember cohortMember, RequestContext context) throws ResponseException { | |||
boolean purge = Boolean.getBoolean(context.getParameter("purge")); | |||
boolean purge = Boolean.parseBoolean(context.getParameter("purge")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix should be much simpler: just unconditionally call purgeCohortMember
. The framework already handles the purge=true
bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, okay, let me fix that. Thanks @ibacher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me find out how to do this also. Thank you @reagan-meant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you manually test the changes?
@@ -134,12 +134,7 @@ public CohortMember getByUniqueId(String uuid) { | |||
|
|||
@Override | |||
public void purge(CohortMember cohortMember, RequestContext context) throws ResponseException { | |||
boolean purge = Boolean.getBoolean(context.getParameter("purge")); | |||
if (purge) { | |||
Context.getService(CohortMemberService.class).purgeCohortMember(cohortMember); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be formatted so this is no longer indented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sure @ibacher . Though after testing, manually with postman & the legacy UI Webservices Test page for REST URIs, its returns a "success" response but still does the normal delete and the cohort member remains in the database. Have tried tracing the code flow and can't seem to figure out why it still isn't purging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that seems to mean either:
purge()
isn't getting calledpurgeCohortMember()
isn't callingdelete()
Can you show what you tested in Postman?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @ibacher , any further assistance on this? Seems am stuck how to move this forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WodPachua Sorry, I missed this. When you do that via Postman, is the member deleted? More exactly, I'm not completely sure that that Testing REST URIs works with query parameters...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ibacher Yes, the delete is successful, at least the database shows so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I think unindent the code, so that it's formatted correctly and we can merge this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright @ibacher , I have fixed that.
@wikumChamith Have done so, created a cohort(s) with members, but seems the purge isn't still being effected. Still trying to figure out why... |
https://issues.openmrs.org/browse/COH-55