• Resolved taksmith

    (@taksmith)


    If I import a large CSV file (c 1400 entries) the import appears to be OK – I get a table ID, all the columns and rows are there I think. But when I go to list tables, the table shows up as “a” – not the actual name.

    If I click preview I get

    Fatal error: Cannot use string offset as an array in /home/pyroorg/public_html/wp-content/plugins/wp-table-reloaded/controllers/controller-frontend.php on line 220

    and I cannot use the table in a post/page – i get the same error

    I’ve tried importing from a local drive and a URL. I’ve tried getting rid of a date field, and tried ensuring the first row doesn’t contain any unusual field headings (like spaces) -or manually removing the first row – but in eache case I get the same result

    This is a file we do periodically (to update an address list) – and 50% of the time all is fine, the rest we get the sam outcome – and always with the same table name – “a”

    But apart from this – we do use the plugin and like it – thanks.

    Tom

    https://www.ads-software.com/extend/plugins/wp-table-reloaded/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Tom,

    thanks for your post.

    Very likely this is a problem with the character encoding. I have noticed in the past, that certain characters (e.g. from foreign languages) seem to cause trouble with some PHP functions.

    This happens, when the plugin can’t read the table data correctly from the database, which usually happens during the saving of the imported data.
    While the initial import works, the ensuing saving fails, very likely to a problem with the character encoding.
    I was not yet able to find a definite cause or a solution, but usually this helps:
    Check the CSV file (in a text editor) for “special” characters.
    This means for example quotation marks or apostrophes that are not exactly the ones from the keyboard, but more typographically nice ones (i.e. the sometimes look more like an accent instead of an apostrophe '). Then replace those by the “regular” characters.
    It could also help to open the CSV file in Notepad and then “Save as” with a different “Character Encoding” selected

    After that the import and saving process should work as expected and the table should appear fine on the page.

    Regards,
    Tobias

    Thread Starter taksmith

    (@taksmith)

    Many thanks – changing encoding from ANSI to UTF worked fine. I had checked for strange characters – and couldn’t find any.

    Interestingly the first line contains field names and all came in correct – but the first one came in with the Inverted Commas – ie in the table there was

    “Firstname”
    Surname
    DOB

    etc

    Easy to edit out of course

    Hope this helps track it down or helps someone else

    Thanks again

    Tom

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Tom,

    awesome! Thanks for the hints! Yes, UTF-8 is a much better encoding than ANSI for this purpose. Great that this worked!

    Best wishes,
    Tobias

    Thread Starter taksmith

    (@taksmith)

    Tobias

    Really odd – I edited the csv file and took out the inverted commas around the first field name – thinking that it would not import properly – but it did, and did not place the inverted commas around the first field name in the resulting table. All the other field names have inverted commas in the CSV file – but import properly (without them)

    As it is easier to do it in the CSV file than in WordPress (only because the table is sufficiently big that editing/updating takes a while)

    Anyway – again, hope this helps

    Tom

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Tom,

    with “inverted commas”, do you mean quotes?
    Those are used as “escaping characters” in CSV, and are sometimes necessary to clearly define the content of a cell.
    If the cell content is just a single word, they are not necessary, so yeah, removing them beforehand is fine.

    Regards,
    Tobias

    Thread Starter taksmith

    (@taksmith)

    Tobias – yes!

    I just found it a bit odd that the first cell (ie Row 1 column 1) imported and kept the quotes, when all the other cells did not (which is what I expected).

    But anyway, as I said, easy to edit and I appreciate they are not really needed if the content is a single word – in our case it was “FIRSTNAME” – but would have been needed if I’d used “First Name”

    Thanks again

    Tom

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Tom,

    yes, it’s indeed a little bit odd that they are not removed in that first cell. Likely this is an issue in the underlying library that WP-Table Reloaded uses for this.

    Actually, “First Name” without quotes should be fine as well, just e.g. “First,Name” would cause trouble without quotes.

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP-Table Reloaded] Strange import’ is closed to new replies.