• Resolved finzend

    (@finzend)


    Hi, first of all, great plugin! I use the free version but got an error on line 288/290 in classes/admin/class-product-meta.php

    I tried to report an issue via trac but havent got the rights, so thats why I’m posting it here;) Its about this file, line 290: https://plugins.trac.www.ads-software.com/browser/wc-vendors/trunk/classes/admin/class-product-meta.php?rev=3035854

    When using PHP8 the sprintf function gives a ValueError because there’s no chars after the string var. A temp solution would be to add a space after the %s, like: __( ‘Assign media to %s ‘, ‘wc-vendors’ ),

    Hope you can do something with it, if you need any extra info, please let me know!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Josh Kohlbach

    (@jkohlbach)

    Hi @finzend,

    Thanks for the message. I’m on 8.2 and I’m not seeing this error. The %s on the sprintf statement here will fetch the vendor name (which will be empty sometimes, but still should not error).

    Can you confirm the exact steps you took to replicate?

    Thread Starter finzend

    (@finzend)

    Hi Josh,

    Thanks for the quick reply. Below the info + error that I got:

    WordPress version 6.4.3
    Active Theme: Ocean Child Theme (version 1.1)
    Current plugin: WC Vendors Marketplace (version 2.4.8.2)
    PHP version 8.2.15

    Fatal error: Uncaught ValueError: Missing format specifier at end of string in /var/www/vhosts/mydomain/wp-content/plugins/wc-vendors/classes/admin/class-product-meta.php:288 Stack trace: #0 /var/www/vhosts/mydomain/wp-content/plugins/wc-vendors/classes/admin/class-product-meta.php(288): sprintf(‘Media toewijzen…’, ‘Verkoper’) #1 /var/www/vhosts/mydomain/wp-content/plugins/wc-vendors/classes/admin/class-product-meta.php(168): WCV_Product_Meta::vendor_selectbox(Array) #2 /var/www/vhosts/mydomain/wp-includes/class-wp-hook.php(324): WCV_Product_Meta->author_vendor_roles(‘apply_filters(‘<select name=’p…’, Array) #4 /var/www/vhosts/mydomain/wp-includes/user.php(1732): apply_filters(‘wp_dropdown_use…’, ‘<select name=’p…’) #5 /var/www/vhosts/mydomain/wp-admin/includes/meta-boxes.php(970): wp_dropdown_users(Array) #6 /var/www/vhosts/mydomain/wp-admin/includes/template.php(1456): post_author_meta_box(Object(WP_Post), Array) #7 /var/www/vhosts/mydomain/wp-admin/edit-form-advanced.php(714): do_meta_boxes(Object(WP_Screen), ‘normal’, Object(WP_Post)) #8 /var/www/vhosts/mydomain/wp-admin/post.php(206): require(‘/var/www/vhosts…’) #9 {main} thrown in /var/www/vhosts/mydomain/wp-content/plugins/wc-vendors/classes/admin/class-product-meta.php on line 288

    As said, when I add a space or extra char after the %s the error is gone.. I found this ‘solution’ via the following link: https://www.ads-software.com/support/topic/uncaught-valueerror-missing-format-specifier-at-end-of-string/

    If you need any extra info, let me know!

    Plugin Support Mark Kevin

    (@mkesteban08)

    Hi @finzend,

    Good day, and thank you very much for providing us with this log.

    I’ll be sure to proceed in forwarding this to our development, to have this checked. We’ll be sure to get back to you as soon as we have additional information regarding this. Thanks for your kind understanding.

    Have a wonderful day ahead!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug with PHP8 + solution’ is closed to new replies.