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

Foreign key constraint violation on ConceptWord when removing a concept name - TRUNK-3690 #236

Merged
merged 1 commit into from Apr 30, 2013

Conversation

wluyima
Copy link
Member

@wluyima wluyima commented Mar 1, 2013

@@ -52,9 +54,9 @@ public void before_shouldNotifyListenersAboutCheckedPrivileges() {
Context.getConceptService().saveConcept(concept);

Assert.assertArrayEquals("listener 1 save concept: " + listener1.hasPrivileges.toString(), new String[] {
"Manage Concepts", "Get Concepts", "Get Observations", "Get Concepts" }, listener1.hasPrivileges.toArray());
Copy link
Member Author

Choose a reason for hiding this comment

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

These were duplicated because the validator was getting called twice which calls conceptService.getConceptByName each time to get duplicates, so removing the second invocation of it reduced it to 1 and changing the collectiion type from list to set

dkayiwa added a commit that referenced this pull request Apr 30, 2013
Foreign key constraint violation on ConceptWord when removing a concept name - TRUNK-3690
@dkayiwa dkayiwa merged commit 68ca307 into openmrs:master Apr 30, 2013
@wluyima
Copy link
Member Author

wluyima commented Apr 30, 2013

Right, but a LinkedHashSet is a special Set implementation that also maintains insertion order

new ConceptValidator().validate(concept, errors);
if (errors.hasErrors())
throw new APIException("Validation errors found: " + errors.getAllErrors());

Copy link
Member Author

Choose a reason for hiding this comment

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

Am not really getting rid of the validation, in the comment above i mentioned that there changes in core that were made where validators are invoked before saving an object, so it is already done at this point

RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants