Skip to content
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

Error needed when parent in files section is a collection #1938

Closed
moritzebeling opened this issue Jul 22, 2019 · 4 comments

Comments

@moritzebeling
Copy link

commented Jul 22, 2019

I think it is great, that the files section can display not only files from one single page, but also all the files from multiple pages. Like:

all_uploads:
  type: files
  headline: All uploads
  parent: site.index

The problem appears when uploading a file to a section like that: No route found for path: "files" and request method: "POST", probably because it doesn’t know where to upload the new file.

A solution could be to:

  1. add a upload option, that can be set to false to disable the upload functionality to this section. Or:
  2. add a upload option where a single(!) page can be specified, to where a newly uploaded file should be moved to
@texnixe

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2019

In this case the bug is that the section doesn't throw an error because the parent is only supposed to be a single page, not multiple pages.

The upload option would be nice to have, but in this case the missing upload functionality is not the bug but a side effect.

@distantnative

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2019

Agreed, there are quite a few other problems/things to consider when parent could be a pages collection. I don't think we are there yet, so the correct behavior would be to check that it is a page, site or user object - and throw an error with anything different.

@moritzebeling

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

Thanks for looking into it. I already assumed, that, at this point, parent is not expected to be a pages collection. I’ll file an Idea for that to be added in the future.

@distantnative distantnative changed the title Error when uploading to a files section, that has multiple pages as parent Error needed when parent in files section is a collection Jul 22, 2019
@distantnative distantnative self-assigned this Sep 14, 2019
distantnative added a commit that referenced this issue Sep 14, 2019
@distantnative distantnative added this to the 3.2.5 milestone Sep 14, 2019
distantnative added a commit that referenced this issue Sep 15, 2019
@bastianallgeier

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.