How to preserve comments on document version update?

Hi,

I've noticed that, by default, nuxeo (5.4.2) doesn't store comments when updating the version of a document. Instead, any comment you enter in this field (in Modify/Edit tab) is always replaced by the text automatically generated by nuxeo when updating a document version. Comments are only stored by nuxeo when the document version keeps unchanged, as it can be seen in the History tab.

Can this behaviour be modified so that comments are stored even when the document version has been updated, be it minor or major?

Thanks

0 votes

1 answers

2536 views

ANSWER



Hi, If you want to store any comments that needs to be stored and can be editable, then go with custom metadata or use Nuxeo's widgets for that.

Add additional row in your file edit layout, and define the widget for Comments

<rows>
                <row>
                    <properties mode="any">
                        <property name="nxl_colspan_0">1</property>
                    </properties>
                    <widget>title</widget>
                </row>
</rows>
 <widget name="comment_widget" type="text">
        <labels>
                <label mode="any">Comments</label>
        </labels>
            <translated>false</translated>
            <fields>
                <field>your_schema:comment_type</field>
            </fields>
        _   <properties widgetMode="edit">
                <property name="required">true</property>
        </widget>

You can also refer my answer https://answers.nuxeo.com/general/q/053af67a59794e0887e8c75ca4d9a44c/How-to-add-custom-attributes-to-content for more info.

Kindly revert for clarifications.

0 votes