Skip to content

Conversation

@skjnldsv
Copy link
Member

Working on the Photos default folder picker, I noticed that if you call the getFilePickerBuilder with an invalid value/folder, it just exploded without loading anything.

Adding this make sure we fallback to the user root / if the provided directory i non-existent

const updatePhotosFolder = '/fake/unknown/path'
const picker = getFilePickerBuilder(t('photos', 'Select the default location for your Photos'))
	.setMultiSelect(false)
	.setModal(true)
	.setType(1)
	.addMimeTypeFilter('httpd/unix-directory')
	.allowDirectories()
	.startAt(updatePhotosFolder)
	.build()

picker.pick()
	.then(updatePhotosFolder)

@skjnldsv skjnldsv added bug 3. to review Waiting for reviews labels Aug 24, 2022
@skjnldsv skjnldsv added this to the Nextcloud 25 milestone Aug 24, 2022
@skjnldsv skjnldsv requested review from a team, CarlSchwan, PVince81 and icewind1991 August 24, 2022 15:44
@skjnldsv skjnldsv self-assigned this Aug 24, 2022
@skjnldsv skjnldsv requested review from Pytal and artonge and removed request for a team August 24, 2022 15:44
@skjnldsv
Copy link
Member Author

/rebase

} else {
self.$fileListHeader.find('[data-sort=' + self.filepicker.sortField + '] .sort-indicator').addClass('icon-triangle-s')
}
self.filepicker.filesClient.getFolderContents(dir).then(function(status, files) {
Copy link
Member Author

@skjnldsv skjnldsv Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nextcloud-command nextcloud-command force-pushed the fix/picker-fallback-root branch from 8113448 to 2f9f93c Compare August 24, 2022 16:35
This was referenced Aug 25, 2022
@skjnldsv

This comment was marked as resolved.

@PVince81

This comment was marked as resolved.

@szaimen

This comment was marked as resolved.

@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Sep 1, 2022
@skjnldsv
Copy link
Member Author

skjnldsv commented Sep 1, 2022

/compile amend /

Please don't add the missing files if you don't plan to merge straight away 🙈

conflicts

Rebasing 😬

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Sep 1, 2022
@skjnldsv skjnldsv force-pushed the fix/picker-fallback-root branch from 4bf7781 to 4f9f98c Compare September 1, 2022 16:29
@skjnldsv
Copy link
Member Author

skjnldsv commented Sep 1, 2022

/compile amend /

Signed-off-by: John Molakvoæ <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@skjnldsv skjnldsv merged commit 2892707 into master Sep 1, 2022
@skjnldsv skjnldsv deleted the fix/picker-fallback-root branch September 1, 2022 17:35
@artonge
Copy link
Contributor

artonge commented Feb 6, 2023

/backport to stable24

@ShGKme
Copy link
Contributor

ShGKme commented Feb 14, 2023

/backport to stable23

@backportbot-nextcloud
Copy link

The backport to stable23 failed. Please do this backport manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants