sylvainjule / kirby-embed

Embed field for Kirby 3 and 4.
74 stars 3 forks source link

Sync failed #17

Closed ins01-ship-it closed 1 year ago

ins01-ship-it commented 1 year ago

Hello, I’m relatively new to kirby and php, so excuse my perhaps simple question/problem I'm trying to use the plugin, but I get a sync failed error when pasting a link into the panel. When I open the dev tools it says GET http://localhost:8000/api/kirby-embed/get-data?url=https://www.youtube.com/watch?v=BHvtkTeMia8 400 (Bad Request) which suggests that there may be an issue with the YouTube API key being used by the plugin. Also, I get the following error message {status: ‘error’, error: ‘Creation of dynamic property Embed\Adapters\Youtube::$url is deprecated’}

So far I only installed the plugin, included it in the blueprint

        fields:
          embed:
            label: Video & Audio
            type: embed
            width: 1/2

this is in the php, but I believe that's not where things go wrong, since even if delete that part I still get an error message in the backend

                    <?php 
                    if($embed = $item->embed()->toEmbed()) {
                        echo $embed->code();
                    } ?>
                    <p><?= $item->embed()->titel() ?></p>

thank you for helping!

ins01-ship-it commented 1 year ago

Apparently it has something to do with the php version (8.2), setting error reporting in php.ini to ignore deprecation warnings helped.