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

CSS file can not be imported (missing token in form) #3975

Closed
NicoDucou opened this issue Sep 16, 2021 · 9 comments
Closed

CSS file can not be imported (missing token in form) #3975

NicoDucou opened this issue Sep 16, 2021 · 9 comments
Assignees

Comments

@NicoDucou
Copy link
Member

On the page main/admin/settings.php?category=Stylesheets#tabs-3 when validating the form it always shows the message that the token is not validated and the CSS file is never imported.

Since the commit bf50545#diff-3b92311ca8f4223f9e4bd967854e03eba80d6707b77130b9b26706949c92a5b7R1431 when ever a form is validated it should check that the security token is valid. The problem is that in this form for stylesheet upload the token is never validated.

It calls Security::check_token('form', $this);
And in this function I don't know why the form token and the sessionToken are always different so the action is always blocked and the Stylesheet is not imported.

Tested on Chamilo 1.11.x of 2021/09/21

@christianbeeznest
Copy link
Contributor

Hola @NicoDucou puedes confirmar si esta bien ahora porfavor ? Esto es mi PR con el fix 0f3b54f

Gracias.

christianbeeznest pushed a commit to christianbeeznest/chamilo-lms that referenced this issue Sep 17, 2021
ywarnier added a commit that referenced this issue Sep 25, 2021
Settings: Fix CSS file can not be imported (missing token in form) - refs #3975
@ywarnier
Copy link
Member

@NicoDucou this one is fixed, right?

@xam1234
Copy link

xam1234 commented Nov 19, 2021

@ywarnier When do you plan to release version 1.11.18 ?

@NicoDucou
Copy link
Member Author

@NicoDucou this one is fixed, right?

Yes

@ywarnier
Copy link
Member

@ywarnier When do you plan to release version 1.11.18 ?

When it's ready (soon)

@Chabi01
Copy link

Chabi01 commented Jul 21, 2022

Hi,
I'm using the V1.11.16 (softaculous), the error is still here...

@Chabi01
Copy link

Chabi01 commented Jul 21, 2022

I get exactly on submit :
Not Found

The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
The url triggered is : /main/admin/admin/settings.php?category=Stylesheets#tabs-3

No error message even on test server mode.

@Chabi01
Copy link

Chabi01 commented Jul 21, 2022

2 times "admin" ??
A quick way to correct the wrong file ?

@Chabi01
Copy link

Chabi01 commented Jul 21, 2022

For the record, I have solve this by modifying the file mai/admin/settings.lib.php, line 400
from
api_get_path().'admin/settings.php?category=Stylesheets#tabs-3'
to
api_get_path().'settings.php?category=Stylesheets#tabs-3'

But now, i get "not validated". Still searching...

Seems to be the token issue again : quickform.php line 1435...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants