Home » Topics » Priority Support » Errors when running wp cli commands

Errors when running wp cli commands

ACF Widgets Support Priority Support Errors when running wp cli commands

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Daron Spence 3 years, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17656

    Przemek Cichoń
    Participant

    Hi Daron,

    Please find the error messages below which I only get in terminal when running any wp cli command

    
    PHP Catchable fatal error:  Argument 1 passed to acfw_location_rules() must be of the type array, null given, called in /var/www/docs/wp-content/plugins/acf-widgets/includes/default-widgets.php on line 69 and defined in /var/www/docs/wp-content/plugins/acf-widgets/includes/helper-functions.php on line 13
    Catchable fatal error: Argument 1 passed to acfw_location_rules() must be of the type array, null given, called in /var/www/docs/wp-content/plugins/acf-widgets/includes/default-widgets.php on line 69 and defined in /var/www/docs/wp-content/plugins/acf-widgets/includes/helper-functions.php on line 13
    

    Will you be able to assist in this case?

    Thanks,
    Przemek

    #17663

    Przemek Cichoń
    Participant

    as a workaround I’ve replaced

    
    $default_widgets = $GLOBALS['acfw_default_widgets'];
    

    in line 67 and 121 of default-widgets.php with the following

     
    $default_widgets = isset( $GLOBALS['acfw_default_widgets'] ) ? $GLOBALS['acfw_default_widgets'] : [];
    

    and for my scenarios it works

    #17664

    Daron Spence
    Keymaster

    Hey Przemek! Thanks for pointing this out. Seems like a situation similar to some problems I had with AJAX early on in the lifecycle. I’ll add some extra checks to make sure WordPress is running in the correct context (WP_CLI vs HTTP) and should have a fix push out before the end of this week!

    Again, thanks for finding this!

    #19637

    Przemek Cichoń
    Participant

    Hey Daron,

    Great! Thank you for your feedback on it.

    Have a great week!

    regards,
    Przemek

    #22299

    Daron Spence
    Keymaster

    Hey Przemek, this was fixed in the newest version of ACFW (1.7) that I just pushed. The update should be available in your dashboard, or you can force an update check by visiting the “Updates” screen and clicking the “Check Now” button. 🙂

    Thanks for your help getting this resolved & thank you again for your support of the plugin! I really do appreciate it! Thanks to you, February was the most successful month ever in ACFW history! I’m so excited that so many people are finding value in my little side project 🙂

    Cheers!

    #23176

    Przemek Cichoń
    Participant

    Hey Daron,

    Thank you for fixing it. Your plugin is really usefull. I rarely used widgets before but in my recent project thanks to your plugin which makes them easy to implement I found them extremely useful.

    Thanks again 🙂

    Best regards,
    Przemek

    #28720

    Daron Spence
    Keymaster

    Closing this thread.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Errors when running wp cli commands’ is closed to new replies.