WordPress.org

Ready to get started?Download WordPress

Forums

WP Post to PDF
[resolved] WP Post to PDF incompatibility with Lightbox Plus plugin (6 posts)

  1. sravenscroft
    Member
    Posted 2 years ago #

    Running versions:
    Wordpress: v3.4.1
    Lightbox Plus: v2.4.6
    WP Post to PDF: v2.3

    Error experienced:
    PHP Fatal error: Cannot redeclare file_get_html() (previously declared in /var/www/wp-content/plugins/lightbox-plus/classes/shd.class.php:68) in /var/www/wp-content/plugins/wp-post-to-pdf/simplehtmldom/simple-html-dom.php on line 80

    Resolution:
    Wrap the file_get_html function in the simple-html-dom.php file (included with the WP Post to PDF plugin) in an if function to check if it has already been declared.

    Reference:
    http://www.ehow.com/info_12177995_fatal-error-cannot-redeclare-filegethtml-previously-declared-wordpress.html

    I have manually updated the code on my installation and it seems to be working now.

    Perhaps the developer of this plugin would like to permanently add this and release an update to the plugin?

    http://wordpress.org/extend/plugins/wp-post-to-pdf/

  2. sravenscroft
    Member
    Posted 2 years ago #

    PHP Fatal error: Cannot redeclare str_get_html()

    That function, in the same file also needs to be wrapped in an if function.

    Quite possibly there are other fucntions that will also need to be wrapped.

  3. sravenscroft
    Member
    Posted 2 years ago #

    Also dump_html_tree should be wrapped.

  4. sravenscroft
    Member
    Posted 2 years ago #

    Ok.... So what I thought was going to be a quick fix turns out to be a bit more complicated.

    I'm not a PHP developer, so I might be off base here, or there could be a much simpler solution - I will leave that to the developer of the plugin.

    However the classes in the file must also be wrapped with an if function to check if they haven't already been declared.

  5. Neerav Dobaria
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks mate for posting it here!

    It will be fixed in next version. ASAP!

  6. Neerav Dobaria
    Member
    Plugin Author

    Posted 2 years ago #

    This issue is fixed in version 2.3.1, released today!

    Thanks once again for taking time to post it here Sraven :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.