# setContent() error

**URL:** <https://forum.getkirby.com/t/setcontent-error/14713>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 25, 2019, 5:38pm UTC](https://forum.getkirby.com/t/setcontent-error/14713 "2019-06-25T17:38:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 25, 2019, 5:38pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/1 "2019-06-25T17:38:23Z")

</div>

Hi there!

Kirby is giving me the following error whenever I’m on a certain page.  
I tried deleting and creating the page again. I also set the blueprint to the default blueprint.  
The page is accessible and editable in the panel.

For testing reasons, the template for the page itself does not include any php. Unfortunately, I can’t figure out why it’s throwing that error or what the error means. Google did not help.

Thanks!

 ![24](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/a/a9206e297f8ca336358203b248963d460577a67b.png)

---

<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:** [June 25, 2019, 6:10pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/2 "2019-06-25T18:10:25Z")

</div>

Which Kirby version?

What is inside the content text file?

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 25, 2019, 6:31pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/3 "2019-06-25T18:31:53Z")

</div>

Version 3.0.1

The content file:

`Title: Impressum`

---

<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:** [June 25, 2019, 6:37pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/4 "2019-06-25T18:37:02Z")

</div>

Oh, that’s an old version. Please check if the error persists if you update to the latest version.

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 25, 2019, 7:26pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/5 "2019-06-25T19:26:12Z")

</div>

I updated to version 3.1.4 and the error still persists. : /

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 25, 2019, 7:51pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/6 "2019-06-25T19:51:18Z")

</div>

This is really weird. If I manually rename the folder, the content file, the blueprint and the template to something other than “impressum”, it works.

There’s no other folder or file or reference by the name “impressum”.

---

<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:** [June 25, 2019, 7:59pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/7 "2019-06-25T19:59:33Z")

</div>

I think we should try to narrow it down a bit. What happens if you keep blueprint name , template name and text filename and only rename the folder name?

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 25, 2019, 8:05pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/8 "2019-06-25T20:05:26Z")

</div>

If the blueprint name, the template name and text filename is “impressum” and the folder name is something like “test” it works. If I change the folder name back to “impressum” it throwing the error again.

---

<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:** [June 25, 2019, 8:19pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/9 "2019-06-25T20:19:26Z")

</div>

Are you using any plugins?

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 26, 2019, 12:29pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/10 "2019-06-26T12:29:57Z")

</div>

No, no plugins at all.  
The problem persists in version 3.2.  
Also if the page is only accessible via url – without a number in the folder’s name.

---

<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:** [June 26, 2019, 12:43pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/11 "2019-06-26T12:43:54Z")

</div>

Hm, I have. no idea what’s happening there. Have you deleted the media and session folders after updating and cleared the cache folder and your browser cache?

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 26, 2019, 12:48pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/12 "2019-06-26T12:48:25Z")

</div>

Yeah, everything.

It’s really weird, because it’s just the folder name “3\_impressum” which causes the error. There’re not even any hidden files.

What does the error actually mean “setContent”, TypeError?

---

<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:** [June 26, 2019, 12:50pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/13 "2019-06-26T12:50:58Z")

</div>

It means that the method `setContent()` expects an array or null as parameter but for some reason, it gets an object instead.

Could you send me your project as zip?

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 26, 2019, 12:53pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/14 "2019-06-26T12:53:17Z")

</div>

Ah, ok.

Ok, I’m stripping some content and zipping it.  
Do I send you the zip via PM?

---

<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:** [June 26, 2019, 12:56pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/15 "2019-06-26T12:56:36Z")

</div>

It’s best to upload it to Dropbox or whatever and send me the link via PM

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 26, 2019, 12:56pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/16 "2019-06-26T12:56:48Z")

</div>

Ok

---

<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:** [June 26, 2019, 12:57pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/17 "2019-06-26T12:57:04Z")

</div>

Make sure that the stripped down version still has the error 😉

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 26, 2019, 12:57pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/18 "2019-06-26T12:57:17Z")

</div>

😃

---

<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:** [June 26, 2019, 2:24pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/19 "2019-06-26T14:24:32Z")

</div>

For anyone coming here with the same error: It was caused by a route with the same pattern as the page slug that returned a new page object with the content set to an object instead of an array.

```auto
   [
           'pattern' => 'impressum',
           'action' => function () {
             return new Page([
               'slug' => 'impressum',
               'template' => 'impressum',
               'content' => page('impressum') // content expects an array, not an object
             ]);
           }
         ],

```

---

<div class="post-metadata">

**Author:** ![teh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/teh/32/9669_2.png) [@teh](https://forum.getkirby.com/u/teh)\
**Post date:** [June 26, 2019, 2:30pm UTC](https://forum.getkirby.com/t/setcontent-error/14713/20 "2019-06-26T14:30:11Z")

</div>

Thanks for checking and finding the culprit!

[Next page](https://forum.getkirby.com/t/setcontent-error/14713.md?page=2)
