Unable to handle this request(500 Error) while importing CSV File

ashishrij

New Member
I am using ListCsv Plugin to import CSV files.

I have created a file in plugins/fabrik_list/listcsv/scripts called TheFile.php and it has a function called MyFunction($arg) which returns $value.

I have imported that Thefile.php on he listcsv plugin's 'import row PHP file'.

On the 'Import Row php Code', i call MyFunction($args).

When I import a CSV file with just one row(excluding header). It works fine and the MyFunction($args) returns the desired value.

However, while I import CSV with more than two rows(Excluding header) than it does not work and gives me an error - 'is currently unable to handle this request - HTTP '

When I am trying to import CSV with multiple rows, the first row does get processed by the MyFunction and returns what it needs to return(still gives that unable to handle this request error - I confirmed that it does process the first row using the Dump plugin) but not the second row and after that.

Can someone point me out in the right direction?

It is very important for me to call MyFunction, cannot do it any other way. Right now the way I am doing is just copying the function code in the 'Import row PHP code' and running it. The function is very very very long and the same function is used at various other places.

Cheers.
 
Sorry, but I don't think anyone here will be able to tell you what's wrong. Only the usual hints:
- Check server error log.
- Remove your code and test import with a mockup CSV file which doesn't need any mods.
- Double/triple-check your code. The fact that currently it is the same as "used at various other places" is rather worrying... depending on what it does and where else, I'd think that CSV import might require it to be somewhat special.
 
Last edited:
Hi,

Thanks for the response. Trust me I have done everything on my end to figure this out.

The reason why the same code is used in various places is... there are different lists that have one 'common field'.. let's say 'First Name' and I have two lists.. let's say they are 'people from 'Canada' and 'people from 'Australia'.

user can import CSV files on both the list which will have 'First Name' as one of the fields.

What I am trying to do here is trying to find a pattern(using regex) in the 'First name' and do 'Stuff'.

I have to write this same code that finds the pattern in the 'First name' in both the lists CSV import since I am unable to include a file that will have a function where I will pass the 'First Name' and it will find my desired pattern and return the result for me.

Now, imagine I have.. let's say I have 20 different lists with 'First Name' on it and I am trying to find the same pattern in all 'First name'.. then I am writing the same pattern-finding code in 20 different places which can be rather frustrating.
 
Ok... but I don't know how this could help us to help you... so, I fear the answer is still the same.

If there's nothing in error logs explaining the (generic) 500 error and if "regular" imports are working fine, guess then the culprit is your code and it's up to you to debug it.
 
Hi,

If anyone came across the same issue. The solution would be to go to plugins->fabriklist->listcsv->listcsv.php and on the onImportCSVRow() function change 'requre' to 'require_once'
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top