Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44416

Filepicker pagination in detail (table) view does not display second (or subsequent) pages

XMLWordPrintable

    • MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • Hide

      Enable the Wikimedia repository if it is not already.
      Navigate to a course in which you have edit capabilities (i.e. editingteacher role or higher privilege)
      Click the 'Turn editing on' button
      In the 0th (summary) section, click the cog/sprocket image link to edit the summary.
      The HTML editor should appear. Locate and click on the 'Insert Moodle media' button in the TinyMCE button pallette.
      Click the 'Find or upload a sound, video or applet...' link
      The 'File picker' dialog will appear. On it, click the middle view mode button (set of three in top right corner) to change mode to 'Display folder with file details'
      Click on the 'Wikimedia' repository button.
      Enter the search term 'appalachian state' and click submit.
      Verify the (highlighted) view mode is set to detail view mode.
      Click the scroll bar to initiate additional page fetches.
      The scroll bar thumb will move up and down several times as additional page fetches are executed.
      There are displayed in the list only the initially fetched 24 entries.

      After the patch is applied, the browser cache is cleared, the server caches are cleared, etc. (so as to insure the new javascript file is referenced by the browser), following the same testing steps should yield a displayed list exceeding the first 24 entries.

      Show
      Enable the Wikimedia repository if it is not already. Navigate to a course in which you have edit capabilities (i.e. editingteacher role or higher privilege) Click the 'Turn editing on' button In the 0th (summary) section, click the cog/sprocket image link to edit the summary. The HTML editor should appear. Locate and click on the 'Insert Moodle media' button in the TinyMCE button pallette. Click the 'Find or upload a sound, video or applet...' link The 'File picker' dialog will appear. On it, click the middle view mode button (set of three in top right corner) to change mode to 'Display folder with file details' Click on the 'Wikimedia' repository button. Enter the search term 'appalachian state' and click submit. Verify the (highlighted) view mode is set to detail view mode. Click the scroll bar to initiate additional page fetches. The scroll bar thumb will move up and down several times as additional page fetches are executed. There are displayed in the list only the initially fetched 24 entries. After the patch is applied, the browser cache is cleared, the server caches are cleared, etc. (so as to insure the new javascript file is referenced by the browser), following the same testing steps should yield a displayed list exceeding the first 24 entries.

      When using the filepicker in detail (table, mode = 3) view, when the second page of data is fetched from a repository (due to scroll), the additional items are not displayed.

      If you then click on one of the other diplay modes, the items are displayed along with the first page items, and when you click to return to detail view mode, all of the items are displayed there as well.

      The problem is that the first page's items are set up correctly in the initialize_table_view() function when passed to the YUI tableview's constructor, but when the second or subsequent page's data items are fetched, they are only added to the cached fileslist var, but never added to the tableview's data property.

      When the view mode is changed, the additional items get picked up because they are then already in the fileslist cache, and so are added to the newly created tableview when its constructor is called.

      Related MDL-26832

      The attached patch, and submitted github diff/branch URLs show my proposed fix. Just need to make a call to tableview.data.add() in the append_files_table() for each of the new items. Rather than duplicate the displayname, isfolder, classname property assignments in both the initialize_table_view() and append_files_table routines, put that one level up so it's done before either of those two routines is called.

      Issue exists in current development branch (26, and 25 also), but these changes are in a section of the file that haven't changed for a while, so the patch will apply cleanly.

      Caveat: Not sure if using .forEach on arrays will be backward compatible enough.. may need to change to use simple index iteration.

            phalacee Jason Fowler
            woolardfa@appstate.edu Fred Woolard
            Jason Fowler Jason Fowler
            Marina Glancy Marina Glancy
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.