Support » Plugin: FakerPress » Post generation fails

  • Resolved johny-dotpad

    (@johny-dotpad)



    Hi

    I cannot generate posts anymore after updating to 0.4.10. Empty error bar appears and then fails.

    I am using Laravel Valet to serve my site.

    WP_DEBUG dumped out the following:

    [19-Feb-2018 14:36:30 UTC] PHP Fatal error:  Uncaught Error: Class 'FakerPress' not found in /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/providers/wp-post.php:82
    Stack trace:
    #0 [internal function]: Faker\Provider\WP_Post->post_content(false, Array)
    #1 /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Generator.php(196): call_user_func_array(Array, Array)
    #2 /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/vendor/fzaninotto/faker/src/Faker/Generator.php(247): Faker\Generator->format('post_content', Array)
    #3 [internal function]: Faker\Generator->__call('post_content', Array)
    #4 /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/modules/base.php(213): call_user_func_array(Array, Array)
    #5 /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/modules/base.php(190): FakerPress\Module\Base->apply(Object(stdClass))
    #6 /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/modules/post.php(182): FakerPress\Module\Base->generate()
    #7 /Volumes/work/Sites/wfitness/wp-content/plu in /Volumes/work/Sites/wfitness/wp-content/plugins/fakerpress/providers/wp-post.php on line 82
Viewing 5 replies - 1 through 5 (of 5 total)
  • Found a fix for this issue, the error points line 82 of /providers/wp-post.php

    That line calls the FakerPress namespace rather than FakerPress\Utils class

    I changed:

    $content = implode( "\r\n\r\n", $this->generator->paragraphs( FakerPress::instance()->get_qty_from_range( $args['qty'] ) ) );

    to

    $content = implode( "\r\n\r\n", $this->generator->paragraphs( FakerPress\Utils::instance()->get_qty_from_range( $args['qty'] ) ) );

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Thanks a ton @johny-dotpad, I will release a version today with the bug fix included.

    It was a oversight by me.

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Just released 0.4.11 with a bugfix for the problem, let me know if it solves the problem.

    Hi Gustavo,

    Just to confirm the update 0.4.11 has fixed the issue now.

    Many thanks
    Johny

    Plugin Author Gustavo Bordoni

    (@bordoni)

    Thanks @johny-dotpad! =)

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.