OblikStudio / kirby-entity-field

Kirby field that acts as a one-entry structure.
MIT License
48 stars 0 forks source link

Files field not working #2

Closed adamkiss closed 4 years ago

adamkiss commented 4 years ago

Right, so:

Blueprint setup: code

In code (snippet):

<?php $myfield = $site->Myfield()->toEntity(); ?>

<img src="<?= $site->MyfieldImage()->toFile()->url(); ?>">
<img src="<?= $myfield->Image()->toFile()->url(); ?>">

The first one works normally, while the second one (file through the entity plugin) fails with Call to a member function kirby() on null (View: …/site/templates/about.blade.php): CleanShot 2020-02-11 at 14 59 56

In theory - if you've tested it with the files field - it could be because it's on $site, not on normal page? I am not sure.

(Thank you for the plugin!)

hdodov commented 4 years ago

@adamkiss looks like a bug. I'll look at it as soon as I can! Thanks for the report!

hdodov commented 4 years ago

✅ @adamkiss I published version 1.0.1. It should work now.