Closed (fixed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2011 at 18:08 UTC
Updated:
16 Feb 2012 at 08:52 UTC
Hi, there is error while importing data from CSV file on PHP 5.2. It gives me message:
fgetcsv() expects at most 4 parameters, 5 given
File /Users/alex/Sites/hosts/drupal/sites/default/modules/migrate/plugins/sources/csv.inc, line 129Here is a code:
while ($row = fgetcsv($this->result, $this->fgetcsv['length'], $this->fgetcsv['delimiter'], $this->fgetcsv['enclosure'], $this->fgetcsv['escape'])) {
I've found that last parameter escape was added only in PHP 5.3. When I remove it, everything works. So, we need some workaround for other PHP versions.
And another minor bug. In the file csv.inc on line 104 you have:
migrate_instrument_stop('MigrateSourceSQL execute');
but I'm sure it must be
migrate_instrument_stop('MigrateSourceCSV execute');
Comments
Comment #1
moshe weitzman commentedCommitted. thanks ... Most functions don't care if you pass extra params. Odd.
Comment #3
pounardFrom https://github.com/pounard/fat-csv-reader/blob/master/lib/CsvSmoothReade...
Later: