-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.4, 2.6, 2.7
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_25_STABLE, MOODLE_26_STABLE
-
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.