Support » Plugin: TablePress » HTML Import Seems Broken after 1.8.1 Update

  • Resolved blakwid0w

    (@blakwid0w)


    Hello Tobias,

    I believe the latest version 1.8.1 broke the HTML import feature. It keeps throwing a fatal error “Cannot use object of type DOMNodeList as array”. I installed v1.8.0 and the HTML import feature works again. Not sure if this is PHP version related, but if you could please look into it, it will be awesome.

    Great plugin, love it – keep up the excellent work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    TablePress 1.8.1 does indeed contain changes to the HTML import code, so there’s a chance that I accidentally broke something.
    To find out more about this, could you maybe give me the HTML file that is not working for you, e.g. by uploading it somewhere or by sending it to me via email (the address is in the main plugin file “tablepress.php”)? Thanks!

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the email! I could not (yet) reproduce the issue on my site, but that likely is due to different versions of PHP.
    It seems that the issue from https://stackoverflow.com/questions/35845819/fatal-error-cannot-use-object-of-type-domnodelist-as-array could play a role here.
    Just to confirm, can you tell me which version of PHP you are using? (You can find that information on the “About” screen of TablePress.)

    Then, as a test, please try changing line 178 of the classes/class-import.php file from

    $table = simplexml_import_dom( $dom_tables[0] );
    

    to

    $table = simplexml_import_dom( $dom_tables->item( 0 ) );
    

    Thanks!
    Tobias

    You are a genius. That was quick 🙂

    I updated the plugin to v1.8.1, line 178: changed the array notation per your code, imported an HTML table as a test and it works 100%.

    The PHP version I am using: 5.6.27

    Thank you very much Tobias! Your work is highly appreciated!
    Martin

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Martin,

    thanks for testing this!
    It’s strange that you experienced this error, though… PHP 5.6.27 should already allow the array access notation, from what I understand from https://bugs.php.net/bug.php?id=67949

    But, oh well, I will just switch to the proper notation in the next release 🙂

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HTML Import Seems Broken after 1.8.1 Update’ is closed to new replies.