Forums

Redirect not working when user is not logged in

oloccina 15 Oct, 2018
Hello,
I have an issue with a form (V6) posted at the bottom of this page
https://accademiainfinita.it/presenta/nel-vortice-del-cambiamento
UPDATE (I have not changed the fomr with a V5 form, so it's not possible to test the issue, you cna still download a backup of the form below though)

As far as I see when the user submitting the form is NOT logged into his account,
instead of being redirected to
https://accademiainfinita.it/corsi/nel-vortice-del-cambiamento
as he should be, the page just reloads with this new address
https://accademiainfinita.it/presenta/nel-vortice-del-cambiamento?chronoform=iscrizione-vortice-free&event=submit
this time showing the form with a slightly different layout (like if some css rules are missing).
(UPDATE; the redirect to ?chronoform=iscrizione-vortice-free&event=submit has been solved by setting Ajax submit to "YES", but this do not solve the issue)

If the user is instead already logged in, everything goes smoothly.

This form is published through a module directly, is NOT embedded with a shortcode.
I also thought that this could be a cache related issue, but I have disabled the site cache for the whole chronoform6 component through Jotcache (see http://nimb.ws/9V4eQT) so I am not sure what else to do for this (module cache is also disabled for the module).


To test the form here
https://accademiainfinita.it/presenta/nel-vortice-del-cambiamento
UPDATE (I have not changed the fomr with a V5 form, so it's not possible to test the issue, you cna still download a backup of the form below though)

And here is the form backup
[file=11090]Iscrizione_Vortice_FREE_16_Oct_2018_05_58_30.zip[/file]

Thank you!
oloccina 15 Oct, 2018
I am wondering if this could be causes by a "validate fields" in submit section.
I do not have this on all the other forms of Chronoforms6 (and to be honest I am not sure why I have it in this one and what it does exactly...).

healyhatman 15 Oct, 2018
Doesn't work for me at all., just keeps telling me to please provide all the info.
oloccina 16 Oct, 2018
The problem is cause by the "validate fields" as I was suspecting, once I delete that the form works just fine.
oloccina 16 Oct, 2018
I talked too soon. When deleting "validate fields" all my other similar forms work fine, but the one quoted in this post (bottom of the page here https://accademiainfinita.it/presenta/nel-vortice-del-cambiamento) is still having the same issue. Mistery...
oloccina 16 Oct, 2018
Working now... maybe it was a browser cache related issue (although I cleaned it several times...)
oloccina 16 Oct, 2018
Allright... the mistery continues. After testing several times all the forms I see that they work for some time, and then stop working again showing the same issue as described in the main topic.
At first deleting the "validate fields" seemed to solve the issue, but again after testing for 5-10 times each form, the issue appears again.
At this point I have absolutely no idea what is going on, these are pretty simple forms and I don't see any error in Chrome Console.
Hope someone more expert will be able to shed some clarity on all this🙂

Thanks
oloccina 16 Oct, 2018
Could be that I need to set "ajax submit" to yes in the display section. So far it solves the issue, but again I'll wait and test more to see if it presents itself again... lowering my expectations now!
oloccina 16 Oct, 2018
Again not working. This conflict seems to have something to do with user session too, it usually reappears if I test all the form as a guest and test again a regitered user. If then I logout and go testing again, some of them show the issue (and some other not). There's not a clear pattern here.
healyhatman 16 Oct, 2018
Do you maybe have a cache plugin activated that's interfering?
oloccina 16 Oct, 2018
I also thought that this could be a cache related issue, but I have disabled the site cache for the whole chronoform6 component through Jotcache (see http://nimb.ws/9V4eQT) , the single chronoform6 module cache is also disabled.
healyhatman 16 Oct, 2018
Any SH404SEF or other SEO / URL rewriting tools?
oloccina 16 Oct, 2018
nope, just the default joomla system
oloccina 23 Oct, 2018
SO.... I have delved more into this issue.
It seems to happen when a user log-in, visit the page, then log out and visit the page again.

It' s somewhat session related, at first I thought it was also cache realted but I have now tested with the cache completely disabled (and made sure the page was not being cached at all) and the issue still shows.

Comparing the code of the page where the form works (redirect working) and the code of the page where it doesn't (redirect not working)
it seems that some resources are not being loaded when the form doesn't work

here they are:

<link href="https://mysite.com/libraries/cegcore2/assets/semantic-ui/reset.inline.min.css" rel="stylesheet" />
<link href="https://mysite.com/libraries/cegcore2/assets/semantic-ui/site.inline.min.css" rel="stylesheet" />
<link href="https://mysite.com/libraries/cegcore2/assets/semantic-ui/semantic.min.css" rel="stylesheet" />
<link href="https://mysite.com/libraries/cegcore2/assets/semantic-ui/text.css" rel="stylesheet" />
<link href="https://mysite.com/libraries/cegcore2/assets/semantic-ui/fixes.semantic.css" rel="stylesheet" />



jQuery(document).ready(function($){
$.G2.boot.ready();
});

setInterval(function(){jQuery.get("https://accademiainfinita.it/presenta/nel-vortice-del-cambiamento");}, 300000);

jQuery(document).ready(function($){
$.G2.forms.invisible();

$('body').on('contentChange.form', 'form', function(e){
e.stopPropagation();
$.G2.forms.ready($(this));
});

$('form').trigger('contentChange');
});
<script type="text/javascript">
jQuery(document).ready(function($){$("div.G2-joomla").trigger("contentChange");});
</script>

I wonder if there is any possible solution for this.
Thanks for any help!
healyhatman 23 Oct, 2018
Should the form be able to be accessed by a guest user? If not, activate permissions.
oloccina 23 Oct, 2018
Yes, the chronoforms 6 module access is set to "public".
Visiting the form as a guest I can see it and submit it normally.
Is just when I log in > visit thepage > log out > visit the page again that the issue arises.
This topic is locked and no more replies can be posted.