[MAGNOLIA-8514] Modified date is not updated after changing any field in compositeField Created: 03/Aug/22  Updated: 10/Oct/22  Resolved: 04/Oct/22

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 6.2.22
Fix Version/s: 6.3.0, 6.2.25

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Jaromir Sarf
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Problem/Incident
causality
caused by MAGNOLIA-8125 Status color is not changed after mod... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MAGNOLIA-8555 Implementation Sub-task Completed Jaromir Sarf  
MAGNOLIA-8556 Code review Sub-task Completed Roman Kovařík  
MAGNOLIA-8557 PreintQA Sub-task Completed Fernando Cherchi  
MAGNOLIA-8558 QA Sub-task Completed Fernando Cherchi  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Nucleus Quality Maintenance
Sprint: Nucleus 19, Nucleus 20
Story Points: 2
Team: Nucleus

 Description   

Steps to reproduce

  1. On a content-app include a composite field
  2. Create an item and check the lastModifiedDate
  3. Edit the item and change some field within the compositeField
  4. Check the lastModifiedDate is not updated
  5. Change any other field outside the compositeField
  6. Check the lastModifiedDate is updated

Expected results

The lastModifiedDate is updated

Actual results

The lastModifiedDate is not updated

Workaround

Do not use mgnl:content (but any type inherited from it instead) as node type of content items. 

Since the mgnl:content is used by default if not provided, therefore explicitly defined another nodeType under model of contentType would be a solution. see: https://docs.magnolia-cms.com/product-docs/6.2/Modules/List-of-modules/Content-Types-module/Content-type-definition/Content-type-Model-definition.html

your-content-type.yaml

datasource:
  ...

model:
  //any nodeType excepts mgnl:content, e.g: mgnl:contentNode, mgnl:category
  nodeType: mgnl:category
  ...

Development notes

N/A



 Comments   
Comment by Roman Kovařík [ 04/Aug/22 ]
  1. Open https://demo.magnolia-cms.com/.magnolia/admincentral#app:jcr-browser-app:browser;/magnolia-travels/Vietnam--Tradition-and-Today::
  2. Add node with mgnl:contentNode node type
  3. Publish https://demo.magnolia-cms.com/.magnolia/admincentral#app:jcr-browser-app:browser;/magnolia-travels/Vietnam--Tradition-and-Today::
  4. Change the new node name (or add a property...)
  5. The modification date and status of mgnl:content node are NOT updated 

 

  1. Open https://demo.magnolia-cms.com/.magnolia/admincentral#app:jcr-browser-app:browser;/destinations/northAmerica::
  2. Add node with mgnl:contentNode node type
  3. Publish https://demo.magnolia-cms.com/.magnolia/admincentral#app:jcr-browser-app:browser;/destinations/northAmerica::
  4. Change the new node name (or add a property...)
  5. The modification date and status of mgnl:category ARE updated 

The reason is, the mgnl:content (which is the type of tour items) is considered to be a legacy folder node types (use e.g. in the config workspace) thus it's state is not updated with child modifications, see info.magnolia.jcr.wrapper.MgnlPropertySettingContentDecorator.ChangeLastUpdateDateOp#resolveNodesToModify

mgnl:category works fine.

Comment by David Lopez [ 31/Aug/22 ]

Discussion 31/08/2022

Above comments are more the supporting steps for "steps to reproduce", in which scenario it happens and in which not.

Unfortunately we provide node type mgnl:contentNode as default so we cannot say that we don't support it, hence we would need to discover the possible fix.

Comment by Roman Kovařík [ 07/Sep/22 ]

Discovery:

MgnlPropertySettingContentDecorator#isFolder needs to hardcode a check for a workspace(s) like
mgnl:content.equals(nodeType) and "config".equals(workspace)
There might be more workspace with mgnl:content used as folder type, check https://nightly.magnolia-cms.com/.magnolia/admincentral#app:jcr-browser-app:browser;

  • campaigns
  • groovy
  • ...
Generated at Mon Feb 12 04:33:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.