Skip to content

Commit

Permalink
fix: Wrong modifier avatar displayed in file details - EXO-69919 (#317)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GouadriaHanen committed Mar 8, 2024
1 parent f537244 commit 22d533c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 22d533c

Please sign in to comment.