getgrav / grav-plugin-assets

Grav Assets Plugin
https://getgrav.org
MIT License
17 stars 4 forks source link

The Assets Plugin Can Break The Form Plugin Modular Page Support #3

Open dmitry-v-vlasov opened 8 years ago

dmitry-v-vlasov commented 8 years ago

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.

dmitry-v-vlasov commented 8 years ago

If I comment out the above for cycle my contact form is generated successfully.

flaviocopes commented 8 years ago

Replicated. Calling $item->content(); makes the form disappear. @rhukster any clue why this might happen?

gmpreussner commented 6 years ago

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.

gmpreussner commented 6 years ago

Might be related to https://github.com/getgrav/grav-plugin-shortcode-core/issues/47 ?