New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added the option to select a folder on the editablefilefield #177
Conversation
is this going to be added or do I need to make some changes before it can be added? I discovered we needed this functionality in more projects and it would be great if the code for selecting an upload folder is default in the userforms module. |
|
||
$folder = ($this->getSetting('Folder')) ? $this->getSetting('Folder') : ''; | ||
|
||
$folderList = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this code for getting folders as an array into a separate method with appropriate extend hooks to make it easier to write unit tests for and other services to modify / extend (e.g subsite module may want to modify this source list).
Thanks @roed, yes I've added a few comments inline before I merge. Cheers |
Code for generating the folder list has been moved to a seperate method, with the option to extend the list. Also a check has been added to check if the folder still exists.
@wilr I've made some changes as you suggested. Can you check if this is wat you meant? |
@wilr do I have to make more changes, or is the commit above enough? |
it works in my project also (except for the styling). This is a good solution! |
Update the PHP files to PSR-2 spec
this fix adds the option to select a folder. I tried to do it with a TreeDropdownField, but that one didn't work. A treedropdownfield needs a form, because it tries to call the 'tree' action. I used a dropdownfield instead.
There is also an issue for this pull request:
#20