Closed MaluNoPeleke closed 2 years ago
The snippet call has changed slightly in the new version:
<?= snippet('twitter/tweets', ['cachename' => 'yourcachename', 'media' => true, 'params' => ['screen_name' => $screenName, 'tweet_mode' => 'extended', 'count' => 20, 'exclude_replies' => true]])?>
It sounds like you have updated code inside the snippet, but not the call to it in the template. The first option is the name of the cache file you want to store the data in - usually this will be the user name or tweet id, but you can set it to anything.
Sorry, I forgot about that step, that's correct. Now I changed it to this:
<?= snippet('twitter/tweets', ['cachename' => 'twittercache', 'media' => true, 'params' => ['screen_name' => 'mynameontwitter', 'tweet_mode' => 'extended', 'count' => 20, 'exclude_replies' => true]])?>
but then it throws me this error message:
TypeError thrown with message "Argument 2 passed to HashAndSalt\Twitter\Twitter::twitterCache() must be an instance of HashAndSalt\Twitter\mixed, array given, called in /var/www/virtual/user/dev.domain.tld/site/plugins/kirby3-twitter/src/classes/Twitter.php on line 90"
Stacktrace:
28 TypeError in /var/www/virtual/user/dev.domain.tld/site/plugins/kirby3-twitter/src/classes/Twitter.php:163
27 HashAndSalt\Twitter\Twitter:twitterCache in /var/www/virtual/user/dev.domain.tld/site/plugins/kirby3-twitter/src/classes/Twitter.php:90
26 HashAndSalt\Twitter\Twitter:tweet in /var/www/virtual/user/dev.domain.tld/site/plugins/kirby3-twitter/index.php:23
25 Kirby\Cms\Page:{closure} in [internal]:0
24 Closure:call in /var/www/virtual/user/dev.domain.tld/kirby/src/Cms/HasMethods.php:43
23 Kirby\Cms\Page:callMethod in /var/www/virtual/user/dev.domain.tld/kirby/src/Cms/Page.php:171
22 Kirby\Cms\Page:__call in /var/www/virtual/user/dev.domain.tld/site/plugins/kirby3-twitter/snippets/tweets.php:3
...
@MaluNoPeleke Oh hrm odd, works fine for me locally. Let me take a look.
Okay, let me know if you need anything else for debugging it.
Did you already have the chance to take a look at it? If there is anything to support you with solving it you can contact me.
@MaluNoPeleke Running the plugin on php 8 works fine. are you able to switch up at all?
This indeed solved the problem, thanks. Would be great if you could mention the requirement of PHP 8.0. Nothing else so far had this as a requirement.
@MaluNoPeleke there is a note at the top of the readme to says it was tested on PHP 8 and kirby 3.6. That has been there since the new version was released.
After updating from 1.0.2 to 1.0.3 and adapting the API changes I still get the following error message:
My snippet at the moment looks like this:
I didn't do any other changes than the modified snippet and the addition of bearer and API version in the config. How to fix this?