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

Template Type Custom Page - File element - File upload is mandatory #276

Open
Gilbertdelyon opened this issue May 14, 2023 · 2 comments
Open
Labels

Comments

@Gilbertdelyon
Copy link

Steps to reproduce:

  • Create a template type custom page and add a "File" element to this page, WITHOUT uploading a default file (element is empty by default).
  • Create a new page based on this template.
  • Edit elements and try to save WITHOUT uploading a file in the file element .
  • You CANNOT save elements.
    Even if you dont need a file on this specific page you have to upload one.
@Gilbertdelyon
Copy link
Author

Gilbertdelyon commented May 19, 2023

@yurabakhtin @luke-
Up!
I have a template with a "file" element. This template is planed to be used in many custom pages, most of them have the file, some dont have.
But uploading a file is mandatory by default. As long as you dont upload a file you cannot save the page.
I also tested with a "File Download" element: Same result. As long as you dont upload a file you cannot save the page.

Please let me know if you will be able to solve this issue?
In case of negative answer I will proceed on another, less convenient, way (replace file element by a url in a "text" element and store the file separately.

My 2 cents: I am also using Drupal. Drupal has more or less the same "element" system (called "fields" in Drupal). When you add a "file field" in a new template (called "Node Type" in Drupal) there is a check box where you can select/unselect "Mandatory".
If it is not selected the user can then let the page without file.
Could it be possible to get the same feature in Custom pages?

@Gilbertdelyon
Copy link
Author

Gilbertdelyon commented May 20, 2023

In the meantime I found a way:

  • if you edit the page in page display you can save the page without uploading a file in the "file element"
  • but if you edit the page in the "edit elements" display you cannot save elements without uploading a file

It's tricky
And once you have uploaded a file you cannot remove it (you can only replace it)

@luke- luke- added the bug label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants