CSV export works in backend, but not in frontend

Robbert

Member
Hi all,

I encountered some strange behaviour with the CSV export. I can use the export in the backend, it works like a charm. At the frontend the export does not work. It exports 0 rows.

I'm being logged in the backend and the frontend. The behaviour is the same with another user account.

What I'm doing wrong?
 
Hello
Works ok here, so perhaps its a site/options specific issue:

What setting do you have for your list's csv export options?
Can you let us know which URL this is occurring on?

thanks
Rob
 
Hi Rob,

Here's the link: http://enjoycormet.nl

I've made an acount so you can login.

I added Jpagetranslator module at the breadcrums position, so you can get past the language thing ;)

You can find the frontend export at the menubar -> balanslijst -> CSV Export
or
BALANCE liste des feuilles -> CSV Export (when translated to french)

In the backend the list is called "Jacobs Dashboard" as it is named for my collegue whom has to work with it in the future.

I also added extra language packs, for dutch is such a hard language to understand.
 
It seems you have jch_optimize running, can you turn it off?
CSV export is getting a wrong response (<div id="WWMainPage">{"total":"5","count":100,"file":"\/home\/cormetc1\/domains\/enjoycormet.nl\/public_html\/tmp\/i2a57_virtuemart_orders-export.csv","limitStart":0,"limitLength":"100"}</div>)

Better don't post login data in the thread, put it in "My site" informations (so it's only visible to Rob and Hugh).
And it's wise to set list's "Empty" access to nobody;)
 
I turned jch_optimize off, and removed the login data from the previous post.
Turning off jch_optimize did not affect CSV export, still zero rows.

Something bad happened, all the forms don't work anymore in a sudden. When opening a form at the frontend, "error 1: could not connection to database" comes up.
 
Somehow a lot of forms, lists and data are not accessible anymore. I'm getting 500 errors all over the place. It's really strange because a few forms and lists still do work.
 
<div id="WWMainPage">
There is a content or system plugin or possibly your Joomla template which is being naughty and writing content into the raw view Fabrik is using.
Its going to be a bit of trial and error as you have a lot of plugins doing quiet a few different things.

Basically make a note off all of the Joomla system and content plugins that are enabled. then one by one turn them off, and test the csv export page. Use firebug with firefox to examine what happens when you press the export button in the csv export window, when it doesn't work you will see :

Code:
<div id="WWMainPage">{"total":"5","count":100,"file":"\/home\/cormetc1\/domains\/enjoycormet.nl\/public_html\/tmp\/i2a57_virtuemart_orders-export.csv","limitStart":0,"limitLength":"100"}</div>

when the correct plugin is disabled you will see

Code:
{"total":"5","count":100,"file":"\/home\/cormetc1\/domains\/enjoycormet.nl\/public_html\/tmp\/i2a57_virtuemart_orders-export.csv","limitStart":0,"limitLength":"100"}
 
Rob, thanks for your reply.

I made a backup and restored a copy in: enjoycormet.nl/beta/
There I disabled all plugins, except for joomla and fabrik. I used the Beez20 template.

Unfortunately the problems persist. CSV export does still generate: <div id="WWMainPage">

And most lists have lost their CID and generates a 500 error. I'm thinking rebuilding everything ought be faster than troubleshooting?
 
Hmm that's frustrating not to be able to find it with disabling the plugins.
If you fill in an ftp account, I'll download the site and run a search over all the files for the <div id="WWMainPage">, should be fairly easy to find and will hopefully lead us to knowing which part of the site is doing this.
The issue with re-installing everything is that at some point the error will re-appear. I think its best to figure out and fix the root issue

-Rob
 
I have filled in all the information you need in "My Sites", so you can access the ftp and phpmyadmin.
So many thanks for your help!

In the meantime I rebuilded the corrupt forms and got it running again, so the only problem left is the csv export.
I'm eager to know what caused the problem.
 
hi - thanks for that
I've found that its the system plugin 'mainpage' (for use with the component com_ajax_doccart) which is injecting the div into the output.
I've altered the file beta/plugins/system/mainpage/mainpage.php to :

PHP:
<?php
/*------------------------------------------------------------------------
 # plg_mainpage - Pushes the component's content to a DIV tag
# ------------------------------------------------------------------------
# author    Balint Polgarfi
# copyright Copyright (C) 2011 Offlajn.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.offlajn.com
-------------------------------------------------------------------------*/
 
// Ensure this file is being included by a parent file
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' ) ;
 
jimport( 'joomla.plugin' ) ;
$app = JFactory::getApplication();
if (!$app->isAdmin()) {
// Register search function inside Joomla's API
$app->registerEvent( 'onAfterDispatch', 'addIdToMainPage' );
}
 
function addIdToMainPage() {
$app = JFactory::getApplication();
if ($app->input->get('format', 'format') === 'html') {
$document =& JFactory::getDocument();
$buff = $document->getBuffer('component');
$document->setBuffer('<div id="WWMainPage">'.$buff.'</div>', 'component');
}
 
if(@$_REQUEST['only_page'] == 1) {
echo $document->getBuffer('component');
exit;
}
}

So now it will only wrap Joomla's output with the div if the format is html.
 
Rob, thank you so much for this!! Excuse me for the late reply, I was down with the flu last couple of days.

With this problem solved, the company I work for is very happy with Fabrik. It's decided we stay with it and will use it for more advanced forms for their administration tasks.

We'd like to thank you for the outstanding support!
 
I have had time to test the export functionality on several lists today, I think I found a bug;

Export to CSV works fine in front-end and back-end. Unfortunately the filters do not work.

I have a table for all products, when I filter for example "cola" I get all products with cola as result. Then exporting to CSV gives me just all the data in the products table.

All heavy plugins like ajax_dockcart have been disabled, so it could be the template messing things up or it's a bug?
 
hi
What settings do you have or select for the export - there is an option to include/exclude the filters from the export.
 
Hi Rob,

These options below are currently set:

  • Front end options = Yes
  • Include filters = Yes
  • CSV File format = CSVExcel
  • Which Elements = Selected
I haven't updated to the newest github update, shall I do that before we continue troubleshooting?
 
Hi Rob, in the category Bieren are 3 entries in total (1 x amstel, 2 x heineken) Can you try to filter on "amstel" in 'Bieren', then you can see the filter is not picked up by the export to csv.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top