[MGNLRES-272] LastModificationDate is not set on migration process Created: 27/Apr/16  Updated: 29/Mar/22  Resolved: 14/Jun/16

Status: Closed
Project: Magnolia Resources Module
Component/s: updates
Affects Version/s: 2.3.7, 2.4.5
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Teresa Miyar Assignee: Hieu Nguyen Duc
Resolution: Won't Fix Votes: 0
Labels: blocked, support
Remaining Estimate: 2.5h
Time Spent: 2d 5.5h
Original Estimate: 3d

Issue Links:
dependency
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Saigon 46
Story Points: 3
Team: Nucleus

 Description   

Migrated resources do not get their lastModifiedDate set, is not consistent with other nodes in Magnolia.



 Comments   
Comment by Teresa Miyar [ 27/Apr/16 ]

Task could look like this:
import info.magnolia.cms.util.QueryUtil;
import info.magnolia.jcr.util.NodeTypes;
import info.magnolia.module.InstallContext;
import info.magnolia.module.delta.AbstractRepositoryTask;
import info.magnolia.module.delta.TaskExecutionException;

import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.query.Query;

public class CheckAndUpdateLastModifiedDateTask extends AbstractRepositoryTask {

private final String workspaceName;

public CheckAndUpdateLastModifiedDateTask(String name, String description, String workspaceName)

{ super(name, description); this.workspaceName = workspaceName; }

@Override
protected void doExecute(InstallContext installContext) throws RepositoryException, TaskExecutionException {

String query = "select * from [mgnl:content] as t where t.[mgnl:lastModified] is null";
NodeIterator nodeIterator = QueryUtil.search(workspaceName, query, Query.JCR_SQL2);
while (nodeIterator.hasNext())

{ Node node = nodeIterator.nextNode(); NodeTypes.LastModified.update(node); }

}
}

Comment by Oanh Thai Hoang [ 26/May/16 ]

FYI: The implementation has already done in this PR : https://git.magnolia-cms.com/projects/TELIASONERA/repos/advanced-versioning/pull-requests/14/overview.

Comment by Mikaël Geljić [ 30/May/16 ]

Could somebody please clarify which migration process and what resources in particular we are talking about here? from/to which version?
Cuz for now to me it's unclear which task removes the lastModified info along the way (and if so, if we want to fix that task as well).

Comment by Mikaël Geljić [ 01/Jun/16 ]

Blocking until properly described as a product issue; all I heard so far has to do with advanced-versioning (and fresh installs).

Comment by Mikaël Geljić [ 14/Jun/16 ]

Deemed as a project-specific issue; closing. Meanwhile please reopen if there's any additional insight.

Generated at Mon Feb 12 06:49:05 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.