Affects Version/s: 4.0.1
Fix Version/s: 4.0.3
Processed by team:Platform
Sprint:Platform Sprint 138
The NodeUpdaterService is used by the CMS to ensure document (by node type) are updated on first usage. This allows lenient updating of document on first usage.
However the NodeUpdateVisitor (with matching property hipposys:nodetype) when invoked from the NodeUpdaterService should execute with a node retrieved by a system session, the same as when executing the NodeUpdateVisitor through the UpdaterExecutor.
Likewise, after successful execution the (possibly) update session state should be persisted.
With earlier defined NodeUpdateVisitor scripts (like the v7.9 HardHandleUpdateVisitor), this logic was 'embedded' in the NodeUpdateVisitor itself, therefore the omssion of (forced) doing this wasn't detected before.
However, requiring to take care of this logic from within the NodeUpdateVisitor is non-transparent and undesirable from performance POV, as it requires a direct session save on every #doUpdate(Node) execution. This would seriously degrade the performance when executing the same NodeUpdateVisitor batch wise using the UpdateExcutor.
Case in point: the HippoTranslationToDisplayName updater for v11.0 (
REPO-1356), which was discovered through CMS-10423
Note: for the HardHandleUpdateVisitor this wasn't an issue as it had to do a save on each Node update anyhow.
To fix this the NodeUpdateVisitor when invoked from the NodeUpdateService within UpdaterRegistry, will now enforce:
- using the system session from the NodeUpdateVisitor to load the node to update
- before successful return perform a system session.save
The NodeUpdateVisitor therefore doesn't need to take care of this logic anymore (it won't harm either).