Phonebook Import Issue on FOP2 2.29

  1. 9 years ago

    Hi, Thanks for this really nice FOP2 ... :)

    I got an issue when importing csv on phonebook. it said 15 record imported but when check on db it's there with empty value on each field.

    This does not happen on 2.28 though. Only on 2.29

    mysql> select * from visual_phonebook;
    +----+-----------+----------+---------+--------+--------+-------+---------+---------+---------+
    | id | firstname | lastname | company | phone1 | phone2 | owner | private | picture | context |
    +----+-----------+----------+---------+--------+--------+-------+---------+---------+---------+
    | 63 |           |          |         |        |        |       |         | NULL    |         |
    | 62 |           |          |         |        |        |       |         | NULL    |         |
    | 61 |           |          |         |        |        |       |         | NULL    |         |
    | 59 |           |          |         |        |        |       |         | NULL    |         |
    | 60 |           |          |         |        |        |       |         | NULL    |         |
    | 58 |           |          |         |        |        |       |         | NULL    |         |
    | 56 |           |          |         |        |        |       |         | NULL    |         |
    | 57 |           |          |         |        |        |       |         | NULL    |         |
    | 55 |           |          |         |        |        |       |         | NULL    |         |
    | 53 |           |          |         |        |        |       |         | NULL    |         |
    | 54 |           |          |         |        |        |       |         | NULL    |         |
    | 51 |           |          |         |        |        |       |         | NULL    |         |
    | 52 |           |          |         |        |        |       |         | NULL    |         |
    | 49 |           |          |         |        |        |       |         | NULL    |         |
    | 50 |           |          |         |        |        |       |         | NULL    |         |
    +----+-----------+----------+---------+--------+--------+-------+---------+---------+---------+
    15 rows in set (0.00 sec)

    Can you please give me a clue on this ? ... is this a bug or some changes need to be done on server ?

    Thanks

  2. admin

    9 Apr 2015 Administrator

    Without having access to the CSV file its hard to say.. you can send it to me privately if you want and I can test it out.

  3. Hi Nicolás,

    Thanks for your reply, i have attach the csv file for testing.

    Really appreaciate it ... :)

  4. admin

    9 Apr 2015 Administrator

    I have tried that file and worked perfectly for importing on my system. File is in DOS format, tried converting to UNIX format and worked too.. So, I have no idea why are you having issues?

  5. I just try once more and it's still not working. i did not know what's wrong ... but i can only add phone book using add button.

    Thanks for the help

  6. I had the exact same problem.

    Turns out that mysql_real_escape_string doesn't return any data on my system (for whatever reason).

    When I change the following line in fop2/lib/dbgrid.php:
    FROM:
    $misdatos[]=mysql_real_escape_string(trim($columns[$nro]));
    TO:
    $misdatos[]=mysql_escape_string(trim($columns[$nro]));

    The import succeeds.

  7. admin

    19 Jun 2015 Administrator

    As I replied on another post, thanks to the tip by Don, I made an alternate dbgrid.php version, try replacing your current one with this and see if it fixes the problem.

  8. Edited 9 years ago by initial-z

    Hi Don and Nicolás,

    Thanks for the tips ... it works ... :)

or Sign Up to reply!