-
Notifications
You must be signed in to change notification settings - Fork 79
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
File upload does not work on themes such as Gravstrap (Box not clickable, no text appears in box) #113
Comments
Fixes file field getgrav/grav-plugin-form#113
The file field loads some JS in the I fixed Deliver, not sure about GravStrap, try disabling javascript minification and concatenation to check if form.min.js is loaded. |
It should be ok to move it to a default location, I thought bottom was always available. Might need to make sure it loads at the right time though and that it doesn't throw js errors. The good thing about loading in the bottom is that you avoid FOUC and you don't have to pollute the window with dom ready events because all you need is there already available. |
According to @rhukster it has to be in the bottom, so we should add that position to all themes. |
Hi, I have the same bug but it appears only once js concatenation is enabled. When disabled, it works fine. I tried to clear grav & browser cache but still the same. Any idea ? I use Grav 1.1.12 + Form 2.0.8 Let me know if you prefer me to open a new bug on this. Thanks, |
Which theme are you using @nsteinmetz ? |
Hi @flaviocopes it's one of my own and I have in
So from my pov, I shouldn't have any bug. |
Ok I've been able to replicate the problem also with Antimatter, with Disable the JS pipeline until we sort it out. |
This issue also occurs on Bootstrap, Afterburner2, Receptar... and a lot more. @flaviocopes I have disabled JS Pipeline in the Configuration of Admin panel, yet the issue persists. |
Using OP's solution, by adding |
I've got the same problem here. Would really like to use pipelining... |
@boredland You can try my solution above :) |
I did, but this works only disabling pipelining... |
Ok, @boredland so a quick workaround you can update the theme so that the bottom js defers it's load:
The issue is that the form plugin inlines some javascript code into the page. But when pipeline is enabled, the code before it (form.min.js) doesn't defer it's load anymore, but depends on the inlined code (that's located below it). There's a couple of ways to fix this:
|
Closing because due to issue age. Please re-open if you continue to have issues |
File upload works with
antimatter
theme but not many others.The error looks like so (working on left, not working on the right):
With file
user/pages/02.form/form.md
On "deliver" theme, https://github.com/getgrav/grav-theme-deliver, to fix, add one line:
/user/themes/[theme]/templates/partials/base.html.twig
in pre-existing "bottom" block.
See https://github.com/getgrav/grav-theme-antimatter/blob/develop/templates/partials/base.html.twig#L84
and
https://github.com/getgrav/grav-plugin-form/blob/develop/templates/forms/fields/file/file.html.twig#L78
However, in gravstrap theme, https://github.com/giansi/gravstrap-theme-skeleton,
adding the lines
results only in new errors in console (originally no console errors despite box not working);
:( How can I get the file upload in forms in this theme to work?
The text was updated successfully, but these errors were encountered: