For some reason, users who have no specific rights on a listing page, i.e. users who have no buttons displayed above the listing (download, rename, delete, edit description, ...), have columns data out of order. The column headers are in the correct order, though. This problem disappears once you have at least one button displayed.

Comments

LpSolit created an issue. See original summary.

lpsolit’s picture

From what I can see in createUnsortedRowsAndColumns(), $column_names and $visible_columns are not in the same order:

The sort order of $column_names is given by MetadataInfoEventSubscriber.php while $visible_columns is sorted by data being in the filebrowser_metadata_entity DB table, which is different.

I suspect that the different behavior is due to the |if (count($this->formActions) > 0 )| check in listView(). But I don't understand Drupal internals well enough to investigate further. @clivesj, please help! :)

clivesj’s picture

if (count($this->formActions) > 0

If the user has action rights (upload, delete etc) on the listing, the listing (array of data) is send to a form builder that will build a theme_ tableselect form.
If the user has no action the theme_table will be return right-away.

Now there are some changes in D8 that changed theme_table to a render element of type table. the table element can be displayed as a "tableselect" by adding '#tableselect' = true;
I did some experimenting yesterday but there a couple of things not working well as there are also some ambiguous things in the documentation of the new render element.

I need some more time to investigate.
I think your other issue is related.

  • clivesj committed 373eb91 on 8.x-2.x
    Issue #2832870: Columns are displayed out of order
    
clivesj’s picture

Status: Active » Fixed

Fixed in dev

clivesj’s picture

Status: Fixed » Closed (fixed)