Hello,
I am almost ready with my first Kirby website. But I got stuck with an erros when I publish it on a Linux server.
I edited the blueprints/file/default.yml to be able to add a CAption and a ALT text to the images. The default.yml file looks like this:
title: Image
options:
update:
admin: true
editor: true
columns:
- width: 1/2
sections:
content:
type: fields
fields:
caption:
label: Caption
type: textarea
size: medium
- width: 1/2
sections:
meta:
type: fields
fields:
alt:
label: Alternative Text
type: text
On local Windows server is working fine. But when Igo to the Linux server and try to change a ALT text it gives me an error: The form could not be saved Exception: undefined
The JSON response from the API could not be parsed. Please check your API connection.*
If I have a look art the JSON response looks like:
Thanks for your replay.
I have tried to clear de sessions , cache and cookies. It is not working. I can edit all the pages and add pages wihtout any problem , it is just when I tried to modify ALT or caption on images.
Let’s give you an update. Still not working, I have tried deleteing the sessions again and trying on a new browser, and it didn’t help. I have been playing with the file
/kirby/config/api/authentification.php
// csrf token check
if ($auth->type() === ‘session’ && $auth->csrf() === false) {
throw new PermissionException(‘Unauthenticated’, 403);
}
I checked thath $auth->type() is “session” and when I try to send in the response $auth->csrf() it is empty, should it have a value?? it doesn’t print “false” neither.
Hm, this is weird. The token is used for everything and I have no clue at all while it should stop working for file metadata but not other stuff.
Could you test and deploy a completely fresh Starterkit on that same server, and try to add some data to a file. To be able to create a Panel account on the remote server, you have to add
'panel' =>[
'install' => true
]
to the /site/config/config.php's return statement.
the problem was with a specific file extension. My webiste has some httacess rules to prevent hotlinking. So when going to edit the file fields the console showed a 403 error when loading the file in the panel.
I removed the httacess rules and it works again but I would like to keep the rules. Is there any workaround?