CSV export not working for my lists

Status
Not open for further replies.

jcc

Member
I am running J! 2.5.7 & Fabrik 3.0.6.3 + the 2-Oct github on the public site and 29-Oct github on development with the same results.

I have 3 lists that are filtered. I cannot export any of them - I get the:

"Loading
0 / records.
saving to"

and then the popup with:

"No records available for CSV export"

that others have noted. Using my chisel-and-tablet debugging (still haven't got Eclipse configured on my system) I was able to get to the getTotalRecords call from components\com_fabrik\views\list\view.csv.php which seems to be generating a query with a where clause like:

Code:
WHERE 1 = -1
This will obviously return 0.

Somewhere my supplied query (clipped from Firebug Post Source) is getting trounced.

Code:
excel=0&inctabledata=1&incraw=0&inccalcs=0&incfilters=1&fields[mailing_labels___account_name]=1&fields[mailing_labels___address_line1]=1&fields[mailing_labels___address_line2]=1&fields[mailing_labels___address_line3]=1&fields[mailing_labels___address_line4]=1&fields[mailing_labels___zip_code]=1&fabrik___filter
[list_63_com_fabrik_63][value][0]=&fabrik___filter
[list_63_com_fabrik_63][condition][0]=contains&fabrik___filter
[list_63_com_fabrik_63][join][0]=AND&fabrik___filter
[list_63_com_fabrik_63][key][0]=%60mailing_labels%60.%60renew_date%60&fabrik___filter
[list_63_com_fabrik_63][search_type][0]=normal&fabrik___filter
[list_63_com_fabrik_63][match][0]=&fabrik___filter
[list_63_com_fabrik_63][full_words_only][0]=0&fabrik___filter
[list_63_com_fabrik_63][eval][0]=0&fabrik___filter
[list_63_com_fabrik_63][grouped_to_previous][0]=0&fabrik___filter
[list_63_com_fabrik_63][hidden][0]=0&fabrik___filter
[list_63_com_fabrik_63][elementid][0]=1194&start=0&option=com_fabrik&view=list&format=csv&Itemid=0&listid=63&listref=63
Any ideas?
 
[Unlike others, I do not get a CSV file created in the tmp folder which is why I created a new thread rather than adding a 'me too' to the other.]

Looking at the Firebug Post Source for the CSV export AJAX call, I don't see the restrictions I expect:

Code:
excel=0&inctabledata=1&incraw=0&inccalcs=0&incfilters=1&fields[mailing_labels___account_name]=1&fields[mailing_labels___address_line1]=1&fields[mailing_labels___address_line2]=1&fields[mailing_labels___address_line3]=1&fields[mailing_labels___address_line4]=1&fields[mailing_labels___zip_code]=1&fabrik___filter
[list_63_com_fabrik_63][value][0]=&fabrik___filter
[list_63_com_fabrik_63][condition][0]=contains&fabrik___filter
[list_63_com_fabrik_63][join][0]=AND&fabrik___filter
[list_63_com_fabrik_63][key][0]=%60mailing_labels%60.%60renew_date%60&fabrik___filter
[list_63_com_fabrik_63][search_type][0]=normal&fabrik___filter
[list_63_com_fabrik_63][match][0]=&fabrik___filter
[list_63_com_fabrik_63][full_words_only][0]=0&fabrik___filter
[list_63_com_fabrik_63][eval][0]=0&fabrik___filter
[list_63_com_fabrik_63][grouped_to_previous][0]=0&fabrik___filter
[list_63_com_fabrik_63][hidden][0]=0&fabrik___filter
[list_63_com_fabrik_63][elementid][0]=1194&start=0&option=com_fabrik&view=list&format=csv&Itemid=0&listid=63&listref=63
Where clause used to create the list was:

Code:
where mailing_labels.renew_date between '2012-11-01' and '2013-10-31'
which returns the correct number of rows (1765).

The Referer (Firebug) for the AJAX call shows the form used to create the list:

Code:
index.php/component/fabrik/list/63?Itemid=278&resetfilters=1&mailing_labels___renew_date[value][]=2012-11-01&mailing_labels___renew_date[value][]=2013-10-31&mailing_labels___renew_date[condition]=BETWEEN

In the AJAX call, I don't see the date values being passed. Is that the problem?
 
Could you give me a bit more background on how and where you are appliying the where cause to the list? e.g is it a prefilter, a querystring filter, in the menu item link.

Is your list set to require filters?

-Rob
 
Sorry for the vagueness.

The list has no pre-filter. This is a query string that is generated using a redirect plugin:

Code:
index.php/component/fabrik/list/63?Itemid=278&resetfilters=1&mailing_labels___renew_date[value][]={form_mailing_labels___bdate}&mailing_labels___renew_date[value][]={form_mailing_labels___edate}&mailing_labels___renew_date[condition]=BETWEEN
The list is set to require filters. If I change require filters to no, it correctly creates the CSV (but all rows, not just the ones I want) for download, however (perhaps unrelated) the download includes some fabrik_* columns in the output?!?

Code:
            fabrik_select   fabrik_view_url   fabrik_edit_url   fabrik_view   fabrik_edit   fabrik_actions       
  /index.php/component/fabrik/details/58/   /index.php/component/fabrik/form/58/?Itemid=0
 
I can't replicate this isuse,

I have my list set to require filters
I use this as a url to view the list:
http://localhost/fabrik30x/index.php/element-test?element_test___id=90

This shows me one record in the list

I press the csv export button

One record (id = 90) is exported as expected.

I dont see the fabrik_select columns exported either, that was something that was fixed a while ago, so perhaps you should try updating from github to see if the issue is resolved?

-Rob
 
I will have to try updating github when I get back from traveling. I didn't bring my development laptop with me.

BTW - I had found the 'export fabrik_select columns' in github. It had been fixed long before the version that I am running. I assume it all made it into the master stream, but have not specifically looked.
 
I just tried today's github and I still get the same error as the 2-Oct github on the public site and 29-Oct on development.

On the chance that it had something to do with the BETWEEN I'm using for the selection criteria or selecting on a date column, I tried:

Code:
http://localhost/dev/index.php/component/fabrik/list/63?resetfilters=1&mailing_labels___account_id=10454

...which works; creates a list and lets me export as a CSV. The CSV file is exactly as expected (no fabrik_select, etc. columns).

So next, I tried a between on the ID column:

Code:
http://localhost/dev/index.php/component/fabrik/list/63?resetfilters=1&mailing_labels___account_id[value][0]=10454&mailing_labels___account_id[value][1]=10455&mailing_labels___account_id[condition]=BETWEEN

...which fails; it creates the expected list but fails to export as the original problem statement.

So I try an equality on a date column:

Code:
http://localhost/kiawah-pog-dev/index.php/component/fabrik/list/63?resetfilters=1&mailing_labels___renew_date=2013-02-28

...which also fails; it creates the expected list but fails to export as the original problem statement.

It seems the BETWEEN and using a date column, individually or together, triggers the problem.
 
I have tried my 3 tests again after reverting my laptop to the released Fabrik 3.0.6.3 kit; all 3 succeed. Some github change between the 3.0.6.3 release and 2-Oct introduced the problem.

To reiterate, the following provides a CSV in the github that I have tested from 2-Oct, 29-Oct and 12-Nov:

Code:
?resetfilters=1&mailing_labels___account_id=10454
The two following fail to produce a CSV in the github that I have tested from 2-Oct, 29-Oct and 12-Nov:

Code:
?resetfilters=1&mailing_labels___account_id[value][0]=10454&mailing_labels___account_id[value][1]=10455&mailing_labels___account_id[condition]=BETWEEN

?resetfilters=1&mailing_labels___renew_date=2013-02-28

To summarize, failures to export CSV when:

  1. using BETWEEN condition
  2. limiting based on a date field
 
ok I've tried fixing this in github - could you update and confirm please?

thx
Rob
 
I just applied 19-Nov github. I still see the same error. According to firebug net tab, the post data still doesn't seem to include the BETWEEN or the second date value.

Code:
excel=0&inctabledata=1&incraw=0&inccalcs=0&custom_qs=&incfilters=1&fields[mailing_labels___account_name]=1&fields[mailing_labels___address_line1]=1&fields[mailing_labels___address_line2]=1&fields[mailing_labels___address_line3]=1&fields[mailing_labels___address_line4]=1&fields[mailing_labels___zip_code]=1&fabrik___filter
[list_63_com_fabrik_63][value][0]=2012-11-13&fabrik___filter
[list_63_com_fabrik_63][condition][0]=contains&fabrik___filter
[list_63_com_fabrik_63][join][0]=AND&fabrik___filter
[list_63_com_fabrik_63][key][0]=%60mailing_labels%60.%60renew_date%60&fabrik___filter
[list_63_com_fabrik_63][search_type][0]=normal&fabrik___filter
[list_63_com_fabrik_63][match][0]=&fabrik___filter
[list_63_com_fabrik_63][full_words_only][0]=0&fabrik___filter
[list_63_com_fabrik_63][eval][0]=0&fabrik___filter
[list_63_com_fabrik_63][grouped_to_previous][0]=0&fabrik___filter
[list_63_com_fabrik_63][hidden][0]=0&fabrik___filter
[list_63_com_fabrik_63][elementid][0]=1194&start=0&option=com_fabrik&view=list&format=csv&Itemid=0&listid=63&listref=63
Attached image shows the firebug window.
 

Attachments

  • csv export failure between dates.JPG
    csv export failure between dates.JPG
    145.7 KB · Views: 341
can you PM me an ftp account and admiin access to the site and also the url of the list in question. I'll try to take a look

-Rob
 
the first thing I would do on the dev site is to update to the latest github. Its impractical to do that with etxplorer. Can you give me an (s)ftp account please
 
Dev site updated with 30-Nov github; verified still broken. PM with credentials sent for site and sftp.

To reproduce:

Login
Main Menu -> Special Functions -> Mailing Labels
List Type: Members
Begin Date: 30-Nov-2012
End Date: 29-Nov-2013

Try to export resulting list.

Thanks!
 
I've fixed this partially, the issue was that whilst you were assigning a ranged querystring filter for the start and end dates, the element was set to not be a filter, leading to inconsistencies between how the element handled the ranged data and what it was expecting (which by default is a single value)

The changes in the code mean that this is now a partially working set up, in that you can use the search form to search for ranged values, and export that list via csv. But when you navigate to the next page of results the csv export will no longer work

An alternative would thus be to set the element to be a ranged filter as well. In which case export works even after pagination.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top