mauricerenck / kirby-podcaster

Kirby Podcast Plugin
https://podcaster-plugin.com
48 stars 4 forks source link

Conflict with toFile() #63

Closed vb-git closed 8 months ago

vb-git commented 8 months ago

Hi, I'm using clean install of Zero One theme. If i add podcaster to it, i'm faced with the following error on each call of the toFile() function:

Example call: <?php if($img = $article->cover()->toFile()): ?>

Error thrown with message "Call to a member function toFile() on null"

Stacktrace:

9 Error in /var/www/-/html/site/plugins/zero-one/templates/blog.php:31

8 include in /var/www/-/html/kirby/src/Filesystem/F.php:425

7 Kirby\Filesystem\F:loadIsolated in /var/www/-html/kirby/src/Filesystem/F.php:364

6 Kirby\Filesystem\F:Kirby\Filesystem{closure} in /var/www/-/html/kirby/src/Filesystem/F.php:372

5 Kirby\Filesystem\F:load in /var/www/-/html/kirby/src/Toolkit/Tpl.php:36

4 Kirby\Toolkit\Tpl:load in /var/www/-/html/kirby/src/Template/Template.php:155

3 Kirby\Template\Template:render in /var/www/-/html/kirby/src/Cms/Page.php:1071

2 Kirby\Cms\Page:render in /var/www/-/html/kirby/src/Cms/App.php:800

1 Kirby\Cms\App:io in /var/www/-/html/kirby/src/Cms/App.php:1239

0 Kirby\Cms\App:render in /var/www/-/html/index.php:17

What i have tried:

I hope you can help me and this is enough info, if not please let me know what you need.

mauricerenck commented 8 months ago

Hi,

this sounds like a naming conflict. The plugin defines the page method ˋcover()ˋ for getting the podcast cover image. I guess you or the theme also uses a field named cover.

If you can rename the field, this would be a quick workaround. I will think about how to rename the plugin method, the name is a bad choice as it is too common, I didn't think about that.

vb-git commented 8 months ago

Oh yes that could very well be it. I now know how i can work around this, thank you very much!!

vb-git commented 8 months ago

64 closes this issue. Thanks for the merge!