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

Escaping HTML in tables

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.0.0
    • Fix Version/s: 9.0.6
    • Component/s: Course
    • Labels:

      Description

      I found two tables where HTML tags are escaped and column entries are not displayed properly:
      1. The infinite symbol in the group list of members management
      2. The participants list in date assignment

      This patch fixes both:
      diff -r 00114a4a4cbb src/main/java/de/bps/course/nodes/den/DENManager.java
      — a/src/main/java/de/bps/course/nodes/den/DENManager.java Mon Oct 07 14:19:09 2013 +0200
      +++ b/src/main/java/de/bps/course/nodes/den/DENManager.java Tue Oct 08 12:10:32 2013 +0200
      @@ -38,6 +38,7 @@
      import org.olat.commons.calendar.model.KalendarEventLink;
      import org.olat.core.CoreSpringFactory;
      import org.olat.core.gui.UserRequest;
      +import org.olat.core.gui.components.EscapeMode;
      import org.olat.core.gui.components.table.BooleanColumnDescriptor;
      import org.olat.core.gui.components.table.DefaultColumnDescriptor;
      import org.olat.core.gui.components.table.TableController;
      @@ -608,11 +609,15 @@
      tableCntrl.addColumnDescriptor(new StrongColumnDescriptor("dates.table.location", 3, null, ureq.getLocale()));
      tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.duration", 2, null, ureq.getLocale()));
      tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.comment", 4, null, ureq.getLocale()));

      • tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.participant.name", 5, null, ureq.getLocale()));
        + DefaultColumnDescriptor dcd = new DefaultColumnDescriptor("dates.table.participant.name", 5, null, ureq.getLocale());
        + dcd.setEscapeHtml(EscapeMode.none);
        + tableCntrl.addColumnDescriptor(dcd);

      boolean isAdministrativeUser = CoreSpringFactory.getImpl(BaseSecurityModule.class).isUserAllowedAdminProps(ureq.getUserSession().getRoles());
      if(isAdministrativeUser)

      { - tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.participant.username", 6, null, ureq.getLocale())); + dcd = new DefaultColumnDescriptor("dates.table.participant.username", 6, null, ureq.getLocale()); + dcd.setEscapeHtml(EscapeMode.none); + tableCntrl.addColumnDescriptor(dcd); }

      tableCntrl.addColumnDescriptor(new BooleanColumnDescriptor("participants", 7, DENListTableDataModel.CHANGE_ACTION,
      diff -r 00114a4a4cbb src/main/java/org/olat/course/member/CourseBusinessGroupListController.java
      — a/src/main/java/org/olat/course/member/CourseBusinessGroupListController.java Mon Oct 07 14:19:09 2013 +0200
      +++ b/src/main/java/org/olat/course/member/CourseBusinessGroupListController.java Tue Oct 08 12:10:32 2013 +0200
      @@ -24,6 +24,7 @@

      import org.olat.core.gui.UserRequest;
      import org.olat.core.gui.components.Component;
      +import org.olat.core.gui.components.EscapeMode;
      import org.olat.core.gui.components.link.Link;
      import org.olat.core.gui.components.link.LinkFactory;
      import org.olat.core.gui.components.table.ColumnDescriptor;
      @@ -119,7 +120,9 @@
      groupListCtr.addColumnDescriptor(new ResourcesColumnDescriptor(this, mainVC, getTranslator()));
      groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.tutorsCount.i18n(), Cols.tutorsCount.ordinal(), null, getLocale()));
      groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.participantsCount.i18n(), Cols.participantsCount.ordinal(), null, getLocale()));

      • groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.freePlaces.i18n(), Cols.freePlaces.ordinal(), TABLE_ACTION_LAUNCH, getLocale()));
        + DefaultColumnDescriptor dcd = new DefaultColumnDescriptor(Cols.freePlaces.i18n(), Cols.freePlaces.ordinal(), TABLE_ACTION_LAUNCH, getLocale());
        + dcd.setEscapeHtml(EscapeMode.none);
        + groupListCtr.addColumnDescriptor(dcd);
        groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.waitingListCount.i18n(), Cols.waitingListCount.ordinal(), null, getLocale()));
        CustomCellRenderer acRenderer = new BGAccessControlledCellRenderer();
        groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.accessTypes.i18n(), Cols.accessTypes.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, acRenderer));

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
              Tester:
              Florian Gnägi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 15 minutes Original Estimate - 15 minutes
                15m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 5 minutes
                1h 5m