TypeError: Argument #1 ($string) after uploading the website on a host

Hey Everyone,

This is my first website with Kirby, excited for it to be on air
unfortunately after I uploaded the website to the host, whenever I try to upload content from the panel I get this error:

TypeError
Kirby\Toolkit\Str::esc(): Argument #1 ($string) must be of type string, null given, called in /home/u379737048/domains/daleelal-khrijeen.com/public_html/kirby/config/methods.php on line 344

Any ideas why?

this is the line: ```
public static function esc(string $string, string $context = ‘html’): string

Which Kirby version are you using with which version of PHP?

Kirby 3, Not sure how to check for my php version…
this is my website: https://daleelal-khrijeen.com/en

You can check your php version using

<?php
phpinfo();

Well, I would need the exact version, there have been quite a few releases between Kirby 3.0.0 and the current latest 3.8.3…

kirby 3.7.4
php 8.0.24

The issue happens because your field on which you call esc in line 24 in projects.php snippet seems to be empty.

This is something that has been fixed in later versions of Kirby.

So there are two options:

  1. Make sure that the field contains a value or check that in your code before you call esc or
  2. Update Kirby

Thank you Sonia!
I updated the kirby version and it worked!

Happy holidays

Great! Thank you, happy holidays to you, too!