phyzical

ah nvm.. i think it was a cli .env releative issue

phyzical

am i forced to call some sort of init in _config of each app usage for control of the timing of the env pull?

phyzical

i see the Before and After but thats only for .yml i think?

phyzical

hey all, long time no chats.

so i have an ss3 site, i have a composer dependency that is loading a .env file for environemental varibles.

when wokring with an browser context all seemed to be fine.

but when i go to run phpunit to run tests it seems to be hitting a race condition where the main app config.php loads before the depencies _config.php and doesnt have access to the envs yet.

is there anyway to make this depencies _config.php load first?

nightjarnz

You should be able to render the form (on the page) statically though.

taoceanz

Thanks @nightjarnz Form was being rendered from a shortcode. [formshortcode] > static function formShortcodeHandler() { return Controller::curr()->myForm()->forTemplate(); } function myForm() { return $form; }

That's what I got working and processing in the end yesterday, but at at the time of asking the question, I forgot to fix the form method return to not return the for ready for template. Simple mistake but I missed the issue I'd caused. When submitting to the form, it'd redirect to a new page displaying just the form. function myform() { return $form->forTemplate() }

👍 (1)
nightjarnz

You can't handle a form in static context, no. Because that implies dynamic requests.