You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
works so far on a test site, problem exists when trying to write to a custom field (user) occurs using both jetengine and simple php.
recreation
Add User meta with php or plugin like jetengine
then generate users with Meta Field Rules of Type Text, Name Fake, config sentences (1 or more)
explanation
array_values() re‐indexes the array to [0 => value_for_min, 1 => value_for_max], removing the string keys.
Now call_user_func_array([...], $qty_args) sees a plain numeric array (e.g., [1, 5]) and calls numberBetween($min = 1, $max = 5) positionally, which works with the standard Faker signature.
this code WP_Meta.php(27):
$qty = (int) ( is_array( $qty ) && count( $_qty ) > 1 ? call_user_func_array( [ $this->generator, 'numberBetween' ], $qty ) : reset( $_qty ) );
changed to
$qty_args = array_values( (array) $qty ); $qty = (int) ( is_array( $qty_args ) && count( $qty_args ) > 1 ? call_user_func_array( [ $this->generator, 'numberBetween' ], $qty_args ) : reset( $qty_args ) );
works so far on a test site, problem exists when trying to write to a custom field (user) occurs using both jetengine and simple php.
recreation
explanation
array_values() re‐indexes the array to [0 => value_for_min, 1 => value_for_max], removing the string keys.
Now call_user_func_array([...], $qty_args) sees a plain numeric array (e.g., [1, 5]) and calls numberBetween($min = 1, $max = 5) positionally, which works with the standard Faker signature.
debug log
[24-Jan-2025 07:27:06 UTC] PHP Fatal error: Uncaught Error: Unknown named parameter $min in /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Provider/WP_Meta.php:27
Stack trace:
#0 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Provider/WP_Meta.php(27): call_user_func_array(Array, Array)
#1 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Provider/WP_Meta.php(105): FakerPress\Provider\WP_Meta->meta_parse_qty(Array)
#2 [internal function]: FakerPress\Provider\WP_Meta->meta_type_text('sentences', Array, '\n', 100)
#3 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/vendor-prefixed/fakerphp/faker/src/Faker/Generator.php(713): call_user_func_array(Array, Array)
#4 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/vendor-prefixed/fakerphp/faker/src/Faker/Generator.php(978): FakerPress\ThirdParty\Faker\Generator->format('meta_type_text', Array)
#5 [internal function]: FakerPress\ThirdParty\Faker\Generator->__call('meta_type_text', Array)
#6 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Module/Meta.php(145): call_user_func_array(Array, Array)
#7 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Module/User.php(196): FakerPress\Module\Meta->generate()
#8 /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Ajax.php(83): FakerPress\Module\User->parse_request(4, Array)
#9 /Users/b/Local Sites/carg/app/public/wp-includes/class-wp-hook.php(324): FakerPress\Ajax::module_generate('')
#10 /Users/b/Local Sites/carg/app/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#11 /Users/b/Local Sites/carg/app/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#12 /Users/b/Local Sites/carg/app/public/wp-admin/admin-ajax.php(192): do_action('wp_ajax_fakerpr...')
#13 {main}
thrown in /Users/b/Local Sites/carg/app/public/wp-content/plugins/fakerpress/src/FakerPress/Provider/WP_Meta.php on line 27
The text was updated successfully, but these errors were encountered: