Title: Bug with PHP8 + solution
Last modified: February 14, 2024

---

# Bug with PHP8 + solution

 *  Resolved [finzend](https://wordpress.org/support/users/finzend/)
 * (@finzend)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/bug-with-php8-solution/)
 * 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.wordpress.org/browser/wc-vendors/trunk/classes/admin/class-product-meta.php?rev=3035854](https://plugins.trac.wordpress.org/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](https://wordpress.org/support/users/jkohlbach/)
 * (@jkohlbach)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/bug-with-php8-solution/#post-17426055)
 * Hi [@finzend](https://wordpress.org/support/users/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](https://wordpress.org/support/users/finzend/)
 * (@finzend)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/bug-with-php8-solution/#post-17426870)
 * 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://wordpress.org/support/topic/uncaught-valueerror-missing-format-specifier-at-end-of-string/](https://wordpress.org/support/topic/uncaught-valueerror-missing-format-specifier-at-end-of-string/)
 * If you need any extra info, let me know!
 *  [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * (@mkesteban08)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/bug-with-php8-solution/#post-17435602)
 * Hi [@finzend](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/wc-vendors/assets/icon.svg?rev=1645455)
 * [WC Vendors - WooCommerce Multivendor, WooCommerce Marketplace, Product Vendors](https://wordpress.org/plugins/wc-vendors/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-vendors/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-vendors/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-vendors/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-vendors/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-vendors/reviews/)

## Tags

 * [sprintf](https://wordpress.org/support/topic-tag/sprintf/)

 * 3 replies
 * 3 participants
 * Last reply from: [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/bug-with-php8-solution/#post-17435602)
 * Status: resolved