Problem/Motivation

The data export supports just the two default file system schemes public:// and private://

There are many contrib modules which register additional file system schemes (for example saving to AWS S3 and Dropbox), and drupal allows configuration of the default value for this which can be set at /admin/config/media/file-system and is saved to the config item 'system.file' as 'default_scheme'.

Views Data Export doesn't recognise these additional filesystems, however, and won't allow exports to be saved to these.

Proposed resolution

Instead of choosing public or private, perhaps we could instead use the same selection mechanism for file system wrappers as used by core:

$config = $this->config('system.file');
$form['file_default_scheme'] = [
  '#type' => 'radios',
  '#title' => t('Default download method'),
  '#default_value' => $config->get('default_scheme'),
  '#options' => $options,
  '#description' => t('This setting is used as the preferred download method. The use of public files is more efficient, but does not provide any access control.'),
];
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3200974_2 Comparechanges, plain diff MR !95
  • 3200974-allow-use-of Comparecompare
  • 3200974 Comparecompare
  • 8.x-1.x Comparecompare

Comments

kalpaitch created an issue. See original summary.

kalpaitch’s picture

Issue summary: View changes
kalpaitch’s picture

kalpaitch’s picture

kalpaitch’s picture

Status: Active » Needs review

Let me know your thoughts. The default option is 'private', if other options are available they can be selected, with a fall back to 'public'.

If you're happy with this approach I'll put some thought into how best to make this setting backwards compatible.

kalpaitch’s picture

StatusFileSize
new8.07 KB

Status: Needs review » Needs work

The last submitted patch, 6: allow-configurable-filesystems_3200974-6.patch, failed testing. View results

eli-t’s picture

Patch in #6 unfortunately does not apply against 8.x-1.5.

eli-t’s picture

MR 95 applies against 8.x-1.8 and manual testing is successful, but there are automated test failures.

eli-t’s picture

Status: Needs work » Needs review

Automated tests all now pass.

This would require further work if it were to be merged - there would need to be a config update to change existing config to use the new schema. But putting it to needs review to get the opinion of a maintainer if this is a viable addition before doing that additional work.

eli-t’s picture

Status: Needs review » Needs work

Putting back to Needs work after discussing and agreeing with Steven Jones in Drupal Slack this would be a good change.

eli-t’s picture

Status: Needs work » Needs review

This now has a post update function to cover the schema update with full kernel tests. Setting to needs review.

steven jones’s picture

This looks super nice @eli-t thanks, I'll review this properly later this week, but at first glance I can't really see anything amiss.

steven jones’s picture

Okay, so actually, 'later this week' turned out to be a few minutes ago. Hah!

I just want to discuss being a bit more strict about missing filesystems etc. and see if you think that would be a problem for your use-case for example?

eli-t’s picture

Status: Needs review » Needs work
steven jones’s picture

Status: Needs work » Reviewed & tested by the community

Reckon this is RTBC now..

  • steven jones committed 6d0b5608 on 8.x-1.x authored by eli-t
    feat: #3200974 Allow use of any configured file system scheme
    
    By:...
eli-t’s picture

Woo! Thanks @steven-jones and thanks more to @kalpaitch for writing the initial patch in the first place.

steven jones’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the work here, it'll go out in the next release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.