From 22d533c1f5c0a9263e036775aafcd65211fcd19e Mon Sep 17 00:00:00 2001 From: GouadriaHanen <49310007+GouadriaHanen@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:35:18 +0100 Subject: [PATCH] fix: Wrong modifier avatar displayed in file details - EXO-69919 (#317) Prior to this change, when a user opens a file, the view properties are set, the ModifyNodeAction event listener is executed and the "exo:lastModifiedDate" and "exo:lastModifier" properties are updated, resulting in an incorrect modifier avatar when opening a file to display it without modifying it. After this modification, when a view property is updated, "exo:lastModifiedDate" and "exo:lastModifier" do not change. --- .../services/jcr/ext/action/ModifyNodeAction.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/action/ModifyNodeAction.java b/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/action/ModifyNodeAction.java index 995008a746..945d64e154 100644 --- a/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/action/ModifyNodeAction.java +++ b/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/action/ModifyNodeAction.java @@ -23,6 +23,7 @@ import org.apache.commons.chain.Context; import org.exoplatform.services.command.action.Action; +import org.exoplatform.services.jcr.impl.core.PropertyImpl; import org.exoplatform.services.security.ConversationState; /** @@ -50,6 +51,10 @@ public boolean execute(Context context) throws Exception { if(node.canAddMixin("exo:modify")) { node.addMixin("exo:modify"); } + String propertyName =((PropertyImpl) item).getInternalName().getName(); + if (propertyName.equals("documentViews") || propertyName.equals("documentViewers")) { + return false; + } node.setProperty("exo:lastModifiedDate", new GregorianCalendar()); node.setProperty("exo:lastModifier",userName); return false;