• Resolved mkrause

    (@mkrause)


    Hi,

    I’m getting a recurring fatal error when printing via:

    /wp-admin/admin-ajax.php?print-order=XXX&print-order-type=packingslip&action=print_order

    PHP Fatal error: Uncaught Error: Undefined constant "Tyche\WCDN\Services\FS_CHMOD_FILE" in .../includes/services/class-pdf.php:427

    Plugin version: 7.2.0
    WordPress version: 7.0
    PHP version: 8.3.31

    Likely cause: it seems that wp-admin/includes/file.php which defines the constant isn’t always loaded during an admin-ajax.php request.

    The issue may be related to the fact that FS_METHOD is set to ssh2 rather than direct in my setup (however, ssh2 works perfectly in other cases like updating or installing plugins and so on). The issue also appeared with recent versions of the plugin while it worked fine for several years before. Unfortunately, I don’t know which exact version of the plugin started the issue.

    Thanks for looking into it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @mkrause,

    I’m sorry for the inconvenience caused.

    Thank you for reporting this issue and for providing the detailed information about your setup.

    Could you please update this plugin to the latest version 7.2.1 and check whether the fatal error is resolved on your site?

    Please let us know the results after updating, and we’ll be happy to assist further if needed.

    Thread Starter mkrause

    (@mkrause)

    Hi @priyankajagtap, unfortunately, the issue peristsisted after updating to the version 7.2.1:

    PHP Fatal error:  Uncaught Error: Undefined constant “Tyche\WCDN\Services\FS_CHMOD_FILE” in wp-content/plugins/woocommerce-delivery-notes/includes/services/class-pdf.php:427

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @mkrause,

    Thank you for the update.

    I tried replicating the issue on our staging site, but I was unable to reproduce it. I tested printing packing slips as well as other document types, and no errors were generated during testing.

    Could you please share screenshots of your Print Invoice & Delivery Notes plugin settings? This will help me configure our staging site similarly to yours and attempt to reproduce the issue under the same conditions.

    I look forward to your reply.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @mkrause,

    I have forwarded this error to our development team. Our developer has reviewed the issue and prepared a patch that may resolve the Undefined constant FS_CHMOD_FILE error you’re encountering.

    Patch file:
    https://www.dropbox.com/scl/fi/hgovfgcnsderwbxc548xp/class-pdf.php?rlkey=12l84lzqv2saacr8syhql58mn&st=qyc4faa9&dl=0

    File path to replace:
    wp-content/plugins/woocommerce-delivery-notes/includes/services/class-pdf.php

    Could you please replace the existing file with the patched version and test the printing functionality again?

    Please let us know whether the issue is resolved after applying the patch. Your feedback will help us verify the fix so that we can include it in an upcoming plugin release.

    We look forward to hearing from you.

    Thread Starter mkrause

    (@mkrause)

    Hi @priyankajagtap, thank you for the patch, now it works perfectly!

    Regards
    Michal

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @mkrause,

    Thank you for testing the patch and for confirming that it resolved the issue.

    I’m glad to hear that the printing functionality is working correctly now.

    We’ll include this fix in our next plugin release so that it will be available to all users.

    If everything continues to work well, we’d really appreciate it if you could leave us a quick review here. That would help us immensely. 🙂

    Feel free to contact us if you have any questions.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.