trilbymedia / grav-plugin-flex-objects

Powerful and supremely flexible object support for Grav
MIT License
38 stars 10 forks source link

Field 'file' in Page blueprint throws error since commit 7d497cc #149

Open pamtbaau opened 2 years ago

pamtbaau commented 2 years ago

When using field file in a Page blueprint, AbstractController throws error at line 191: "Call to a member function getName() on null"

This happens since commit 7d497cc.

When reverting the commit, all goes well.

By the way, how about the warning in the docs about using field file in Page blueprints? Is that still valid?

mahagr commented 2 years ago

@pamtbaau Try my change.

pamtbaau commented 2 years ago

@mahagr, All goes well now... Thanks!

By the way, is the warning in the docs NOT to use field file in a Page blueprint still valid?

The file field is intended to be used by configuration, theme, and plugins blueprints, NOT page blueprints. For pages, you should use the existing pagemedia field and then utilize the filepicker field to select the files.

mahagr commented 2 years ago

Hmm, I think the file field should now work better than it used to.

pamtbaau commented 2 years ago

Would you like me to create a PR to revert commits #80e85a7 and #29d2d99 on the file field?

mahagr commented 2 years ago

I think the file field works as long as you use the new pages admin, but if you have it disabled, you'd run into those issues again. So yeah, maybe, but only if you're using the latest stuff.