# “An unexpected error occurred” when editing+saving content, even as Admin

**URL:** <https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185>\
**Category:** Questions\
**Tags:** v2\
**Created:** [April 8, 2017, 6:55am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185 "2017-04-08T06:55:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlb](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/tlb/32/3123_2.png) [@tlb](https://forum.getkirby.com/u/tlb)\
**Post date:** [April 8, 2017, 6:55am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/1 "2017-04-08T06:55:27Z")

</div>

I’ve recently put a site online and made some changes to the content while it was online. I have come back to find that the content is no longer able to save changes to some fields — I get “An unexpected error occurred” when trying to do so.

I am stumped as to why this is all of a sudden happening. I can edit content in the Site options panel, but not in the single page which I have put together.

---

<div class="post-metadata">

**Author:** ![anon77445132](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon77445132](https://forum.getkirby.com/u/anon77445132)\
**Post date:** [April 8, 2017, 8:23am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/2 "2017-04-08T08:23:00Z")

</div>

Did you check all points at [Installation issues](https://getkirby.com/docs/developer-guide/troubleshooting/installation) and [Debugging](https://getkirby.com/docs/developer-guide/troubleshooting/debugging) from the docs?  
Have you checked the permissions and the groups on your websever?

Good luck!

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [April 8, 2017, 8:52am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/3 "2017-04-08T08:52:42Z")

</div>

a broken field or some other error with the panels js? try uploading panel and fields again.

field labels might need `"Hell:o"` if using colon.

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [April 8, 2017, 9:17am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/4 "2017-04-08T09:17:42Z")

</div>

or broken hook could also cause this error.

---

<div class="post-metadata">

**Author:** ![tlb](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/tlb/32/3123_2.png) [@tlb](https://forum.getkirby.com/u/tlb)\
**Post date:** [April 16, 2017, 11:29pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/5 "2017-04-16T23:29:34Z")

</div>

For some unknown reason, I’ve come back to the issue a week later and it’s fixed itself! I honestly have no idea why, but I would be sharing a screenshot of the dialogue box otherwise. I haven’t made any changes to the site since I lodged this question, so that’s peculiar.

I had checked permissions and installation issues, but I have another occurrence of Kirby running on another web-server from the same provider with no issues. Again, it was an error that was only occurring on some back-end pages and not others.

I will come back if it occurs again. Thanks for your suggestions thus far!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 17, 2017, 9:53am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/6 "2017-04-17T09:53:40Z")

</div>

I’m marking this as solved, thanks for reporting back.

Maybe it was some sort of caching problem after all.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 24, 2017, 11:01am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/9 "2017-04-24T11:01:46Z")

</div>

Things you could try/check:

- Clear the browser cache
- re-upload the Panel folder
- are there any empty field folders in site/fields?
- does the error persist if you remove the plugin?
- are you using any hooks?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 24, 2017, 2:41pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/11 "2017-04-24T14:41:04Z")

</div>

Has this come up after an update or did this exist all the time? Have you made any changes to any blueprints?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 24, 2017, 4:33pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/13 "2017-04-24T16:33:42Z")

</div>

Personally, I haven’t had problems with underscores or camelCase, but that may depend.

I have come across this kind of error quite a few times, usually caused by errors when developing custom fields or when something is wrong in a hook. But if you don’t use plugins or hooks, then that obviously can’t be the cause.

Have you had a chance to test the site on localhost?

---

<div class="post-metadata">

**Author:** ![wallubee](https://avatars.discourse-cdn.com/v4/letter/w/22d042/32.png) [@wallubee](https://forum.getkirby.com/u/wallubee)\
**Post date:** [June 10, 2017, 1:27am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/16 "2017-06-10T01:27:55Z")

</div>

I can confirm my website have this issue too. Strange thing is, when I dump my live site and install it in localhost, editing work like a charm. No error.

---

<div class="post-metadata">

**Author:** ![Perry](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/perry/32/1336_2.png) [@Perry](https://forum.getkirby.com/u/Perry)\
**Post date:** [August 10, 2017, 8:58pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/17 "2017-08-10T20:58:05Z")

</div>

@tlb maybe it’s the spamfilter

> [@Textfield error](https://forum.getkirby.com/t/textfield-error/8188/15):
>
> I don’t think so, as I said, I can’t reproduce this and if it was a trigger, it wouldn’t work anywhere, would it?

---

<div class="post-metadata">

**Author:** ![horoman](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/horoman/32/16041_2.png) [@horoman](https://forum.getkirby.com/u/horoman)\
**Post date:** [September 21, 2017, 8:50pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/18 "2017-09-21T20:50:17Z")

</div>

I have the same issue too my client report this after several months…

1. I’ve have the same JS alert message
2. I’ve got 2 console 404 errors for edit and keep
3. This is my server error log:

```auto
[21-Sep-2017 20:11:25 UTC] PHP Stack trace:
[21-Sep-2017 20:11:25 UTC] PHP 1. {main}() /home/gieffevr/public_html/index.php:0
[21-Sep-2017 20:11:25 UTC] PHP 2. require() /home/gieffevr/public_html/index.php:6
[21-Sep-2017 20:11:25 UTC] PHP Warning: include(): Failed opening '/home/gieffevr/public_html/kirby/vendor/autoload.php' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/gieffevr/public_html/kirby/bootstrap.php on line 7
[21-Sep-2017 20:11:25 UTC] PHP Stack trace:
[21-Sep-2017 20:11:25 UTC] PHP 1. {main}() /home/gieffevr/public_html/index.php:0
[21-Sep-2017 20:11:25 UTC] PHP 2. require() /home/gieffevr/public_html/index.php:6
[21-Sep-2017 20:11:25 UTC] PHP Fatal error: Call to undefined function load() in /home/gieffevr/public_html/kirby/bootstrap.php on line 10

```

---

<div class="post-metadata">

**Author:** ![horoman](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/horoman/32/16041_2.png) [@horoman](https://forum.getkirby.com/u/horoman)\
**Post date:** [September 21, 2017, 9:24pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/19 "2017-09-21T21:24:17Z")

</div>

**Update 2:**

Ok in my case it is happening only on the url field type when the content begins with http:// or https:// it gives me an error and it breaks save state completely…

---

<div class="post-metadata">

**Author:** ![felixbridell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixbridell/32/6626_2.png) [@felixbridell](https://forum.getkirby.com/u/felixbridell)\
**Post date:** [November 24, 2017, 2:35pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/20 "2017-11-24T14:35:57Z")

</div>

Same problem for me on my live environment, localhost works fine. I tried to update to Kirby 2.5.7 but the error is still there. I don’t have any plugins or hooks.

The Console in Chrome Dev Tools give me

```auto
Uncaught SyntaxError: Unexpected token <

```

from `js?v=2.5.7:1`

The content of the file if I click on it in Dev Tool is:  
`<?php`

A file which looks in the dev tools to exist at panel/plugins/js?v=2.5.7 but that file does not exist and what is it?

---

<div class="post-metadata">

**Author:** ![luxlogica](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/luxlogica/32/437_2.png) [@luxlogica](https://forum.getkirby.com/u/luxlogica)\
**Post date:** [July 22, 2018, 4:01am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/21 "2018-07-22T04:01:00Z")

</div>

I’m experiencing the same issue, with a current client. The site has been up and running fine for a few months. Then today we received a call from the client, stating that they were being unable to update some of the information on the site.

The client has multiple locations, so we setup a structure field, where the client can copy+paste google map ‘embed’ code, which then gets displayed on the site. Should be pretty simple - and it has been working fine so far. The client had accidentally deleted the google embed code, and was trying to copy+paste them back into the structure field - but it wouldn’t let him… Here is what happens:

- If the client enters ‘empty’ or plain text into the field, they can save it - no problem
- if the client enters the google embed code, they get the error message:  
 ![45%20pm](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/4/4cdae5140b3ec87fef4ab1c82dcb434e34554597.png)

In Safari’s console, we get the following error:

 ![08%20pm](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/a/a23c8838701490596e536ce5a5dff6df05bc37f4.png)

I’m guessing that the Panel is trying to update info via AJAX, and it’s failing because of some kind of server configuration.

I’ve downloaded a complete copy of the client’s site to my local computer, and also uploaded it to our staging server. Both on my local computer AND on the staging server the site works flawlessly - I can save the google embed code without any errors.

I then tried comparing the PHP setup on the client’s production server, and on our staging server - there doesn’t seem to be any disparity between PHP extensions or options.

Everything _seems_ to point out to a server issue, but it would be easier to convince the client if we _actually knew_ what the issue was… ☹

---

<div class="post-metadata">

**Author:** ![gillesvauvarin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gillesvauvarin/32/2351_2.png) [@gillesvauvarin](https://forum.getkirby.com/u/gillesvauvarin)\
**Post date:** [September 4, 2018, 10:41am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/22 "2018-09-04T10:41:01Z")

</div>

Any solution found for this bug ? My client reports it to me from time to time.  
It’s often due to just one word in the texte, when I replace this word, I’m able to update the page.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 4, 2018, 11:06am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/23 "2018-09-04T11:06:06Z")

</div>

I’ve created an issue on GitHub: [https://github.com/getkirby/panel/issues/1150](https://github.com/getkirby/panel/issues/1150)

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [September 6, 2018, 3:44pm UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/24 "2018-09-06T15:44:18Z")

</div>

@luxlogica @gillesvauvarin Could you please post your PHP error log? The error message itself could point to anything as it’s not thrown by Kirby itself.

---

<div class="post-metadata">

**Author:** ![gillesvauvarin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gillesvauvarin/32/2351_2.png) [@gillesvauvarin](https://forum.getkirby.com/u/gillesvauvarin)\
**Post date:** [September 13, 2018, 11:21am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/25 "2018-09-13T11:21:29Z")

</div>

Unfortunately, I don’t have access to my customer web server but I will send him an email to know if he can send me its php error log

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [September 13, 2018, 11:43am UTC](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185/26 "2018-09-13T11:43:53Z")

</div>

By the way, if you don’t want to post the logs publically, you can also send them to me via email at lukas@.

[Next page](https://forum.getkirby.com/t/an-unexpected-error-occurred-when-editing-saving-content-even-as-admin/7185.md?page=2)
