Unable to modify/edit a Program from OpenMRS

We notice a problem while editing program - [TRUNK-5120] - OpenMRS Issues.

We tried fixing the problem in this commit, but this does not fix the problem. The solution seems to undo the change made to Program.java as part of this commit. So, now the setAllWorkflows of Program class will look like

public void setAllWorkflows(Set<ProgramWorkflow> allWorkflows) {      this.allWorkflows = allWorkflows; }

Any thoughts on if this is the correct way to fix this problem?
@dkayiwa @darius

@dkayiwa, looking at the history of TRUNK-4659

It seems that nobody ever asked to change the setters for many of these properties, but we decided to do it preemptively here.

Do you know if we ever replicated Denise Draper’s original bug report?

I can replicate the bug from TRUNK-5120 on qa-refapp, i.e. it’s a problem on the head of our latest openmrs-core release line. So at a minimum we should revert the change to Program.setWorkflows.

Then we should manually test the other changes made as part of this ticket via the UI, to ensure they haven’t broken other functionality, and revert them if necessary.

What do you think?

PS- Also TRUNK-4659 had code committed without being closed, and without having a fixVersion set, but it’s actually part of the Platform 2.0.0 release.

What’s the purpose of the @AllowDirectAccess annotation? It’s only used in 5 attributes (in core), and by the RequiredDataAdvice class. It would be simpler to get rid of the annotation and have getters/setters.

For instance, Concept has 6 collections (names, answers, conceptSets, descriptions, conceptMappings and attributes) but only names and answers are annotated.

Answering myself, I was responsible of this change https://issues.openmrs.org/browse/TRUNK-3179 But honestly I don’t understand the need of it.

Looks like a good strategy.

Since it it reverting to the original code, it looks correct.

@sumanmaity112, can you send a PR for this (at least the Program.setAllWorkflows one, which I know you tested)?

Raised a new pull request. PR link: https://github.com/openmrs/openmrs-core/pull/2132