Forums

2 functions in switch about upload

emmexx 27 Oct, 2020
Sometime I use a switch to check a condition, show a message and do a redirect, something like:
{var/empty:myFunction}

true:{error:Wrong value}{redirect:myEvent}

Now I tried the same logic to check an upload function:

{var/empty:UploadFn}
true:{error:wrong file type}{redirect:myEvent}

but it doesn't work. Instead of redirecting a blank page is displayed.

To get the expected behaviour I had to create 2 switches like the following:
{var/empty:UploadFn}
true:{error:wrong file type}

and
{var/empty:UploadFn}
true:{redirect:myEvent}

maxx
Max_admin 27 Oct, 2020
Hi maxx,

Well, the latest v7 has a Connectivity mode which simplifies this by being able to call full actions blocks, you do not need to do these tests anymore, just setup the whole thing and call the root action.

I would recommend that you try it and post your feedback since you are a long time Chrono user!

Thank you!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.