Front end csv export forming bad URL when SEF is on

Status
Not open for further replies.

usdc-or

Member
I feel like I've encountered this before but I can't find any information about it. When Joomla SEO is on (no URL rewriting), the URL for saving a csv file has part SEF URL and part not, e.g.:

http://mysite.com/index.php/subsection/subsection/index.php?option=com_fabrik&view=list&format=csv&listid=199&start=100&Itemid=1976

Which of course returns a 500 error. Removing the bold text above results in a download. What am I missing?

Thank you,
K
 
Here's the set up. I have SEF on, rewrite off. Source code for the "Download here" button looks like this:
<a href="index.php?option=com_fabrik&amp;view=list&amp;format=csv&amp;listid=53&amp;start=500&amp;Itemid=1840" class="btn btn-success"><i class="icon-download"></i> Download here</a>

But when you copy the link or click the button:
http://mysite/index.php/courtroom-services/pro-bono-program/index.php?option=com_fabrik&view=list&format=csv&listid=53&start=500&Itemid=1840

I think it is probably Joomla appending /index.php/courtroom-services/pro-bono-program/ to your URL, but I can't figure out how to make it stop. And this is just my example, all instances of csv export are doing this.
 

Attachments

  • csv_config.png
    csv_config.png
    50.3 KB · Views: 126
Hmmm. Mine doesn't do that, and I've not run across anyone else with this issue. And I can't think of anything Fabrik could be doing to cause that. We just use a standard relative URL.

Do you have any 3rd party plugins that do anything with links / SEF, or might affect how the base href gets set on the page?

One thing you could try, edit ./media/com_fabrik/js/list.js, around line 509 ...

Code:
                                var finalurl = 'index.php?option=com_fabrik&view=list&format=csv&listid=' + self.id +

... prepend the site URL ...

Code:
                                var finalurl = Fabrik.liveSite + 'index.php?option=com_fabrik&view=list&format=csv&listid=' + self.id +

... which really shouldn't be necessary, but might cure your problem.

You'll need to set JS debug on, in Fabrik's global config, under the Debug tab, select "Debug JS" from the "Enable Debug" dropdown. That will force Fabrik to load the uncompressed files.

If that works, let me know, I'll commit that change and compress the JS, so you can turn debug off.

-- hugh
 
Hi, I am so sorry I did not get back to you on this sooner. I've been out of the office, and there's been fires (figurative fires). I don't have any other extensions (that I know of) that do much with SEF.

After our last exchange, I came up with a similar solution as you've posted above, except instead of prepending the site url I just added "/" and it worked great. It was clear that the culprit was some kind of javascript and it was only overwriting things beginning with "index.php."

Thank you for confirming this was the right route.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top