core icon indicating copy to clipboard operation
core copied to clipboard

Filepicker broken in stable6 and master

Open MorrisJobke opened this issue 12 years ago • 11 comments

I use for the music app the file picker in ther user settings.

When the filepicker opens it shows all entries twice and on click on a item (just folders in my case) follwoing error occurs on the console:

Uncaught TypeError: Cannot read property 'data' of null oc-dialogs.js:625

https://github.com/owncloud/core/blob/6b02126dc1c8ba9de5b87c6c8568feea5948d2a0/core/js/oc-dialogs.js#L625

@PVince81 Can this be caused by the file list ajaxification or the lazy load of the file list?

Also the filter for mimetype isn't working anymore on master.

When I close the file picker and reopen the duplication is gone, I can browse the file tree and select a item.

cc @DeepDiver1975 @bartv2 @schiesbn

MorrisJobke avatar Apr 29 '14 15:04 MorrisJobke

Strange, the file picker works for the avatar. Are you passing any configs to it ? The picker was changed to use the same data format as ajax/list.php from files

PVince81 avatar Apr 29 '14 15:04 PVince81

Wait, broken on stable6 as well ? I did touch it on master for ajaxification, but not on stable6.

Might have been broken for a longer time ?

PVince81 avatar Apr 29 '14 15:04 PVince81

https://github.com/owncloud/music/blob/master/js/public/settings-user.js#L29

MorrisJobke avatar Apr 30 '14 13:04 MorrisJobke

I tried the latest music app master (9a2ca55f3144733190f6212a0fb247d3045d4a4d) and the latest core master (49d9631eee1616b9ae2846886c3d428236c5b81a) and the file picker works correctly. Steps:

  1. Go to the personal page
  2. Scroll down to the music app section
  3. Click on the blank field for the music collection path

The file picker appears, but is shifted to the top (I believe this dialogs issue has been fixed on a pending PR)

PVince81 avatar May 02 '14 16:05 PVince81

I just tried with v6.0.3 from git and the file picker also works correctly.

PVince81 avatar May 02 '14 16:05 PVince81

@PVince81 Did you also test to select some folder? (in music settings just folders should appear) It isn't possible to select a folder on the first file picker. If I close the first and reopen it again it works for me too.

MorrisJobke avatar May 03 '14 07:05 MorrisJobke

Sorry, I seem to have missed the details of your report and thought that the file picker didn't appear at all. I'll have another try.

PVince81 avatar May 05 '14 08:05 PVince81

I see the same issue using the file picker to "Select new from existing" when choosing a profile picture (6.0.3 stable): image

JasonEades avatar May 30 '14 19:05 JasonEades

Very strange, the OC.Dialogs.filepicker promise is called twice and I see the file list appended twice into the same dialog. When I debug it doesn't happen. Looking further.

PVince81 avatar Jun 20 '14 11:06 PVince81

Ok got it: you call OC.Dialog.filepicker() twice ! And it seems the dialog code is not safe for being called twice in a row.

The reason why it's called twice: the events for that field are "click focus" which means it will call it first for the click, then the click will focus the field, which will call your event handler again.

PVince81 avatar Jun 20 '14 11:06 PVince81

Fix for the core part is here https://github.com/owncloud/core/issues/9121

PVince81 avatar Jun 20 '14 11:06 PVince81