Mandatory revisions on ligne_comptable + cross-node history page

Every save now forces a new revision, unconditionally:
- Form: hide the "Create new revision" checkbox and the log message
  field (#access = FALSE, not just a default) so submitted values for
  either can't override them -- Form API discards user input for
  #access-denied elements and falls back to #default_value.
- hook_node_presave(): the same thing enforced for any save that
  doesn't go through the form (drush scripts, etc.), plus explicitly
  setting the revision author (current user) and revision timestamp.
  setNewRevision(TRUE) alone does NOT refresh revision_timestamp -- it
  carries over the previous revision's value, which would silently
  mislabel every edit with its predecessor's save time. Verified via a
  drush test save before/after.
- Applies regardless of figli_compta_ledger.skip_validation: that flag
  is about the répartition-sum check on historical imports, a
  different concern -- revision history is never exempted.

New /lignes/historique page (HistoryController): a single reverse-
chronological feed across every ligne_comptable's revisions, gated by
the 'view ligne_comptable revisions' permission (granted to all three
associate roles). Conceptually a revision of one ligne is a revision
of the grand livre as a whole, so this aggregates across nodes rather
than reusing Drupal's per-node revision history page. Each row links
to that specific revision via core's existing revision-view route.
Linked from the /lignes toolbar, shown only when the current user has
the permission.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-04 11:25:00 +02:00
co-authored by Claude Sonnet 5
parent 994c7c7aad
commit 384b283547
9 changed files with 147 additions and 3 deletions
+1
View File
@@ -16,3 +16,4 @@ permissions:
- 'create ligne_comptable content'
- 'delete any ligne_comptable content'
- 'edit any ligne_comptable content'
- 'view ligne_comptable revisions'
+1
View File
@@ -16,3 +16,4 @@ permissions:
- 'create ligne_comptable content'
- 'delete any ligne_comptable content'
- 'edit any ligne_comptable content'
- 'view ligne_comptable revisions'
+4
View File
@@ -2,7 +2,10 @@ uuid: 24f4e46d-c714-486d-b000-f092eb727470
langcode: en
status: true
dependencies:
config:
- node.type.ligne_comptable
module:
- node
- system
id: user
label: 'Utilisateur (lecture seule)'
@@ -10,3 +13,4 @@ weight: 4
is_admin: false
permissions:
- 'access content'
- 'view ligne_comptable revisions'