Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Ben,
    This error pops up because both plugins use the same PDF engine: DomPDF.
    In my plugin, I make a check whether DOMPDF is already loaded, and if so I’m not loading it again.

    if ( !class_exists('DOMPDF') ) {
    	// extra check to avoid clashes with other plugins using DOMPDF
    	// This could have unwanted side-effects when the version that's already
    	// loaded is different, and it could also miss fonts etc, but it's better
    	// than not checking...
    	require_once( WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/dompdf_config.inc.php" );
    }

    The PDF Product Catalog doesn’t seem to do such a check, hence the fatal error: it’s trying to load a new class under the same name and PHP doesn’t accept that.
    The reason it worked on your development box probably has to do with the order in which the plugins were loaded. If the other plugin loads before the PDF invoices plugin, everything will work more or less fine (see notes above).

    You can advise the plugin author to do the same check in his own plugin, this will most likely solve the issue. I can’t guarantee everything will work exactly the same though, I don’t know which version of DOMPDF he bundles.

    Hope that helps!

    Ewout

    Thread Starter thecornishworkshop

    (@thecornishworkshop)

    Hi Ewout,

    Myself and Kyriakos (the other plugin author) are debugging as we speak. Many thanks for your prompt reply, I will update this post when a solution has been implemented.

    Cheers,

    Ben

    Hi Ewout,

    Thanks for your quick answer.

    I’m the author of the PDF Catalog plugin. It appears that the problem is caused because we both have a class called Renderer in our plugins. I’m changing its name so the conflict will be resolved.

    for the record, I’m using TCPDF as the PDF engine and not DOMPDF and it does check if its already loaded but in this case we found a different conflict.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi Kyriakos,
    Thanks for the feedback. The Renderer class is actually part of DOMPDF and I prefer not to change anything to the library so I’m glad that you were able to solve it on your side!
    I’m actually going to contact the dompdf developers to see if they can do anything about this. They don’t have all of their functions wrapped inside a class which gives a conflict on some installs and their class names are sometimes a bit too generic (like in this case).

    Thanks again for the quick action & enjoy your day!
    Ewout

    Hi!

    I downloaded the PDF Catalog plugin last night. The problem with conflicting classes still exists.

    Can anybody tell me how to solve this?

    Cheers,

    Hub

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Hub,
    I suggest to contact the author of this plugin, perhaps he did not release the version with this fix yet. By the looks of it the author will gladly provide you with a solution.

    Have a fantastic new years eve!
    Ewout

    Thanks Ewout,

    Solved it myself by changing the class-name.

    Cheers,

    Hub

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bug report: Incompatibility with "PDF Product Catalog for WooCommerce"’ is closed to new replies.