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

Under certain circumstances an exception occurs while rendering details.html

    XMLWordPrintable

    Details

      Description

      After doing the following steps a sleeping lion occurs:

      1. Create a new course
      2. Choose an execution period and save it
      3. Edit directly the access configuration and save it
      4. Run the new course by clicking the root element in breadcrumb
      5. Navigate directly to "Course Info"
      6. The following exception occurs:
      org.olat.core.logging.OLATRuntimeException: exception occured while
      merging template: Reference evaluation threw an exception at
      org/olat/repository/ui/list/_content/details.html[line 48, column 45] -> at
      org.olat.core.gui.render.velocity.VelocityHelper.merge(VelocityHelper.java:164)
      

      The cause is that the repository entry object is read from database by calling RepositoryEntryDAO.loadForUpdate(). In this case a lifecycle object is instantiated but with no values set. Changing the method to RepositoryEntryDAO.loadByKey() fixes that. Here's the patch:

      diff --git a/src/main/java/org/olat/repository/RepositoryManager.java b/src/main/java/org/olat/repository/RepositoryManager.java
      --- a/src/main/java/org/olat/repository/RepositoryManager.java
      +++ b/src/main/java/org/olat/repository/RepositoryManager.java
      @@ -676,7 +676,7 @@
       	public RepositoryEntry setAccessAndProperties(final RepositoryEntry re,
       			int access, boolean membersOnly,
       			boolean canCopy, boolean canReference, boolean canDownload) {
      -		RepositoryEntry reloadedRe = repositoryEntryDao.loadForUpdate(re);
      +		RepositoryEntry reloadedRe = repositoryEntryDao.loadByKey(re.getKey());
       		if(reloadedRe == null) {
       			return null;
       		}
      @@ -702,7 +702,7 @@
       
       	public RepositoryEntry setLeaveSetting(final RepositoryEntry re,
       			RepositoryEntryAllowToLeaveOptions setting) {
      -		RepositoryEntry reloadedRe = repositoryEntryDao.loadForUpdate(re);
      +		RepositoryEntry reloadedRe = repositoryEntryDao.loadByKey(re.getKey());
       		if(reloadedRe == null) {
       			return null;
       		}
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 40 minutes
                40m