PDA

View Full Version : Wrong redirect if you click any link other than cancel or save


cworks
05-24-2006, 10:34 PM
Hi,

Ja_submit is a very nice component and I am a happy user.
I have one issue like when a user clicks any other link while is is on Ja_submit page submiting content, we get a warning saying "Please either cancel or save the change" when we click OK, Ja_submit is not getting redirected to the submit page, instead going to a 404 not found page.

Example:
this is submit url relative to the domain "component/option,com_ja_submit/Itemid,58/"
getting redirected to this "component/option,com_/Itemid,0/ja_submit/" and getting 404.

I was actually submitting article and accidentally I clicked another link in the menu and I lost all what I have typed till then. :((

Please look at this problem may be a bug.

FIX:

I found the problem and it is with SEF, to overcome the above problem we have to redirect the JA Submit window upon false exit to the right item ID, to do this:
Edit ja_submit.html.php

you have to replace line 119

window.location="<?php echo sefRelToAbs("index.php?option=com_ja_submit");?>";

with

window.location="<?php echo sefRelToAbs("index.php?option=com_ja_submit&Itemid=xx");?>";

xx = whatever your item ID is, to find your Item ID, disable whatever SEF you have enabled then go to ja_submit form and note the item ID and replace the xx above. You can even find the item ID from admin panel, but do whatever you are comfortable with.

Once you are done doing the above edit, now you will not encounter any 404 when sef url's are enabled and Ja_submit redirects to the right page on false exit.