Support

Account

Home Forums Bug Reports Filename conflict causes wp-cli to silently fail

Solving

Filename conflict causes wp-cli to silently fail

  • I know you guys aren’t responsible for wp-cli but this is plugin-specific

    Hey I’m developing a plugin for a client site and was having the weirdest issue. If I was in my plugin’s folder in terminal and ran any wp-cli command it would fail, but it would work just fine everywhere else. I checked my logs and saw this error:

    
    Call to undefined function acf_include()
    

    Long story short I narrowed the culprit down to acf pro and THEN figured out the conflict was because in my plugin I have a file here:

    
    api/api-helpers.php
    

    which conflicts with the ACF Pro file structure.

    Bottom line is it seems like L95 of acf.php:

    
    include_once('api/api-helpers.php');
    

    isn’t namespaced so when run from the command line, if you happen to be in a directory where there is an alternate file with same relative path, it fails. It’s such a crazy specific issue! For now I’m going to rename my file or namespace it or something, but maybe you guys should do the same to prevent conflicts.

    Thanks for your time,
    Eli

  • I don’t know if this will help you but you should probably open a new support ticket here https://support.advancedcustomfields.com/new-ticket/

  • @hube2 I debated opening a ticket but I thought it’d be more helpful for other useres to be able to search for it on the forum. I’ll open a ticket now though, thanks.

  • Yes, it’s probably helpful to post it here if anyone else has a similar issue and finds this topic. But the part about namespacing ACF, that would need to go to the developer.

  • Thanks I opened a ticket yesterday and already got an answer.

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

The topic ‘Filename conflict causes wp-cli to silently fail’ is closed to new replies.