-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 9.3.5, 9.4.0
-
Fix Version/s: 9.4.0
-
Labels:None
-
Funded by:
The error message when adding a test resource which is edited by another user is uncomplete (screenshot). Solution No. 1 is to remove the variable of the error message ("The learning resource is currently edited."), solution No. 2 is to complete the message by the full name of the owner of the lock.
This is the patch for solution No. 2:
diff -r fc7bb26c87aa src/main/java/org/olat/course/nodes/iq/IQEditController.java --- a/src/main/java/org/olat/course/nodes/iq/IQEditController.java Mon Apr 28 15:01:37 2014 +0200 +++ b/src/main/java/org/olat/course/nodes/iq/IQEditController.java Tue Apr 29 13:28:27 2014 +0200 @@ -56,11 +56,11 @@ import org.olat.core.gui.control.generic.closablewrapper.CloseableModalController; import org.olat.core.gui.control.generic.tabbable.ActivateableTabbableDefaultController; import org.olat.core.id.Identity; -import org.olat.core.id.OLATResourceable; import org.olat.core.logging.AssertException; import org.olat.core.logging.OLog; import org.olat.core.logging.Tracing; import org.olat.core.util.coordinate.CoordinatorManager; +import org.olat.core.util.coordinate.LockResult; import org.olat.core.util.vfs.LocalFileImpl; import org.olat.core.util.vfs.LocalFolderImpl; import org.olat.core.util.vfs.VFSConstants; @@ -103,6 +103,7 @@ import org.olat.repository.handlers.RepositoryHandler; import org.olat.repository.handlers.RepositoryHandlerFactory; import org.olat.resource.OLATResource; +import org.olat.user.UserManager; import de.bps.onyx.plugin.OnyxModule; import de.bps.onyx.plugin.course.nodes.iq.IQEditForm; @@ -749,8 +750,10 @@ private void doIQReference(UserRequest urequest, RepositoryEntry re) { // repository search controller done if (re != null) { - if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(re.getOlatResource(), null)) { - showError("error.entry.locked"); + if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(re.getOlatResource(), null)) { + LockResult lockResult = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(re.getOlatResource(), urequest.getIdentity(), null); + String fullName = CoreSpringFactory.getImpl(UserManager.class).getUserDisplayName(lockResult.getOwner()); + showError("error.entry.locked", fullName); } else { if(editTestButton != null) { myContent.remove(editTestButton);