-
Notifications
You must be signed in to change notification settings - Fork 179
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
LUI-136 : trimm off unnecesasry characters from the converted input s… #103
base: master
Are you sure you want to change the base?
Conversation
@@ -236,7 +236,11 @@ | |||
* @param conceptId the id to look for | |||
* @return a {@link ConceptListItem} or null if conceptId is not found | |||
*/ | |||
public ConceptListItem getConcept(Integer conceptId) { |
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.
What is the reason behind changing from the integer conceptId to string phrase as the method parameter?
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.
the issue is that, the cause of the error was arising from the fact that the value to be taken as a conceptId here getConcept(Integer conceptId)
was in the form say "Concept #33" for id 33, "Concept #6" for id 6, "Concept #10" for id 10. hence say "Concept #66" couldnt be taken directly as an Integer conceptid ,thats why it was throwing the javascript error described in the ticket.
So i changed it from integer to string , so that the value eg "Concept #66" be recieved as a string , then i trimm off the "Concept #" to remain with a Numeric string "66" , and then i convert it back to a concept id .which worked fine and the Javascript error is no longer thrown
hello @dkayiwa , made a change in the PR, i think this is a better way |
@@ -76,6 +77,10 @@ | |||
|
|||
}) | |||
|
|||
function convert(conc){ |
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.
What is this function doing?
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.
it converts the string(concept object) eg "concept #12" to a numeric string (concept id) eg "12"
Ticket : https://issues.openmrs.org/browse/LUI-136
in this commit , i trimmed off unnecesary characters , so that the converted input value can remain a pure Numeric string that can be converted to a conceptId