Making "Change Comment" field mandatory
We want to force users to add a revision comment when a file gets a new version, so we can see a summary at the history of that file. How can we make “Change Comment” field (at the “File Edit” window) as mandatory to force users to write revision comments?
You can override the “document_edit.xhtml” template and make the textarea mandatory by adding the property required=“true” to it.
I have changed the related line as you said; <h:inputTextarea value="#{currentDocument.contextData['request/comment']}" required="true" />
That worked, "Save" button doesn't allow me to make a version increment without adding a comment. But there is no sign about this field is mandatory and if you click "Save", no information about the reason of failure. I was thinking a change like a red * icon too as "Title" field has. I have to give at least one of them to users (red * or information about that field is mandatory).
Another thing is; my edit is not permanent, whenever I restart/force-reload the nuxeo server, the line returns to it's previous version.
And changes to xhtml files are not persisted: you have to override this template in your own plugin.