grav-plugin-assets
grav-plugin-assets copied to clipboard
The Assets Plugin Can Break The Form Plugin Modular Page Support
This code block breaks modular pages support in the grav forms plugin somehow (didn't dig it deep):
assets.php
public function onPageInitialized()
{
// ...
// Initialize all page content up front before Twig happens
if (isset($page->header()->content['items'])) {
foreach ($page->collection() as $item) {
$item->content(); // <-- HERE
}
} else {
// ...
}
// ...
}
The "form" instance of "Grav/Plugin/Form" seems not "visible" in the form.html.twig template; Or it is never called after module content() calls produce some stuff already before the event "onTwigSiteVariables" which is important for the Forms plugin... Not sure...
It might be the page http://demo.getgrav.org/deliver-skeleton/contact is also broken due to the same problem. The page has an empty form in the generated sources instead of a contact form.
If I comment out the above for cycle my contact form is generated successfully.
Replicated. Calling $item->content(); makes the form disappear. @rhukster any clue why this might happen?
I've got the same problem. As soon as I enable the Assets plug-in, modular forms are no longer populated. The form's container HTML is still rendered, but no dynamic content, such as input fields and buttons is created.
Might be related to https://github.com/getgrav/grav-plugin-shortcode-core/issues/47 ?