Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-1078

Uncomplete error message when adding a test edited by another user

    XMLWordPrintable

    Details

      Description

      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);
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
              Tester:
              Kirsten Scherer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m