Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4884

Concept.toString returns empty string for new concept - fails in validation error for concept attributes(in dev)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: Platform 2.0.1
    • Fix Version/s: Platform 2.0.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      We are developing concept attributes feature in openmrs and got hit with a problem in adding concept attributes while creating new concept. So, on saving concept attributes, it checks whether the owner is not null.
      Code here: https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/validator/BaseAttributeValidator.java#L41
      `rejectIfEmpty` checks if owner is null or owner.toString is empty.
      Since Concept.toString returns empty, it fails.
      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/Concept.java#L1446

      In other cases like Location or Provider or Visit, it never returns empty string.
      Is it okay to return something like "Concept: # conceptId" as we do in Visit.java or is there any dependency of toString in some other places?

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  aksareen Ashish Sareen
                  Reporter:
                  preethi.s Preethi S
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: