Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Are Grav Sites Limited to a Single Form?

Started by Jack Ween 9 years ago · 7 replies · 863 views
9 years ago

When I download the newest Grav admin + default Antimatter theme, enable the Register page for the Login plugin, and also create a "form.md" page of my own (with a form), the Register page's Submit button fails to function. Instead, it just refreshes the page without creating a user as you would expect. If I remove the "form" information from form.md's frontmatter, the Register page properly creates a user.

This is the example form I followed. What am I missing?
https://learn.getgrav.org/forms/forms/example-form

9 years ago

I've found a workaround. It appears that caching was the issue. On the line immediately below

list($forms, $flat_forms) = $this->grav['cache']->fetch($cache_id);

I added $forms = array(); in order to prevent the caching of forms. In hindsight, I'm trying to imagine a scenario in which I would want a cached form post. Are there circumstances where cached form posts would be ideal?

9 years ago

Maybe this would work as well? Then you don't have to hack te code


cache_enable: false

9 years ago

Would this affect only forms? I would think I would want the cache enabled for other pages.

9 years ago

Great! Will this work on register.md as well? My concern is that it will be overwritten by updates to the plugin.

9 years ago

I think the fix is in 1.3.9, but thanks for your help.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 54 12 hours ago
Support · by Anna, 3 days ago
2 60 15 hours ago
Support · by Justin Young, 16 hours ago
1 30 15 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 57 5 days ago