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

Dialog: table sorting does not work correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.9
    • Fix Version/s: 10.4.10
    • Component/s: None
    • Labels:
      None

      Description

      This is a follow up of OO-1868.
      For a long time noone noticed that the displayed filename when clicking "Show" does not match the filename in the table. I investigated the problem again and detected that the file link is not generated correctly. The link has to point to sortedRow.

      The patch of the patch

      diff --git a/src/main/java/org/olat/modules/dialog/DialogElementsController.java b/src/main/java/org/olat/modules/dialog/DialogElementsController.java
      --- a/src/main/java/org/olat/modules/dialog/DialogElementsController.java
      +++ b/src/main/java/org/olat/modules/dialog/DialogElementsController.java
      @@ -222,7 +222,7 @@
       			TableEvent te = (TableEvent) event;
       			String command = te.getActionId();
       			int row = te.getRowId();
      -			entry = tableModel.getEntryAt(tableCtr.getSortedRow(row));
      +			entry = tableModel.getEntryAt(row);
       			if (command.equals(ACTION_START_FORUM)) {
       				selectedElement = dialogElmsMgr.findDialogElement(coursePropMgr, courseNode, entry.getForumKey());
       				if(selectedElement == null){
      diff --git a/src/main/java/org/olat/modules/dialog/DialogElementsTableModel.java b/src/main/java/org/olat/modules/dialog/DialogElementsTableModel.java
      --- a/src/main/java/org/olat/modules/dialog/DialogElementsTableModel.java
      +++ b/src/main/java/org/olat/modules/dialog/DialogElementsTableModel.java
      @@ -173,7 +173,7 @@
       				Object entry = table.getTableDataModel().getValueAt(sortedRow, getDataColumn());
       	
       				StringOutput link = new StringOutput();
      -				ubu.buildURI(link, new String[] { Table.COMMANDLINK_ROWACTION_CLICKED, Table.COMMANDLINK_ROWACTION_ID }, new String[] { String.valueOf(row), DialogElementsController.ACTION_SHOW_FILE }); // url
      +				ubu.buildURI(link, new String[] { Table.COMMANDLINK_ROWACTION_CLICKED, Table.COMMANDLINK_ROWACTION_ID }, new String[] { String.valueOf(sortedRow), DialogElementsController.ACTION_SHOW_FILE }); // url
       				sb.append("<a href=\"javascript:o_openPopUp('").append(link).append(entry.toString()).append("','fileview','600','700','no')\">")
       				  .append(entry.toString())
       				  .append("</a>");
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
              Tester:
              Stephan Clemenz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 20 minutes
                20m