Skip to content

Conversation

@diggy128
Copy link

… when

creating new revision of page.

Fixes an issue where editing a document.page and changing name and/or summary (to create a new revision) also changes name and summary of the history_head.

draft_name and draft_summary are now computed fields (based on history_head) but have set the inverse without actually setting the value, to allow setting them when creating a new draft page.

The issue is prominently evident when using document_page_approval where the name/summary for the new draft also change the last approved version (aka history_head) which should not happen.

… when

creating new revision of page.

Fixes an issue where editing a document.page and changing name and/or summary
(to create a new revision) also changes name and summary of the history_head.

draft_name and draft_summary are now computed fields (based on history_head)
but have set the inverse without actually setting the value, to allow setting
them when creating a new draft page.

The issue is prominently evident when using document_page_approval where
the name/summary for the new draft also change the last approved version
(aka history_head) which should not happen.
@pedrobaeza pedrobaeza added this to the 18.0 milestone Dec 13, 2025
Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically makes sense

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But with this, you cannot change the head name and summary...

Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IT is not working....

If you write only one of the fields, the other are resetted...

@diggy128
Copy link
Author

But with this, you cannot change the head name and summary...

In fact you can, because we set inverse on the field (even though not doing anything about it in the inverse method).

If there is a history_head, then these are fetched along with content, otherwise they are kept empty.

This way we always have the correct name and summary from history head, but allows to change them if we change the content

@diggy128
Copy link
Author

IT is not working....

If you write only one of the fields, the other are resetted...

That is how I made it work.
When creating a new "version" of a document we should always set a new name and summary describing the changes.
So keeping the same name or summary when the content has changed is wrong.
If I've mistaken something about the usage of these fields let me know and I'll adapt the code.

However, especially in ISO certifications related documentation, having a document history with the same version and / or summary is wrong.
In our internal system, name is used just to increment a version number and summary to describe the changes made.
At some point we could add an analog to Semantic versions to history documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants