grav-plugin-flex-objects icon indicating copy to clipboard operation
grav-plugin-flex-objects copied to clipboard

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

Open pamtbaau opened this issue 4 years ago • 5 comments

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?

pamtbaau avatar Oct 30 '21 19:10 pamtbaau

@pamtbaau Try my change.

mahagr avatar Nov 04 '21 07:11 mahagr

@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.

pamtbaau avatar Nov 04 '21 07:11 pamtbaau

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

mahagr avatar Nov 04 '21 12:11 mahagr

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

pamtbaau avatar Nov 04 '21 12:11 pamtbaau

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.

mahagr avatar Nov 04 '21 12:11 mahagr