Error after switching to kirby 4

Hi, I tried to switch my local installation to Kirby 4 but now i get this error message:

Whoops \ Exception \ ErrorException (E_USER_DEPRECATED)
Passing a single space as value to Xml::attr() has been deprecated. In a future version, passing a single space won’t render an empty value anymore but a single space. To render an empty value, please pass an empty string.

the error is inside kirby/src/Cms/Helpers.php

        return trigger_error($message, E_USER_DEPRECATED) === true;

What can I do to solve this?

Somewhere in your code you are using a single space charchter as a value, possible to set an empty value if a condition isnt true. If you work your way down the left hand side of the error page, you should see what file is doing that.

You need to change it from ' ' to '' and the error should go away then.

oh, well it seems to be in the kirby-3-seo Plugin, @jimbobrjames you made it, right? is it K4-ready?

when I remove the snippet, everything works…

Ah… yes thats how i learned about the error :slight_smile: ill be releasing a patch soon. in the meantime, you can solve it by changing those three lines in the controller in the plugins index.php file to:

'metaimage'          => $page->shareimage()->toFile() ? $page->shareimage()->toFile()->crop(1280, 720)->url() : '',
'metatwsite'         => $site->socialtwitterurl()->isNotEmpty() ? $site->socialtwitterurl() : '',
'metatwcreator'      => $site->twittercreator()->isNotEmpty() ? $site->twittercreator() : '',

Thanks so much! That was a nice coincidence :smiley: And very, very glad to keep my Go-To SEO plugin in the future :green_heart:

@mafleig A K4 version of the plugin has been released GitHub - HashandSalt/kirby4-seo: An SEO plugin for Kirby CMS V4+ :slight_smile:

p.s thanks for the PayPal donation