-
Notifications
You must be signed in to change notification settings - Fork 83
Problem with filtering #24
Comments
I have no idea of what's going on here. But I did explore some more and found that it's part of a larger pattern. For example, if I filter not by age, but by last name.
{"2":{"nom":"truc","prenom":"paul","age":"12"}} So that's prefixed with
{"1":{"nom":"machin","prenom":"joseph","age":"34"}} It's notable that these prefixes correspond to their positions in the master CSV file—2, and 1. But if I filter based on I don't have the time to fix this just now, but I do want to get some more information recorded about the bug here, for when I have the time, or somebody else might be able to identify and fix the problem. |
Thank you for your two replies. For the problem of filtering, I duplicate the first line of data in the CSV file so in my program, I only care about the line 2, 3, … It’s a workaround but it’s OK. Regards, Philippe JUHEL
|
I know there is no activity on this thread since two years now, but it might be helpful for someone in the future to know that the issue is caused by the line 1349 in class.csv-to-api.php saying:
It is enough to say:
That will fix the problem. |
Can we confirm that this is resolved? |
I use a simple CSV file named data.csv :
name,firstname,age
bidule,marcel,45
machin,joseph,34
truc,paul,12
When I do :
http://timmy.icam-toulouse.fr/i48/?source=http://timmy.icam-toulouse.fr/eleve/data.csv&format=json
I get :
[{"nom":"bidule","prenom":"marcel","age":"45"},{"nom":"machin","prenom":"joseph","age":"34"},{"nom":"truc","prenom":"paul","age":"12"}]
OK
When I do :
http://timmy.icam-toulouse.fr/i48/?source=http://timmy.icam-toulouse.fr/eleve/data.csv&format=json&age=45 (filter age=45, the fisrt row)
I get :
[{"nom":"bidule","prenom":"marcel","age":"45"}]
OK
When I do :
http://timmy.icam-toulouse.fr/i48/?source=http://timmy.icam-toulouse.fr/eleve/data.csv&format=json&age=12 (filter age=12, the third row)
I get :
{"2":{"nom":"truc","prenom":"paul","age":"12"}}
BAD.
Why do I have {“2”: … and not [{"nom":"truc","prenom":"paul","age":"12"}] as I can expect?
The text was updated successfully, but these errors were encountered: