A weird problem when uploaded to the server that when I type into the text fields the content automatically deletes in less than a second. Any help regarding this would be great as I have no idea. It works fine on my local machine.
Check your write permissions for /content
, /media
, /site
folders and subs.
When you start writing, a .lock
file is opened in the corresponding folder.
The write operation is being rolled back if there is no write permission.
I could also be a problem with PHP sessions. Maybe check you php config. Clearing your browser cache could help too.
I tried both of those methods @ahmetbora and @jimbobrjames but neither worked. I tried deleting a page and this comes back at me now The JSON response from the API could not be parsed. Please check your API connection.
Do you get any more information in your console?
Hi @texnixe
I get
DevTools failed to parse SourceMap: https://thehackspace.co.uk/panel/pages/drawer.css.map
and
Failed to load resource: the server responded with a status of 403 ()
app.js:1 Error: The JSON response from the API could not be parsed. Please check your API connection.
at app.js:1
That sounds very much like a permission error after all. Have you made sure that your files and folders have 644/755?
Can you do anything? Upload files etc?
I have set all the files and folders to 777 and it still fails.
I get these in the console, something to do with a lock file
PATCH https://thehackspace.co.uk/api//pages/testing/lock 403
app.js:1 Error: The JSON response from the API could not be parsed. Please check your API connection.
at app.js:1
app.js:1 DELETE https://thehackspace.co.uk/api//pages/testing/lock 403
Error: The JSON response from the API could not be parsed. Please check your API connection.
at app.js:1
app.js:1 Uncaught (in promise) Error: The JSON response from the API could not be parsed. Please check your API connection.
at app.js:1
Ah, ok, then these HTTP requests are blocked it seems. I suggest you contact your hosting’s support.
Will do, thanks
@Suleiman_Leadbitter:
Someone here in the forum had a problem with “PATCH”. May be you have a similar problem…
Search here in the forum for details.
Please always link to the solution you mean, otherwise this doesn’t help.
@anon77445132 As far as I can see that topic doesn’t provide any more information than what I already said above, that certain HTTP request may be blocked server side.
A short side note about this approach: NEVER ever do this to solve a problem anytime! It is really insecure and usually causes new issues with shared hosting or other setups, for example because it triggers security tools or support teams .
I know, it was just to take it to an extreme
@Suleiman_Leadbitter Have you heard back from support?
Not yet. Posted just before though and now waiting on the response.
@texnixe I can create pages but trying to delete them throws this error if this is a helpful clue.
Yes, that’s what the error messages above already said. It seems as if certain HTTP requests, namely PATCH and DELETE do not work. Different API calls in the Panel use different methods, as you can see here for files for example:
While a pages create route send a POST request, e.g.
'pattern' => 'pages/(:any)/children',
'method' => 'POST',
'action' => function (string $id) {
return $this->page($id)->createChild($this->requestBody());
}
That explains why certain calls work and others don’t.