hyrax icon indicating copy to clipboard operation
hyrax copied to clipboard

File Manager upload and sorting broken with relative_root_url option

Open dlpierce opened this issue 8 years ago • 0 comments

Descriptive summary

The URL used to upload files to a work is not generated by Rails route and therefore does not respect URL builder configuration. Specifically: https://github.com/projecthydra-labs/hyrax/blob/master/app/assets/javascripts/hyrax/uploader.js#L34

Similarly, the persist function of SortManager constructs a URL for POSTing instead of using a Rails generated route which will respect URL builder configuration. The specific line of code in question is: https://github.com/projecthydra-labs/hyrax/blob/master/app/assets/javascripts/hyrax/file_manager/sorting.es6#L22

Rationale

Using the file manager to persist changes will break in an application that makes use of the relative_root_url Rails configuration option.

Steps to reproduce the behavior

  1. Configure the internal app to run from a relative url root
  2. Attempt to upload files to a work
  3. Or attempt to rearrange a work's existing files using the file manager
  4. Either method will fail with a 404 shown in the browser's dev tools

Related work

#136

#135

dlpierce avatar Apr 21 '17 01:04 dlpierce