We're updating the issue view to help you get more done. 

When a patient is created through velocity unknown component adds a meaningless doc version

Description

Not sure if velocity is required, but this does not happen when a new patient is added through UI:

The velocity code is:

#set ($p = $services.patients.createNewPatient())
#set ($d = $xwiki.getDocument($p.document))
#set ($o = $d.getObject('PhenoTips.PatientClass'))
#set ($discard = $o.set('external_id', ...))
...
$d.save("modification X")

Running the code creates a patient, and patient's history has 3 versions:

1.1 is blank,
1.2 has all the changes the script is supposed to do and the comment is as expected ("modification X")
1.3 is identical to 1.2 and has no comments

Environment

None

Status

Assignee

Sergiu Dumitriu

Reporter

Andrew Misyura

Labels

None

External issue ID

1304

External issue ID

None

Priority

Medium