#1 June 6, 2019 9:19pm

drunkyardgnom
Member
Registered: June 6, 2019
Posts: 2

Passing Data from FormBuilder Extension to a Custom Module

Note: I'm using BigTree 4.2.18. I'm not able to update to the most recent version for technical reasons.

I've got a custom module that I want to pass user-submitted form data to.

The way I chose to accomplish this was by using the FormBuilder extension and using its Post-Process hook to pass data along to a custom class I wrote that processes and then manually inserts the data into the database. I realize this is a bit risky but I wasn't sure of a better method.

I've successfully got the data saving into my custom module using that hook. So the data from the form is essentially linked now to my custom module. No real issue there.

The issue I AM having, however, is that the new data doesn't actually show up in the list until I change the module in some way via the Developer section of the CMS. I'm guessing the data is being cached and when I insert the new data outside the module, it doesn't get properly busted, so it doesn't show up in my custom module until I bust the cache by changing the Module via the developer section.

Is there a way I can manually trigger this cache bust?

I'm also open to suggestions on how this could be set up in a more secure way - maybe if I could display the admin create/edit form of my custom module on the front-end of the site, then I wouldn't need to worry about going through the FormBuilder extension and manually entering the data afterwards. However, for now, I'd like to be able to just bust the cache so that we can have a working prototype.

Last edited by drunkyardgnom (June 6, 2019 9:21pm)

Offline

#2 June 6, 2019 9:23pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 970

Re: Passing Data from FormBuilder Extension to a Custom Module

Yes, the view data is cached. You can clear it on user submission using BigTreeAutoModule::clearCache(“your_table_name”);

There are also methods for caching individual records in the event that you have a ton of data (where recaching all the data would be slow).

Offline

#3 June 6, 2019 9:43pm

drunkyardgnom
Member
Registered: June 6, 2019
Posts: 2

Re: Passing Data from FormBuilder Extension to a Custom Module

That was definitely the issue! Thank you so much for the prompt reply!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.